Skip to content

Conversation

@Shironex
Copy link
Collaborator

@Shironex Shironex commented Dec 24, 2025

  • Reuse log viewwer from agent output to ai suggestion

Old

Image

New

image

Resolve

Summary by CodeRabbit

Release Notes

  • New Features
    • Added toggle between parsed log view and raw text for suggestions analysis progress visualization
    • New view mode buttons ("Logs" and "Raw") in the suggestions dialog for flexible progress monitoring
    • New waiting indicator displayed when awaiting AI response during analysis
    • Improved formatting and presentation of tool information in progress logs with structured JSON display

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 24, 2025

📝 Walkthrough

Walkthrough

This PR improves feature suggestion output by removing early progress event emission on the server side and enhancing the UI with a dual-view mode (parsed logs via LogViewer or raw text), better formatting for tool events with JSON input display, and improved progress visibility with a waiting state indicator.

Changes

Cohort / File(s) Summary
Server-side progress handling
apps/server/src/routes/suggestions/generate-suggestions.ts
Removed initial progress event emission for suggestions analysis. First agent message will now be captured as info entry, changing early user-visible update flow.
UI display and state management
apps/ui/src/components/views/board-view/dialogs/feature-suggestions-dialog.tsx
Added viewMode state ('parsed' | 'raw') to toggle between LogViewer-rendered parsed logs and raw text display. Enhanced 'suggestions_tool' event formatting to include tool name and pretty-printed JSON input. Introduced viewMode toggle control group replacing previous Stop button area. Improved progress display with waiting state indicator, LogViewer integration, and expanded hasStarted condition. Added steps: [] field to Feature object creation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 A dialog dressed in dual-mode delight,
Parsed logs and raw views, both shining bright!
The AI's whispers, formatted with care,
Tool details dancing through the UI air. ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR contains one out-of-scope change: removal of initial progress event emission in generate-suggestions.ts unrelated to the UI improvement objective. Review whether the initial progress event removal is necessary for the UI changes or if it should be a separate PR addressing a different concern.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: improving the UI for AI suggestion output, which is the primary focus of modifications to the feature-suggestions-dialog component.
Linked Issues check ✅ Passed The PR successfully addresses issue #254 by reusing LogViewer component and implementing parsed/raw view modes to improve feature suggestion output presentation from plain text.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/improve-ai-suggestions-ui

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

@gemini-code-assist
Copy link
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 refactors the AI suggestion output display to provide a more user-friendly and informative experience. By integrating a dedicated log viewer and introducing a toggle for parsed versus raw output, users gain better insight into the AI's analysis process. This change also streamlines the initial progress reporting and enhances the detail provided for AI tool interactions.

Highlights

  • Enhanced AI Suggestion UI: The user interface for displaying AI suggestions has been significantly improved by reusing the existing log viewer component, providing a more structured and readable output.
  • Toggleable Output View: Users can now switch between a 'Logs' (parsed) view and a 'Raw' text view of the AI's progress and output, offering flexibility in how they consume information.
  • Detailed Tool Usage Logging: The display of AI tool usage now includes the tool's input, providing more context and transparency during the suggestion generation process.
  • Streamlined Initial Progress: The server no longer sends an initial 'Starting analysis' message, allowing the agent's output to be the primary and more direct source of progress updates.

🧠 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 self-assigned this Dec 24, 2025
@Shironex Shironex added Enhancement Improvements to existing functionality or UI. Ready-To-Merge A feature or bug has been improved/fixed and a final review is requested before merging. labels Dec 24, 2025
Copy link
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 significantly improves the user interface for AI suggestion output by integrating the LogViewer component, which provides a much richer experience with both parsed and raw log views. The logic for handling the generation state has also been correctly improved. The changes are well-implemented, with just one minor opportunity to reduce code duplication in the new view mode toggle buttons for better long-term maintainability.

Copy link

@coderabbitai coderabbitai bot left a comment

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)
apps/ui/src/components/views/board-view/dialogs/feature-suggestions-dialog.tsx (2)

128-132: Consider wrapping JSON.stringify in a try-catch for defensive coding.

While event.input is likely pre-validated server-side, JSON.stringify can throw on circular references or certain edge cases. A defensive approach would prevent potential runtime errors:

🔎 Proposed defensive fix
       } else if (event.type === 'suggestions_tool') {
         const toolName = event.tool || 'Unknown Tool';
-        const toolInput = event.input ? JSON.stringify(event.input, null, 2) : '';
+        let toolInput = '';
+        if (event.input) {
+          try {
+            toolInput = JSON.stringify(event.input, null, 2);
+          } catch {
+            toolInput = String(event.input);
+          }
+        }
         const formattedTool = `\n🔧 Tool: ${toolName}\n${toolInput ? `Input: ${toolInput}\n` : ''}`;
         setProgress((prev) => [...prev, formattedTool]);

381-412: Consider adding accessibility attributes to the toggle buttons.

The toggle buttons function as a tab-like selection but lack semantic attributes for screen readers. Adding aria-pressed would improve accessibility:

🔎 Proposed accessibility improvement
                   <button
                     onClick={() => setViewMode('parsed')}
+                    aria-pressed={viewMode === 'parsed'}
                     className={`flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium transition-all ${
                       viewMode === 'parsed'
                         ? 'bg-primary/20 text-primary shadow-sm'
                         : 'text-muted-foreground hover:text-foreground hover:bg-accent'
                     }`}
                     data-testid="view-mode-parsed"
                   >
                     <List className="w-3 h-3" />
                     Logs
                   </button>
                   <button
                     onClick={() => setViewMode('raw')}
+                    aria-pressed={viewMode === 'raw'}
                     className={`flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium transition-all ${
                       viewMode === 'raw'
                         ? 'bg-primary/20 text-primary shadow-sm'
                         : 'text-muted-foreground hover:text-foreground hover:bg-accent'
                     }`}
                     data-testid="view-mode-raw"
                   >
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d50b15e and 0461045.

📒 Files selected for processing (2)
  • apps/server/src/routes/suggestions/generate-suggestions.ts
  • apps/ui/src/components/views/board-view/dialogs/feature-suggestions-dialog.tsx
🧰 Additional context used
🧬 Code graph analysis (1)
apps/ui/src/components/views/board-view/dialogs/feature-suggestions-dialog.tsx (1)
apps/ui/src/components/ui/log-viewer.tsx (1)
  • LogViewer (406-764)
⏰ 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). (1)
  • GitHub Check: e2e
🔇 Additional comments (6)
apps/ui/src/components/views/board-view/dialogs/feature-suggestions-dialog.tsx (5)

24-26: LGTM!

New imports are correctly added and all are used in the component - icons for the view mode toggle buttons and LogViewer for the parsed log display.

Also applies to: 35-35


98-98: LGTM!

State declaration is appropriate with a sensible default of 'parsed' to showcase the improved UI by default.


250-258: LGTM!

Adding the required steps: [] field ensures Feature objects satisfy the type contract. Empty array is appropriate for imported suggestions.


307-307: LGTM!

Including isGenerating in the condition ensures immediate UI transition when generation starts, even before any progress events arrive. This works well with the new waiting state indicator.


419-430: LGTM with minor optimization opportunity.

The waiting state and dual-view rendering logic is well-structured. The waiting indicator provides good feedback during server latency.

For a minor optimization, consider memoizing progress.join('') since it's computed on every render:

🔎 Optional memoization (nice-to-have)
const progressOutput = useMemo(() => progress.join(''), [progress]);

Then use progressOutput in both LogViewer and raw display. This is optional since the progress array is likely small.

apps/server/src/routes/suggestions/generate-suggestions.ts (1)

66-67: The code change is correct and the UI properly handles the waiting state.

The removal of the initial progress event aligns with the PR objectives. Verification confirms the UI properly displays a loading state ("Waiting for AI response...") with a spinner while waiting for the first agent message, preventing any blank screen or hung appearance. The first agent message becomes the first entry in the progress log displayed by LogViewer, which is what the comment refers to as "captured as an info entry."

The comment could be slightly clearer (e.g., "The first agent message will appear as the first entry in the progress log"), but the implementation is solid with no functional issues or regression risk.

@webdevcody webdevcody merged commit 44e341a into main Dec 24, 2025
9 checks passed
@webdevcody webdevcody deleted the feat/improve-ai-suggestions-ui branch December 24, 2025 03:33
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. Ready-To-Merge A feature or bug has been improved/fixed and a final review is requested before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve feature suggestion output

3 participants