Skip to content

fix(bbb-learning-dashboard): Poll/Quiz sorting - #23595

Merged
antobinary merged 2 commits into
bigbluebutton:v3.0.x-releasefrom
JoVictorNunes:poll-sorting
Jul 23, 2025
Merged

antobinary merged 2 commits into
bigbluebutton:v3.0.x-releasefrom
JoVictorNunes:poll-sorting

Conversation

@JoVictorNunes

@JoVictorNunes JoVictorNunes commented Jul 22, 2025 •

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Sort poll/quizzes by creation time in descendant order so users see the latest polls/quizzes first.

Closes Issue(s)

Closes none

More

This PR tags the Learning A. Dashboard poll testing as flaky because it changes the behavior of the Polls table.

- Sort poll/quizzes by creation time in descendant order so users see the latest polls/quizzes first
@coderabbitai

coderabbitai Bot commented Jul 22, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

The changes update the ordering of items in two components: PollsTable and QuizzesTable. Both components now sort their respective data objects—polls and quizzes—by the createdOn timestamp in descending order before mapping over them. This ensures that the most recently created items are processed and displayed first. Additionally, a test case named "Polls" in the Learning Dashboard test suite was marked as flaky by adding the @flaky tag. No other logic, control flow, or exported/public entity declarations were modified.

Estimated code review effort

2 (~15 minutes)

Suggested reviewers

  • ramonlsouza

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 899c2b9 and ed36525.

📒 Files selected for processing (1)
  • bigbluebutton-tests/playwright/learningdashboard/learningdashboard.spec.js (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • bigbluebutton-tests/playwright/learningdashboard/learningdashboard.spec.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: build-package (bbb-graphql-server)
  • GitHub Check: build-package (bbb-webrtc)
  • GitHub Check: build-package (others)
  • GitHub Check: build-package (bbb-playback-record)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
bbb-learning-dashboard/src/components/PollsTable.jsx (1)

301-301: Sorting implementation looks correct, but consider the impact on default poll naming.

The descending sort by createdOn timestamp is correctly implemented and achieves the PR objective. However, the default poll naming logic (Poll ${i + 1}) now uses the sorted index rather than the original creation order, which may cause confusion if polls don't have custom questions.

Consider updating the default naming to use a more stable identifier:

-    const headerName = v?.question?.length > 0 ? v?.question : `Poll ${i + 1}`;
+    const headerName = v?.question?.length > 0 ? v?.question : `Poll ${v?.pollId}`;
bbb-learning-dashboard/src/components/QuizzesTable.jsx (1)

304-304: Consistent sorting implementation - well done!

The sorting logic matches the implementation in PollsTable.jsx, providing a consistent user experience across both components. The descending sort by createdOn correctly displays the most recent quizzes first.

Same consideration as PollsTable regarding default naming - consider using quiz ID instead of sorted index:

-    const headerName = v?.question?.length > 0 ? v?.question : `Quiz ${i + 1}`;
+    const headerName = v?.question?.length > 0 ? v?.question : `Quiz ${v?.pollId}`;
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 553c264 and 899c2b9.

📒 Files selected for processing (2)
  • bbb-learning-dashboard/src/components/PollsTable.jsx (1 hunks)
  • bbb-learning-dashboard/src/components/QuizzesTable.jsx (1 hunks)
🧠 Learnings (1)
📓 Common learnings
Learnt from: gustavotrott
PR: bigbluebutton/bigbluebutton#23137
File: bbb-graphql-server/bbb_schema.sql:2022-2027
Timestamp: 2025-05-09T14:36:13.418Z
Learning: User acknowledged that adding an ORDER BY clause to the DISTINCT ON query in v_breakoutRoom_commonProperties view makes sense but deferred implementation since "startedAt" values are mostly the same for all rooms.
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: gustavotrott
PR: bigbluebutton/bigbluebutton#23137
File: bbb-graphql-server/bbb_schema.sql:2022-2027
Timestamp: 2025-05-09T14:36:13.418Z
Learning: User acknowledged that adding an ORDER BY clause to the DISTINCT ON query in v_breakoutRoom_commonProperties view makes sense but deferred implementation since "startedAt" values are mostly the same for all rooms.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: build-package (bbb-playback-record)
  • GitHub Check: build-package (others)
  • GitHub Check: build-package (bbb-graphql-server)
  • GitHub Check: build-package (bbb-learning-dashboard)
  • GitHub Check: plugin-sdk-version-check

@ramonlsouza ramonlsouza added this to the Release 3.0 milestone Jul 23, 2025
@ramonlsouza
ramonlsouza requested a review from gabriellpr July 23, 2025 11:50
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Automated tests Summary

🚨 Test workflow has failed


Click here to check the action test reports (to view the report locally, see the docs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants