:art: Enable to update submission status from drop down in task list by grades and detailed workbook page (#1858)
close #1858
Summary by CodeRabbit
-
New Features
- Introduced a new component for displaying task submission statuses directly within tables.
- Enabled customizable dropdown styling for enhanced visual feedback.
-
Refactor
- Replaced modal-based task updates with inline interactions for a streamlined user experience.
- Updated handling of task status changes for real-time updates.
-
Style
- Improved dropdown alignment and positioning for better usability.
Walkthrough
This pull request introduces a new Svelte component, SubmissionStatusInTableBodyCell, which encapsulates a table cell showing the submission status and integrates an updating dropdown. The UpdatingDropdown component has been enhanced with a new dropdownClass property and refined type definitions. Additionally, the modal logic previously used in TaskList and workbook pages has been removed in favor of directly updating task results via an updateTaskResult function triggered by the new dropdown and cell component interactions.
Changes
| File Path(s) | Change Summary |
|---|---|
src/lib/components/SubmissionStatus/SubmissionStatusInTableBodyCell.svelte |
Introduces a new component that wraps a table cell with a submission status image and an UpdatingDropdown, handling click events and emitting update events. |
src/lib/components/SubmissionStatus/UpdatingDropdown.sveltesrc/lib/components/TaskTables/…/TaskTableBodyCell.svelte |
Adds an optional dropdownClass property for dynamic styling and updates type definitions (including imagePath in SubmissionStatus) and method signatures for clearer structure. |
src/lib/components/TaskList.sveltesrc/routes/workbooks/[slug]/+page.svelte |
Removes modal components and logic; introduces an updateTaskResult function for direct task result updates and integrates the new SubmissionStatus table cell component. |
Sequence Diagram(s)
sequenceDiagram
participant U as User
participant TS as SubmissionStatusInTableBodyCell
participant UD as UpdatingDropdown
participant P as Parent Component
U->>TS: Click on submission status cell
TS->>UD: Toggle dropdown visibility
U->>UD: Select new status option
UD->>P: Emit onupdate event with updated task result
P->>P: Update task result state internally
P->>TS: Re-render with updated submission status
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
| [UI] Allow updating submission status via dropdown (#1858) | ✅ |
Poem
I'm a coding rabbit, hopping with delight,
Crafting dropdowns glowing in the soft screen light.
Tasks update smoothly as I bounce along the code,
In every updated cell, a new story is told.
Hoppy days ahead—celebrate the upgrade! 🐇✨
📜 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 20e1f3eb2bb4c65d2ca4e207e8023f5e997781b3 and e6d18bbc9e632f0cf9469f8fcdc487f02d6aa27f.
📒 Files selected for processing (1)
-
src/lib/components/SubmissionStatus/UpdatingModal.svelte(0 hunks)
💤 Files with no reviewable changes (1)
- src/lib/components/SubmissionStatus/UpdatingModal.svelte
🪧 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. -
Generate unit testing code for this file. -
Open a follow-up GitHub issue for this discussion.
-
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:-
@coderabbitai generate unit testing code for this file. -
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitaiin 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 generate unit testing code. -
@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.
-
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 pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai generate docstringsto generate docstrings for this PR. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile 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.