feat(studio): Add prompt presets for DD AI describe - #1236
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
📝 WalkthroughWalkthroughAdds typed prompt suggestions, a reusable suggestion-tag component, fileset prompt integration, and disabled-state handling for chat seed suggestions. ChangesAI prompt suggestions
Sequence Diagram(s)sequenceDiagram
actor User
participant PromptSuggestionTags
participant DescribeWithAiPanel
participant PromptField
User->>PromptSuggestionTags: Select suggestion
PromptSuggestionTags->>DescribeWithAiPanel: Return selected prompt
DescribeWithAiPanel->>PromptField: Set value, validate, and mark dirty
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
web/packages/studio/src/components/CreateFilesetStart/DescribeWithAiPanel.tsx (1)
40-102: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winAdd focused tests for prompt suggestions.
Existing tests cover AI selection and empty-submit validation, but not suggestion visibility, click/keyboard selection, dirty state, or all
PROMPT_SUGGESTIONS. Run the Studio package tests and typecheck. Do not run E2E tests.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/packages/studio/src/components/CreateFilesetStart/DescribeWithAiPanel.tsx` around lines 40 - 102, Add focused tests covering DescribeWithAiPanel prompt suggestions: verify suggestions appear only when the prompt is empty and the panel is not busy, all PROMPT_SUGGESTIONS render, and clicking or keyboard-selecting a pill updates the prompt, marks it dirty, and triggers validation. Use the relevant prompt form types and PromptSuggestionPills behavior from the referenced files; update implementation only if tests expose a behavior mismatch. Run Studio package tests and typecheck, but do not run E2E tests.Source: Coding guidelines
🧹 Nitpick comments (1)
web/packages/studio/src/components/CreateFilesetStart/types.ts (1)
98-107: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMake the prompt suggestion contract immutable.
The exported interfaces and constant allow consumers to mutate labels, prompts, and the suggestions array.
web/packages/studio/src/components/CreateFilesetStart/types.ts#L98-L107: mark interface properties asreadonlyand usereadonly PromptSuggestion[].web/packages/studio/src/components/CreateFilesetStart/constants.ts#L17-L33: declarePROMPT_SUGGESTIONSasreadonly PromptSuggestion[].Proposed fix
export interface PromptSuggestion { - label: string; - prompt: string; + readonly label: string; + readonly prompt: string; } export interface PromptSuggestionPillsProps { - suggestions: PromptSuggestion[]; - onSelect: (prompt: string) => void; + readonly suggestions: readonly PromptSuggestion[]; + readonly onSelect: (prompt: string) => void; } -export const PROMPT_SUGGESTIONS: PromptSuggestion[] = [ +export const PROMPT_SUGGESTIONS: readonly PromptSuggestion[] = [As per coding guidelines, “Use
readonlyfor immutable properties.”🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/packages/studio/src/components/CreateFilesetStart/types.ts` around lines 98 - 107, Make the prompt suggestion contract immutable: in web/packages/studio/src/components/CreateFilesetStart/types.ts lines 98-107, mark PromptSuggestion.label, PromptSuggestion.prompt, and PromptSuggestionPillsProps.suggestions as readonly; in web/packages/studio/src/components/CreateFilesetStart/constants.ts lines 17-33, declare PROMPT_SUGGESTIONS as readonly PromptSuggestion[].Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In
`@web/packages/studio/src/components/CreateFilesetStart/DescribeWithAiPanel.tsx`:
- Around line 40-102: Add focused tests covering DescribeWithAiPanel prompt
suggestions: verify suggestions appear only when the prompt is empty and the
panel is not busy, all PROMPT_SUGGESTIONS render, and clicking or
keyboard-selecting a pill updates the prompt, marks it dirty, and triggers
validation. Use the relevant prompt form types and PromptSuggestionPills
behavior from the referenced files; update implementation only if tests expose a
behavior mismatch. Run Studio package tests and typecheck, but do not run E2E
tests.
---
Nitpick comments:
In `@web/packages/studio/src/components/CreateFilesetStart/types.ts`:
- Around line 98-107: Make the prompt suggestion contract immutable: in
web/packages/studio/src/components/CreateFilesetStart/types.ts lines 98-107,
mark PromptSuggestion.label, PromptSuggestion.prompt, and
PromptSuggestionPillsProps.suggestions as readonly; in
web/packages/studio/src/components/CreateFilesetStart/constants.ts lines 17-33,
declare PROMPT_SUGGESTIONS as readonly PromptSuggestion[].
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 7865cd13-286d-4468-a140-2dde6dd497f7
📒 Files selected for processing (4)
web/packages/studio/src/components/CreateFilesetStart/DescribeWithAiPanel.tsxweb/packages/studio/src/components/CreateFilesetStart/PromptSuggestionPills.tsxweb/packages/studio/src/components/CreateFilesetStart/constants.tsweb/packages/studio/src/components/CreateFilesetStart/types.ts
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
web/packages/studio/src/components/PromptSuggestionPills/types.ts (1)
5-16: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMake the suggestion contract read-only.
Mark the properties
readonly. Exposesuggestionsasreadonly PromptSuggestion[]. Confirm no caller mutates this contract.Proposed change
export interface PromptSuggestion { - label: string; - prompt: string; + readonly label: string; + readonly prompt: string; } export interface PromptSuggestionPillsProps { - suggestions: PromptSuggestion[]; - onSelect: (prompt: string) => void; - className?: string; + readonly suggestions: readonly PromptSuggestion[]; + readonly onSelect: (prompt: string) => void; + readonly className?: string; }As per coding guidelines, “Use
readonlyfor immutable properties.”🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/packages/studio/src/components/PromptSuggestionPills/types.ts` around lines 5 - 16, Update the PromptSuggestion and PromptSuggestionPillsProps interfaces so all contract properties are readonly, and change suggestions to readonly PromptSuggestion[]. Verify existing callers only read these values and do not rely on mutating the exposed contract.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@web/packages/studio/src/components/PromptSuggestionPills/types.ts`:
- Around line 5-16: Update the PromptSuggestion and PromptSuggestionPillsProps
interfaces so all contract properties are readonly, and change suggestions to
readonly PromptSuggestion[]. Verify existing callers only read these values and
do not rely on mutating the exposed contract.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 6a350fb1-df08-40fa-9e0c-25caab6cbbfe
📒 Files selected for processing (5)
web/packages/studio/src/components/CreateFilesetStart/DescribeWithAiPanel.tsxweb/packages/studio/src/components/CreateFilesetStart/constants.tsweb/packages/studio/src/components/PromptSuggestionPills/index.tsxweb/packages/studio/src/components/PromptSuggestionPills/types.tsweb/packages/studio/src/components/chat/SeedQuestions.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- web/packages/studio/src/components/CreateFilesetStart/constants.ts
nakolean
left a comment
There was a problem hiding this comment.
Looks good, one suggestion to update if you agree.
650b572 to
249aa59
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
web/packages/studio/src/components/PromptSuggestionTags/types.ts (1)
5-18: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMark all contract properties as
readonly.Use
readonly PromptSuggestion[]forsuggestions.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/packages/studio/src/components/PromptSuggestionTags/types.ts` around lines 5 - 18, Mark every property in the PromptSuggestion and PromptSuggestionTagsProps interfaces as readonly, including the suggestions collection as readonly PromptSuggestion[] and the callback, disabled, and className properties.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@web/packages/studio/src/components/PromptSuggestionTags/types.ts`:
- Around line 5-10: Add a stable unique id field to the PromptSuggestion
interface in types.ts, update PromptSuggestionTags in index.tsx to use
suggestion.id as the React key instead of suggestion.label, and update every
PromptSuggestion constructor to provide a unique stable id.
---
Nitpick comments:
In `@web/packages/studio/src/components/PromptSuggestionTags/types.ts`:
- Around line 5-18: Mark every property in the PromptSuggestion and
PromptSuggestionTagsProps interfaces as readonly, including the suggestions
collection as readonly PromptSuggestion[] and the callback, disabled, and
className properties.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: de47fb49-3135-45f2-ba92-93181cb85742
📒 Files selected for processing (7)
web/packages/studio/src/components/CreateFilesetStart/DescribeWithAiPanel.tsxweb/packages/studio/src/components/CreateFilesetStart/constants.tsweb/packages/studio/src/components/ModelChat/index.tsxweb/packages/studio/src/components/PromptSuggestionTags/index.tsxweb/packages/studio/src/components/PromptSuggestionTags/types.tsweb/packages/studio/src/components/chat/CompareComposer.tsxweb/packages/studio/src/components/chat/SeedQuestions.tsx
🚧 Files skipped from review as they are similar to previous changes (5)
- web/packages/studio/src/components/chat/CompareComposer.tsx
- web/packages/studio/src/components/CreateFilesetStart/DescribeWithAiPanel.tsx
- web/packages/studio/src/components/chat/SeedQuestions.tsx
- web/packages/studio/src/components/ModelChat/index.tsx
- web/packages/studio/src/components/CreateFilesetStart/constants.ts
Signed-off-by: Sean Teramae <steramae@nvidia.com>
Signed-off-by: Sean Teramae <steramae@nvidia.com>
Signed-off-by: Sean Teramae <steramae@nvidia.com>
Signed-off-by: Sean Teramae <steramae@nvidia.com>
249aa59 to
781b4cf
Compare
Screen.Recording.2026-08-11.at.10.25.50.AM.mov
Signed-off-by: Sean Teramae steramae@nvidia.com
Summary
Related Issue
Changes
Type of Change
Quality Gates
Verification
Signed-off-by:traileruv run pre-commit run -apasses, or any blocked checks are identified belowTargeted validation:
Summary
Related Issue
Changes
Type of Change
Quality Gates
Verification
Signed-off-by:traileruv run pre-commit run -apasses, or any blocked checks are identified belowTargeted validation:
Summary by CodeRabbit
New Features
Bug Fixes