feat(desktop): add description to presets#380
Conversation
WalkthroughAdds optional descriptions to terminal presets, seeds default presets on first run via async getTerminalPresets, and introduces theme-aware preset icon utilities; updates presets data shape and UI components to render icons and descriptions. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Renderer
participant ThemeStore
participant TRPC as TRPC Router
participant DB
Renderer->>ThemeStore: read theme (useIsDarkTheme)
Renderer->>TRPC: call getTerminalPresets()
TRPC->>DB: read Settings.terminalPresets & terminalPresetsInitialized
alt not initialized
DB-->>TRPC: no presets / not initialized
TRPC->>DB: insert DEFAULT_PRESETS (generate ids)
DB-->>TRPC: persist confirmation
TRPC->>DB: set terminalPresetsInitialized = true
end
DB-->>TRPC: return terminalPresets
TRPC-->>Renderer: return presets (with descriptions and ids)
Renderer->>Renderer: getPresetIcon(preset.name, isDark) for each preset
Renderer-->>User: render preset buttons with icon + description/cwd
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (3)
apps/desktop/src/renderer/assets/app-icons/preset-icons/index.ts (1)
36-39: Consider consolidating theme detection logic.The
useIsDarkThemehook duplicates theme detection logic that's already inusePresetIcon. Consider if both hooks are necessary, or if consumers could useusePresetIcondirectly.Example consolidation:
-export function useIsDarkTheme(): boolean { - const activeTheme = useThemeStore((state) => state.activeTheme); - return activeTheme?.type === "dark"; -}If
useIsDarkThemeis used independently in multiple places, this is fine to keep. Otherwise, components could just useusePresetIcondirectly.apps/desktop/src/lib/trpc/routers/settings/index.ts (1)
11-27: Consider extracting long command strings to constants.The command strings in DEFAULT_PRESETS are quite long (especially codex on line 18). Consider extracting them to named constants for better readability.
Example:
const CODEX_DANGER_COMMAND = 'codex -c model_reasoning_effort="high" --ask-for-approval never ' + '--sandbox danger-full-access -c model_reasoning_summary="detailed" ' + '-c model_supports_reasoning_summaries=true'; const DEFAULT_PRESETS: Omit<TerminalPreset, "id">[] = [ { name: "codex", description: "Danger mode: All permissions auto-approved", cwd: "", commands: [CODEX_DANGER_COMMAND], }, // ... ];apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx (1)
26-65: Consider varying the preset descriptions.Three of the four presets use the identical description: "Danger mode: All permissions auto-approved". Consider making these more distinctive to better differentiate the presets for users.
Example:
{ name: "codex", description: "Codex with high reasoning effort and full sandbox access", // ... }, { name: "claude", description: "Claude with permissions auto-approved", // ... },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (5)
apps/desktop/src/renderer/assets/app-icons/preset-icons/claude.svgis excluded by!**/*.svgapps/desktop/src/renderer/assets/app-icons/preset-icons/codex-white.svgis excluded by!**/*.svgapps/desktop/src/renderer/assets/app-icons/preset-icons/codex.svgis excluded by!**/*.svgapps/desktop/src/renderer/assets/app-icons/preset-icons/cursor.svgis excluded by!**/*.svgapps/desktop/src/renderer/assets/app-icons/preset-icons/gemini.svgis excluded by!**/*.svg
📒 Files selected for processing (8)
apps/desktop/src/lib/trpc/routers/settings/index.ts(4 hunks)apps/desktop/src/main/lib/db/schemas.ts(2 hunks)apps/desktop/src/renderer/assets/app-icons/preset-icons/index.ts(1 hunks)apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetRow/PresetRow.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx(4 hunks)apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/types.ts(1 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/TabsCommandDialog/index.tsx(3 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx(4 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
apps/desktop/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
For Electron interprocess communication, ALWAYS use tRPC as defined in
src/lib/trpc
Files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsxapps/desktop/src/renderer/assets/app-icons/preset-icons/index.tsapps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetRow/PresetRow.tsxapps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/types.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/TabsCommandDialog/index.tsxapps/desktop/src/lib/trpc/routers/settings/index.tsapps/desktop/src/main/lib/db/schemas.tsapps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx
apps/desktop/**/*.{ts,tsx}
📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
apps/desktop/**/*.{ts,tsx}: Please use alias as defined intsconfig.jsonwhen possible
Prefer zustand for state management if it makes sense. Do not use effect unless absolutely necessary
Files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsxapps/desktop/src/renderer/assets/app-icons/preset-icons/index.tsapps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetRow/PresetRow.tsxapps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/types.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/TabsCommandDialog/index.tsxapps/desktop/src/lib/trpc/routers/settings/index.tsapps/desktop/src/main/lib/db/schemas.tsapps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx
**/*.{ts,tsx,js,jsx,json}
📄 CodeRabbit inference engine (AGENTS.md)
Use Biome for code formatting and linting, running at root level for speed
Files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsxapps/desktop/src/renderer/assets/app-icons/preset-icons/index.tsapps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetRow/PresetRow.tsxapps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/types.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/TabsCommandDialog/index.tsxapps/desktop/src/lib/trpc/routers/settings/index.tsapps/desktop/src/main/lib/db/schemas.tsapps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Avoid
anytype and prioritize type safety in TypeScript code
Files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsxapps/desktop/src/renderer/assets/app-icons/preset-icons/index.tsapps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetRow/PresetRow.tsxapps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/types.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/TabsCommandDialog/index.tsxapps/desktop/src/lib/trpc/routers/settings/index.tsapps/desktop/src/main/lib/db/schemas.tsapps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx
**/components/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/components/**/*.{ts,tsx}: Structure project folders as one folder per component with PascalCase naming (ComponentName/ComponentName.tsx + index.ts barrel export)
Co-locate component dependencies (utils, hooks, constants, config, tests, stories) next to the file using them
Use one component per file (no multi-component files)
Files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsxapps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetRow/PresetRow.tsxapps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/types.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/TabsCommandDialog/index.tsxapps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx
apps/desktop/src/renderer/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Call IPC methods from renderer process using window.ipcRenderer.invoke with type-safe object parameters
Files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsxapps/desktop/src/renderer/assets/app-icons/preset-icons/index.tsapps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetRow/PresetRow.tsxapps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/types.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/TabsCommandDialog/index.tsxapps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx
🧠 Learnings (2)
📚 Learning: 2025-12-12T05:45:09.686Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-12T05:45:09.686Z
Learning: Applies to packages/ui/**/*.{ts,tsx} : Use React + TailwindCSS v4 + shadcn/ui for UI components in `packages/ui`
Applied to files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
📚 Learning: 2025-11-24T21:33:13.267Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: apps/desktop/AGENTS.md:0-0
Timestamp: 2025-11-24T21:33:13.267Z
Learning: Applies to apps/desktop/**/*.{ts,tsx} : Please use alias as defined in `tsconfig.json` when possible
Applied to files:
apps/desktop/src/renderer/assets/app-icons/preset-icons/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/TabsCommandDialog/index.tsx
🧬 Code graph analysis (3)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx (3)
apps/desktop/src/renderer/assets/app-icons/preset-icons/index.ts (2)
useIsDarkTheme(36-39)getPresetIcon(20-28)packages/ui/src/components/ui/button.tsx (1)
Button(60-60)packages/ui/src/components/ui/tooltip.tsx (3)
Tooltip(76-76)TooltipTrigger(76-76)TooltipContent(76-76)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/TabsCommandDialog/index.tsx (1)
apps/desktop/src/renderer/assets/app-icons/preset-icons/index.ts (2)
useIsDarkTheme(36-39)getPresetIcon(20-28)
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx (1)
apps/desktop/src/renderer/assets/app-icons/preset-icons/index.ts (2)
useIsDarkTheme(36-39)getPresetIcon(20-28)
🪛 GitHub Actions: CI
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
[error] 3-7: Formatter would have printed different content for the Tooltip import block. Run the formatter to apply the changes.
apps/desktop/src/lib/trpc/routers/settings/index.ts
[error] 1-1: Imports and exports are not sorted. Safe fix: Organize Imports (Biome).
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx
[error] 198-201: Prettier formatting would have rearranged content. Run the formatter to apply the suggested changes (e.g., fix title prop formatting).
🔇 Additional comments (10)
apps/desktop/src/renderer/assets/app-icons/preset-icons/index.ts (1)
1-39: LGTM: Clean theme-aware icon resolution.The icon lookup system is well-structured with proper normalization, type safety, and undefined handling for missing presets.
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetRow/PresetRow.tsx (1)
47-47: LGTM: Proper null handling for Input value.The nullish coalescing operator ensures the Input always receives a string value, preventing uncontrolled component issues when the value is null or undefined.
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/types.ts (1)
16-20: LGTM: Description column addition.The new description column integrates cleanly with existing column definitions and appropriately indicates the optional nature in the placeholder text.
apps/desktop/src/main/lib/db/schemas.ts (2)
102-102: LGTM: Clean schema extension for descriptions.The optional description field enables richer preset metadata without breaking existing data.
111-111: LGTM: Initialization flag for first-run seeding.The
terminalPresetsInitializedflag enables proper first-run detection for seeding default presets while preserving any pre-existing user presets.apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx (1)
167-202: LGTM: Enhanced preset rendering with tooltips and dynamic icons.The reworked preset rendering properly integrates theme-aware icons and helpful tooltips showing descriptions or working directories. The conditional wrapping pattern is clean and avoids unnecessary tooltip elements when no context is available.
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/TabsCommandDialog/index.tsx (1)
15-18: LGTM: Consistent theme-aware preset rendering.The command dialog now properly displays preset icons, descriptions, and working directories with appropriate theming and truncation. The logic prioritizes description over cwd, providing a better user experience.
Also applies to: 37-37, 52-84
apps/desktop/src/lib/trpc/routers/settings/index.ts (2)
35-65: LGTM: Safe first-run initialization logic.The initialization logic properly handles:
- Preserving existing user presets (backward compatibility)
- Seeding defaults only when needed
- Atomic updates with proper flag management
71-71: LGTM: Proper description field integration.The description field is correctly added to input schemas as optional and properly propagated in update logic with undefined checks.
Also applies to: 98-98, 114-115
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx (1)
4-7: LGTM: Theme-aware icon integration.The preset templates now properly integrate with the theme-aware icon system, displaying appropriate icons based on the active theme and showing helpful descriptions in tooltips.
Also applies to: 77-77, 192-212
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (3)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx (1)
3-3: Verify Biome formatting compliance for imports.A previous review flagged that Biome would format the Tooltip imports differently. Please ensure you've run the Biome formatter on this file.
#!/bin/bash # Check if Biome would make changes to this file npx @biomejs/biome format apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx 2>&1 | head -20apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx (1)
200-202: Verify Biome formatting compliance for title prop.A previous review flagged that Biome would format this section differently. Please ensure you've run the Biome formatter on this file.
#!/bin/bash # Check if Biome would make changes to this file npx @biomejs/biome format apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx 2>&1 | head -20apps/desktop/src/lib/trpc/routers/settings/index.ts (1)
1-6: Fix: Organize imports as required by Biome.The import ordering issue has already been flagged. Ensure you run Biome to auto-fix the import organization before merging.
Based on past review feedback.
🧹 Nitpick comments (3)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx (1)
163-198: Consider simplifying the non-tooltip case by avoiding the wrapper div.The tooltip-wrapped button and non-tooltip button are rendered differently: one uses
<Tooltip>as the keyed element, the other wraps in<div>. This adds an unnecessary DOM node when no tooltip is present.Apply this diff to simplify:
- return <div key={preset.id}>{button}</div>; + return <Fragment key={preset.id}>{button}</Fragment>;Or extract the
keyprop to the button itself:+ const buttonWithKey = ( + <Button + key={preset.id} + variant="ghost" ... - return <div key={preset.id}>{button}</div>; + return buttonWithKey;apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx (2)
16-24: Consider documenting or simplifying the dualnamefields.The interface has
nameat the top level andpreset.namenested. While this separation allows for icon lookup (template.name) vs preset data (template.preset.name), all current templates use identical values for both fields. Consider either:
- Adding a comment explaining why both are needed
- Deriving one from the other if they should always match
192-213: Minor optimization: conditionally computepresetIcononly when needed.
presetIconis computed for every template but only used when!alreadyAdded. Consider computing it conditionally to avoid unnecessary function calls.- const presetIcon = getPresetIcon(template.name, isDark); return ( <Button key={template.name} variant="outline" size="sm" className="gap-1.5 text-xs h-7" onClick={() => handleAddTemplate(template)} title={ alreadyAdded ? "Already added" : template.preset.description } disabled={alreadyAdded || createPreset.isPending} > - {alreadyAdded ? ( - <HiOutlineCheck className="h-3 w-3" /> - ) : presetIcon ? ( - <img - src={presetIcon} - alt="" - className="h-3 w-3 object-contain" - /> - ) : null} + {alreadyAdded ? ( + <HiOutlineCheck className="h-3 w-3" /> + ) : ( + (() => { + const icon = getPresetIcon(template.name, isDark); + return icon ? ( + <img src={icon} alt="" className="h-3 w-3 object-contain" /> + ) : null; + })() + )} {template.name} </Button> );Alternatively, keep the current approach for readability—the performance gain is negligible.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
apps/desktop/src/lib/trpc/routers/settings/index.ts(4 hunks)apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx(4 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx(4 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
apps/desktop/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
For Electron interprocess communication, ALWAYS use tRPC as defined in
src/lib/trpc
Files:
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsxapps/desktop/src/lib/trpc/routers/settings/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
apps/desktop/**/*.{ts,tsx}
📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
apps/desktop/**/*.{ts,tsx}: Please use alias as defined intsconfig.jsonwhen possible
Prefer zustand for state management if it makes sense. Do not use effect unless absolutely necessary
Files:
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsxapps/desktop/src/lib/trpc/routers/settings/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
**/*.{ts,tsx,js,jsx,json}
📄 CodeRabbit inference engine (AGENTS.md)
Use Biome for code formatting and linting, running at root level for speed
Files:
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsxapps/desktop/src/lib/trpc/routers/settings/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Avoid
anytype and prioritize type safety in TypeScript code
Files:
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsxapps/desktop/src/lib/trpc/routers/settings/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
**/components/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/components/**/*.{ts,tsx}: Structure project folders as one folder per component with PascalCase naming (ComponentName/ComponentName.tsx + index.ts barrel export)
Co-locate component dependencies (utils, hooks, constants, config, tests, stories) next to the file using them
Use one component per file (no multi-component files)
Files:
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
apps/desktop/src/renderer/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Call IPC methods from renderer process using window.ipcRenderer.invoke with type-safe object parameters
Files:
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
🧠 Learnings (5)
📚 Learning: 2025-12-12T05:45:09.686Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-12T05:45:09.686Z
Learning: Applies to **/*.{ts,tsx,js,jsx,json} : Use Biome for code formatting and linting, running at root level for speed
Applied to files:
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsxapps/desktop/src/lib/trpc/routers/settings/index.tsapps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
📚 Learning: 2025-11-24T21:33:13.267Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: apps/desktop/AGENTS.md:0-0
Timestamp: 2025-11-24T21:33:13.267Z
Learning: Applies to apps/desktop/**/*.{ts,tsx,js,jsx} : For Electron interprocess communication, ALWAYS use tRPC as defined in `src/lib/trpc`
Applied to files:
apps/desktop/src/lib/trpc/routers/settings/index.ts
📚 Learning: 2025-12-12T05:45:09.686Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-12T05:45:09.686Z
Learning: Applies to apps/desktop/src/renderer/**/*.{ts,tsx,js,jsx} apps/desktop/src/lib/**/*.{ts,tsx,js,jsx} apps/desktop/src/shared/**/*.{ts,tsx,js,tsx} : Never import Node.js modules in renderer process or shared code, only in main process
Applied to files:
apps/desktop/src/lib/trpc/routers/settings/index.ts
📚 Learning: 2025-11-24T21:33:13.267Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: apps/desktop/AGENTS.md:0-0
Timestamp: 2025-11-24T21:33:13.267Z
Learning: Applies to apps/desktop/**/*.{ts,tsx} : Please use alias as defined in `tsconfig.json` when possible
Applied to files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
📚 Learning: 2025-12-12T05:45:09.686Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-12T05:45:09.686Z
Learning: Applies to packages/ui/**/*.{ts,tsx} : Use React + TailwindCSS v4 + shadcn/ui for UI components in `packages/ui`
Applied to files:
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
🧬 Code graph analysis (2)
apps/desktop/src/lib/trpc/routers/settings/index.ts (1)
apps/desktop/src/main/lib/db/schemas.ts (1)
TerminalPreset(99-105)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx (3)
apps/desktop/src/renderer/assets/app-icons/preset-icons/index.ts (2)
useIsDarkTheme(36-39)getPresetIcon(20-28)packages/ui/src/components/ui/button.tsx (1)
Button(60-60)packages/ui/src/components/ui/tooltip.tsx (3)
Tooltip(76-76)TooltipTrigger(76-76)TooltipContent(76-76)
⏰ 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). (5)
- GitHub Check: Deploy Web
- GitHub Check: Deploy Admin
- GitHub Check: Deploy Marketing
- GitHub Check: Deploy API
- GitHub Check: Build
🔇 Additional comments (9)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx (3)
13-16: LGTM!Good use of aliased imports from
renderer/assets/app-icons/preset-iconsas per coding guidelines.
47-47: LGTM!Theme hook usage is appropriate at the component level for deriving
isDarkstate.
164-165: LGTM!Clean derivation of
tooltipTextwith fallback tocwd, and proper use ofgetPresetIconwith theme awareness.apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx (3)
4-7: LGTM!Proper aliased imports for the preset icon utilities as per coding guidelines.
26-65: LGTM!The preset templates are well-structured with descriptive text for each CLI tool's "danger mode" configuration. The descriptions clearly communicate that permissions are auto-approved.
77-77: LGTM!Theme hook properly placed at component level.
apps/desktop/src/lib/trpc/routers/settings/index.ts (3)
67-90: LGTM: Description field added correctly.The optional
descriptionfield is properly integrated:
- Zod schema matches the TypeScript interface
- Field is optional as intended
- Automatically included in preset via spread operator
92-122: LGTM: Description patching implemented correctly.The
descriptionfield update follows the same pattern as other fields:
- Optional in the patch schema
- Conditional update based on
undefinedcheck- Consistent with existing update logic
35-65: Async change is safe—all callers use tRPC hooks which handle it correctly.The
getTerminalPresetsprocedure change to async is verified safe. All call sites use tRPC'suseQuery()hook andinvalidate()utilities, which handle async procedures transparently. The initialization logic is solid:
- Correctly migrates existing presets before the flag existed
- Seeds defaults only when needed
- Properly generates IDs with nanoid
- Marks initialization complete to avoid re-seeding
Description
Related Issues
Type of Change
Testing
Screenshots (if applicable)
Additional Notes
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.