Skip to content

feat: add discard all functionality to ideation view#506

Merged
Shironex merged 1 commit intov0.12.0rcfrom
feature/v0.12.0rc-1768509904121-pjft
Jan 15, 2026
Merged

feat: add discard all functionality to ideation view#506
Shironex merged 1 commit intov0.12.0rcfrom
feature/v0.12.0rc-1768509904121-pjft

Conversation

@Shironex
Copy link
Copy Markdown
Collaborator

Changes from branch feature/v0.12.0rc-1768509904121-pjft

- Introduced a new button in the IdeationHeader for discarding all ideas when in dashboard mode.
- Implemented state management for discard readiness and count in IdeationView.
- Added confirmation dialog for discarding ideas in IdeationDashboard.
- Enhanced bulk action readiness checks to include discard operations.

This update improves user experience by allowing bulk discarding of ideas with confirmation, ensuring actions are intentional.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 15, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Shironex, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new "Discard All" feature to the ideation view, enabling users to efficiently remove multiple filtered suggestions at once. The functionality is designed with user experience in mind, incorporating a confirmation dialog to prevent unintended actions. This enhancement streamlines the idea management process by providing a clear and safe method for bulk deletion, complementing the existing "Accept All" feature.

Highlights

  • New "Discard All" Functionality: Introduced the ability to discard all currently filtered ideas within the ideation dashboard, providing a bulk removal option.
  • Confirmation Dialog for Discard: Implemented a confirmation dialog that appears before discarding ideas, preventing accidental data loss and ensuring user intent.
  • UI Integration: A new "Discard All" button has been added to the IdeationHeader, which dynamically displays the count of ideas ready to be discarded and is styled destructively.
  • Code Consistency and Refinements: A pluralizeIdea helper function was added for consistent pluralization of 'idea/ideas' across the UI, and state management for bulk actions was improved.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@Shironex Shironex added the Enhancement Improvements to existing functionality or UI. label Jan 15, 2026
@Shironex Shironex merged commit d9571bf into v0.12.0rc Jan 15, 2026
6 checks passed
@Shironex Shironex deleted the feature/v0.12.0rc-1768509904121-pjft branch January 15, 2026 21:39
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully adds the 'Discard All' functionality to the ideation view, including a confirmation dialog to prevent accidental data loss. The code is well-structured and introduces a helpful pluralizeIdea utility to improve consistency in user-facing messages.

My main feedback is regarding concurrency handling for bulk operations. The new 'Discard All' action can run at the same time as 'Accept All', which could lead to race conditions. I've left a comment with a suggestion to introduce an isDiscardingAll state to prevent this, similar to how isAcceptingAll is already handled.

Comment on lines +331 to +340
const confirmDiscardAll = useCallback(() => {
const count = filteredSuggestions.length;
for (const { suggestion, job } of filteredSuggestions) {
removeSuggestionFromJob(job.id, suggestion.id);
}
toast.info(`Discarded ${count} ${pluralizeIdea(count)}`);
}, [filteredSuggestions, removeSuggestionFromJob]);

// Common readiness state for bulk operations
const bulkActionsReady = filteredSuggestions.length > 0 && !isAcceptingAll && !addingId;
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.

high

The current implementation lacks protection against concurrent bulk operations. A user could trigger 'Accept All' while the 'Discard All' confirmation is open, leading to a race condition.

To fix this, you should introduce an isDiscardingAll state, similar to the existing isAcceptingAll state, to ensure only one bulk action can run at a time.

  1. Add the state near your other state declarations (around line 188):

    const [isDiscardingAll, setIsDiscardingAll] = useState(false);
  2. Update confirmDiscardAll to set this state during the operation:

    const confirmDiscardAll = useCallback(() => {
      setIsDiscardingAll(true);
      try {
        const count = filteredSuggestions.length;
        for (const { suggestion, job } of filteredSuggestions) {
          removeSuggestionFromJob(job.id, suggestion.id);
        }
        toast.info(`Discarded ${count} ${pluralizeIdea(count)}`);
      } finally {
        setIsDiscardingAll(false);
      }
    }, [filteredSuggestions, removeSuggestionFromJob]);
  3. Update bulkActionsReady to be aware of the new state:

    const bulkActionsReady = filteredSuggestions.length > 0 && !isAcceptingAll && !addingId && !isDiscardingAll;

This will ensure the UI correctly reflects the busy state and prevents concurrent actions by hiding the bulk action buttons while one is in progress.

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

Labels

Enhancement Improvements to existing functionality or UI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant