refactor: update ideation dashboard and prompt list to use project-sp…#358
refactor: update ideation dashboard and prompt list to use project-sp…#358webdevcody merged 2 commits intov0.8.0rcfrom
Conversation
…ecific job retrieval - Modified IdeationDashboard and PromptList components to fetch generation jobs specific to the current project. - Updated addGenerationJob function to include projectPath as a parameter for better job management. - Introduced getJobsForProject function in the ideation store to streamline job filtering by project.
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughThis pull request introduces comprehensive AI agent specifications and code review command documentation in the Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
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. Comment |
Summary of ChangesHello @webdevcody, 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 ideation feature to introduce project-specific scoping for generation jobs. Previously, all ideation jobs might have been visible regardless of the active project. By associating each job with a Highlights
🧠 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 AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request refactors the ideation dashboard and prompt list to display generation jobs specific to the current project, which is a great enhancement for multi-project usability. However, the current implementation introduces a critical reactivity bug by using a non-reactive function from the Zustand store to filter jobs. This will cause the UI to not update when job statuses change. My review includes specific code suggestions to fix this reactivity issue by using useMemo and selecting the full jobs list from the store. I've also recommended removing the newly added non-reactive store function to prevent future issues.
| const { getJobsForProject, removeSuggestionFromJob } = useIdeationStore(); | ||
| const [addingId, setAddingId] = useState<string | null>(null); | ||
| const [selectedTags, setSelectedTags] = useState<Set<string>>(new Set()); | ||
|
|
||
| // Get jobs for current project only | ||
| const projectJobs = currentProject?.path ? getJobsForProject(currentProject.path) : []; |
There was a problem hiding this comment.
The current implementation breaks UI reactivity. getJobsForProject is a function from the Zustand store that uses get() internally, which does not subscribe the component to state changes. This means that when generationJobs updates in the store (e.g., a new job is added or a status changes), this component will not re-render, and the UI will become stale.
To fix this, you should select the generationJobs state directly and then filter it within the component, using useMemo to optimize performance.
| const { getJobsForProject, removeSuggestionFromJob } = useIdeationStore(); | |
| const [addingId, setAddingId] = useState<string | null>(null); | |
| const [selectedTags, setSelectedTags] = useState<Set<string>>(new Set()); | |
| // Get jobs for current project only | |
| const projectJobs = currentProject?.path ? getJobsForProject(currentProject.path) : []; | |
| const { generationJobs, removeSuggestionFromJob } = useIdeationStore(); | |
| const [addingId, setAddingId] = useState<string | null>(null); | |
| const [selectedTags, setSelectedTags] = useState<Set<string>>(new Set()); | |
| // Get jobs for current project only | |
| const projectJobs = useMemo(() => (currentProject?.path ? generationJobs.filter((j) => j.projectPath === currentProject.path) : []), [generationJobs, currentProject?.path]); |
| export function PromptList({ category, onBack }: PromptListProps) { | ||
| const currentProject = useAppStore((s) => s.currentProject); | ||
| const { setMode, addGenerationJob, updateJobStatus, generationJobs } = useIdeationStore(); | ||
| const { setMode, addGenerationJob, updateJobStatus, getJobsForProject } = useIdeationStore(); |
There was a problem hiding this comment.
To ensure UI reactivity, you should select generationJobs directly from the store instead of getJobsForProject. The getJobsForProject function uses get() which does not subscribe the component to store updates, leading to a stale UI when job statuses change.
| const { setMode, addGenerationJob, updateJobStatus, getJobsForProject } = useIdeationStore(); | |
| const { setMode, addGenerationJob, updateJobStatus, generationJobs } = useIdeationStore(); |
| const projectJobs = currentProject?.path ? getJobsForProject(currentProject.path) : []; | ||
| const generatingPromptIds = new Set( | ||
| generationJobs.filter((j) => j.status === 'generating').map((j) => j.prompt.id) | ||
| projectJobs.filter((j) => j.status === 'generating').map((j) => j.prompt.id) | ||
| ); |
There was a problem hiding this comment.
To ensure reactivity and improve performance, projectJobs and generatingPromptIds should be calculated using useMemo. This will ensure they are re-calculated only when generationJobs or currentProject.path changes. This works in conjunction with fetching generationJobs directly from the store.
| const projectJobs = currentProject?.path ? getJobsForProject(currentProject.path) : []; | |
| const generatingPromptIds = new Set( | |
| generationJobs.filter((j) => j.status === 'generating').map((j) => j.prompt.id) | |
| projectJobs.filter((j) => j.status === 'generating').map((j) => j.prompt.id) | |
| ); | |
| const projectJobs = useMemo(() => (currentProject?.path ? generationJobs.filter((j) => j.projectPath === currentProject.path) : []), [generationJobs, currentProject?.path]); | |
| const generatingPromptIds = useMemo(() => new Set( | |
| projectJobs.filter((j) => j.status === 'generating').map((j) => j.prompt.id) | |
| ), [projectJobs]); |
apps/ui/src/store/ideation-store.ts
Outdated
| // Generation Jobs | ||
| addGenerationJob: (prompt: IdeationPrompt) => string; | ||
| addGenerationJob: (projectPath: string, prompt: IdeationPrompt) => string; | ||
| getJobsForProject: (projectPath: string) => GenerationJob[]; |
There was a problem hiding this comment.
The function getJobsForProject is not reactive and can lead to stale data in UI components. It's better to select the full generationJobs array in components and filter it there using useMemo. Since this function's usage is being removed from components per other comments, it should be removed from the store action interface as well to avoid future misuse.
apps/ui/src/store/ideation-store.ts
Outdated
| getJobsForProject: (projectPath) => { | ||
| const state = get(); | ||
| return state.generationJobs.filter((job) => job.projectPath === projectPath); | ||
| }, |
There was a problem hiding this comment.
This function getJobsForProject is not reactive and can lead to stale data in UI components because it uses get() outside of a selector context. It's better to select the full generationJobs array in components and filter it there using useMemo. This function should be removed to prevent its misuse.
… job handling - Updated IdeationDashboard and PromptList components to utilize memoization for improved performance when retrieving generation jobs specific to the current project. - Removed the getJobsForProject function from the ideation store, streamlining job management by directly filtering jobs in the components. - Enhanced the addGenerationJob function to ensure consistent job ID generation format. - Implemented migration logic in the ideation store to clean up legacy jobs without project paths, improving data integrity.
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
.claude/commands/review.md (1)
45-52: Consider referencing package.json for version accuracy.The hardcoded tech stack versions (React 19.2.3, Express 5.2.1, etc.) may drift from actual versions over time. Line 52 already suggests checking
package.jsonfor exact versions, which is good—consider making this the primary source rather than listing specific versions that may become outdated..claude/commands/deepreview.md (1)
144-152: Consider dynamic version references or maintenance notes.The hardcoded tech stack versions (Node.js 22, React 19.2.3, TypeScript 5.9.3, etc.) may become stale as dependencies are updated. Consider either:
- Adding a note to verify versions in
package.jsonfiles (you already mention "Checkpackage.jsonfiles for exact versions" on line 152, which is good)- Referencing a single source of truth for version information
- Adding a maintenance reminder to update this documentation when versions change
This improves long-term maintainability of the documentation.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
.claude/agents/clean-code-architect.md.claude/agents/deepcode.md.claude/agents/deepdive.md.claude/agents/security-vulnerability-scanner.md.claude/commands/deepreview.md.claude/commands/review.mdapps/ui/src/components/views/ideation-view/components/ideation-dashboard.tsxapps/ui/src/components/views/ideation-view/components/prompt-list.tsxapps/ui/src/store/ideation-store.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Always import from shared packages (@automaker/*), never from old relative paths
Files:
apps/ui/src/components/views/ideation-view/components/ideation-dashboard.tsxapps/ui/src/components/views/ideation-view/components/prompt-list.tsxapps/ui/src/store/ideation-store.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use
resolveModelString()from @automaker/model-resolver to convert model aliases (haiku, sonnet, opus) to full model names
Files:
apps/ui/src/components/views/ideation-view/components/ideation-dashboard.tsxapps/ui/src/components/views/ideation-view/components/prompt-list.tsxapps/ui/src/store/ideation-store.ts
🧠 Learnings (2)
📚 Learning: 2025-12-28T05:07:48.147Z
Learnt from: CR
Repo: AutoMaker-Org/automaker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-28T05:07:48.147Z
Learning: Each feature executes in an isolated git worktree created via automaker/git-utils to protect the main branch during AI agent execution
Applied to files:
.claude/commands/deepreview.md
📚 Learning: 2025-12-30T01:02:07.114Z
Learnt from: illia1f
Repo: AutoMaker-Org/automaker PR: 324
File: apps/ui/src/components/views/board-view/components/kanban-card/kanban-card.tsx:122-131
Timestamp: 2025-12-30T01:02:07.114Z
Learning: Tailwind CSS v4 uses postfix syntax for the important modifier: append ! at the end of the utility class (e.g., backdrop-blur-[0px]! or hover:bg-red-500!). The older v3 style used a prefix (!) at the start (e.g., !backdrop-blur-[0px]); prefer the postfix form for consistency across TSX files.
Applied to files:
apps/ui/src/components/views/ideation-view/components/ideation-dashboard.tsxapps/ui/src/components/views/ideation-view/components/prompt-list.tsx
🧬 Code graph analysis (2)
apps/ui/src/components/views/ideation-view/components/ideation-dashboard.tsx (1)
apps/ui/src/store/ideation-store.ts (1)
GenerationJob(22-31)
apps/ui/src/store/ideation-store.ts (1)
libs/types/src/ideation.ts (1)
IdeationPrompt(102-109)
🪛 LanguageTool
.claude/commands/review.md
[style] ~14-~14: Consider using a different verb for a more formal wording.
Context: ...ntation correctness Then automatically fixes any issues found. ## Instructions ###...
(FIX_RESOLVE)
[style] ~318-~318: Consider using a different verb for a more formal wording.
Context: ...(5 Agents) Launch 5 deepcode agents to fix the issues found. Each agent should be ...
(FIX_RESOLVE)
[style] ~481-~481: Consider using a different verb for a more formal wording.
Context: ...nsive analysis - Deepcode agents should fix issues in priority order - All fixes sh...
(FIX_RESOLVE)
.claude/agents/clean-code-architect.md
[style] ~45-~45: To elevate your writing, try using a synonym here.
Context: ...for testability from the start; if it's hard to test, it's hard to maintain - Apply ...
(HARD_TO)
[style] ~45-~45: To elevate your writing, try using a synonym here.
Context: ...m the start; if it's hard to test, it's hard to maintain - Apply the Scout Rule: lea...
(HARD_TO)
.claude/commands/deepreview.md
[style] ~14-~14: Consider using a different verb for a more formal wording.
Context: ...ntation correctness Then automatically fixes any issues found. ### Optional Argumen...
(FIX_RESOLVE)
[style] ~420-~420: Consider using a different verb for a more formal wording.
Context: ...(5 Agents) Launch 5 deepcode agents to fix the issues found. Each agent should be ...
(FIX_RESOLVE)
[style] ~587-~587: Consider using a different verb for a more formal wording.
Context: ...nsive analysis - Deepcode agents should fix issues in priority order - All fixes sh...
(FIX_RESOLVE)
🪛 markdownlint-cli2 (0.18.1)
.claude/agents/deepdive.md
134-134: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
202-202: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
.claude/commands/review.md
64-64: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
113-113: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
164-164: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
216-216: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
264-264: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
326-326: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
349-349: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
372-372: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
395-395: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
417-417: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🔇 Additional comments (16)
apps/ui/src/store/ideation-store.ts (3)
22-31: LGTM! Project-scoping field properly added to GenerationJob interface.The
projectPathfield is correctly added as a required string, which will enforce project association for all new jobs.
176-192: Job ID generation and projectPath integration look good.The implementation correctly:
- Accepts
projectPathas the first parameter- Generates a unique job ID combining timestamp and random suffix
- Associates the job with the project path
324-335: Migration logic correctly removes legacy jobs without projectPath.The migration appropriately filters out jobs with
undefinedprojectPath when upgrading from version < 4. The concern about empty stringprojectPathis not a practical edge case—the code includes a guard at the job creation site that prevents jobs from being created with empty strings (if (!currentProject?.path)). The filter using!== undefinedis sufficient for cleaning up legacy data from before project-scoping was added..claude/agents/deepdive.md (1)
1-253: Well-structured agent specification document.The DEEPDIVE agent documentation is comprehensive, with clear workflow steps, handoff templates, and communication guidelines. The static analysis hints about missing language identifiers on lines 134 and 202 are false positives—those code blocks are intentionally generic templates rather than executable code.
.claude/agents/clean-code-architect.md (1)
1-86: Comprehensive clean code agent specification.The documentation thoroughly covers clean code principles, implementation processes, and quality checklists. The LanguageTool style suggestions about "hard to" phrasing are minor stylistic preferences that don't impact clarity.
.claude/agents/security-vulnerability-scanner.md (1)
1-78: Solid security scanner agent specification.The documentation covers essential security categories (OWASP Top 10, CSRF, SSRF, etc.) with a practical output format. The guidelines appropriately emphasize reporting actual vulnerabilities over theoretical concerns.
.claude/commands/review.md (1)
54-484: Comprehensive multi-agent review workflow.The five-phase approach (diff collection, parallel analysis, consolidation, fixes, verification) is well-structured. The static analysis hints about missing language identifiers on the instruction code blocks are false positives—these are agent instruction templates, not executable code.
.claude/agents/deepcode.md (1)
1-249: Well-designed implementation agent specification.The DEEPCODE agent documentation effectively complements DEEPDIVE with clear implementation steps, quality standards, and structured reporting formats. The emphasis on "don't guess, ask" and mandatory testing before completion are good practices.
apps/ui/src/components/views/ideation-view/components/ideation-dashboard.tsx (3)
171-183: Reactivity issue properly addressed with direct state selection and memoization.The refactor correctly resolves the previous reactivity concern by:
- Selecting
generationJobsdirectly from the store (subscribing to state changes)- Using
useMemoto filter jobs by project path with proper dependenciesThis ensures the component re-renders when
generationJobsupdates.
185-203: Efficient single-pass job categorization.The consolidated memo computes
activeJobs,readyJobs, andgeneratingCountin one iteration instead of multiple filter passes. This is a good performance optimization.
341-349: Good UX addition for generating more ideas.The "Generate More Ideas" button provides a clear action when the user has existing items but wants to continue ideation. Placement after the suggestions list is intuitive.
apps/ui/src/components/views/ideation-view/components/prompt-list.tsx (3)
23-26: Excellent refactor to individual store selectors!This change correctly addresses the past review feedback. Using individual selectors ensures the component properly subscribes to each store property, which maintains UI reactivity when generation jobs or other store values update.
38-51: Perfect implementation of project-scoped memoization!The memoized
projectJobsandgeneratingPromptIdscorrectly implement the recommendations from past reviews. The dependencies are minimal and accurate, ensuring efficient re-computation only when necessary. The filtering logic properly scopes jobs to the current project, and the Set-based tracking of generating prompts is an efficient approach.
64-64: Correct usage of updated addGenerationJob signature.The call correctly passes
currentProject.pathas the first parameter, matching the updated store API signature. The null check at line 54 ensures this is safe..claude/commands/deepreview.md (2)
28-142: Well-structured git operations with proper validation.The git command examples are correct and comprehensive:
- Proper branch detection with fallback from
maintomaster- Correct use of three-dot diff notation (
...) to compare against common ancestor- Appropriate error handling and validation
- Safe, read-only operations throughout
The script examples provide clear, functional templates for the workflow.
154-590: Comprehensive and well-organized agent workflow.The multi-agent workflow is logically structured with clear responsibilities:
- Appropriate priority ordering (tech stack validation first)
- Comprehensive coverage across security, quality, correctness, and architecture
- Each agent has well-defined scope and deliverables
- Verification phase ensures fixes don't introduce regressions
Note: The static analysis suggestions about word choice ("fix" → more formal alternatives) are false positives. The current language is appropriate and clear for command documentation.
…ecific job retrieval
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.