Skip to content

The Abhi Special: Don't add presets + don't create in pane + opencode presets#393

Merged
Kitenite merged 4 commits intomainfrom
polite-ant-64d9eb
Dec 17, 2025
Merged

The Abhi Special: Don't add presets + don't create in pane + opencode presets#393
Kitenite merged 4 commits intomainfrom
polite-ant-64d9eb

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Dec 17, 2025

Description

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other (please describe):

Testing

Screenshots (if applicable)

Additional Notes

Summary by CodeRabbit

  • Chores

    • Bumped desktop version to 0.0.24
  • Refactor

    • Streamlined tab and pane creation flow — selecting presets now opens a new tab directly
    • Terminal panes are now consistently named "Terminal"
  • New Features

    • Added a new "opencode" preset and corresponding light/dark icons for quick selection

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 17, 2025

Walkthrough

Refactors tabs/panes creation by removing pane creation options and simplifying addPane/addTab flows; simplifies terminal preset retrieval to return stored presets without first-run seeding; adds an "opencode" preset icon and template; small cleanup in DiffViewer and a package version bump.

Changes

Cohort / File(s) Summary
Version Update
apps/desktop/package.json
Version bumped from 0.0.23 to 0.0.24.
Settings Simplification
apps/desktop/src/lib/trpc/routers/settings/index.ts
getTerminalPresets now returns db.data.settings.terminalPresets ?? [] directly; all first-run initialization, seeding, and DB update logic removed.
TabsView UI changes
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
Removed pane-creation branches; handleAddTab always adds a new tab; handleSelectPreset calls addTab with preset options and optionally renames the created tab (pane orchestration removed).
Tabs store implementation
apps/desktop/src/renderer/stores/tabs/store.ts
addPane signature changed from (tabId, options?: CreatePaneOptions) => string to (tabId) => string; implementation updated to create panes using only tabId.
Tabs types
apps/desktop/src/renderer/stores/tabs/types.ts
Removed CreatePaneOptions usage; removed name?: string from AddTabOptions; updated TabsStore.addPane signature to (tabId: string) => string.
Pane utilities
apps/desktop/src/renderer/stores/tabs/utils.ts
CreatePaneOptions.name removed; createPane now sets name: "Terminal" unconditionally (no options-based naming).
Preset icons
apps/desktop/src/renderer/assets/app-icons/preset-icons/index.ts
Added opencode preset icons (opencodeIcon, opencodeWhiteIcon) and new PRESET_ICONS entry mapping light/dark variants.
Preset templates
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx
Added a new opencode preset template (name, description, cwd, commands).
DiffViewer cleanup
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/DiffViewer/DiffViewer.tsx
Removed useEffect unmount cleanup that reset modifiedEditorRef.current; explicit nulling on unmount was removed.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas needing extra attention:
    • Call sites for addPane across the codebase to ensure signature updates are complete.
    • Preset/first-run logic: verify removing initialization doesn't break migrations or UX expectations.
    • TabsView changes: ensure presets still create sessions with correct initial commands/CWD and tab renaming behaves as intended.
    • Pane naming/UI assumptions relying on dynamic pane names now hardcoded to "Terminal".

Possibly related PRs

  • #381 — Modifies tabs-related codepaths and pane creation flow; overlaps with addPane/signature and TabsView changes.
  • #380 — Changes terminal preset handling; related to removal of getTerminalPresets initialization logic.
  • #108 — Updates tabs/panes API and store functions; relevant to the addPane/addTab refactor here.

Poem

🐰 I hopped in to tidy the panes and tabs,
I swapped tangled options for simpler maps.
Presets now read straight from the chest,
A new opencode icon hopped in to rest.
Happy coding — a neat, small rabbit's clap! ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely incomplete. While it lists two primary objectives, most template sections (Related Issues, Type of Change, Testing, Screenshots, Additional Notes) are empty or unchecked. Complete the PR description by selecting the Type of Change, adding Testing steps, and linking any related issues such as PR #381 that is being reverted.
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 (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately captures the three main changes: removing presets, reverting the pane creation refactor, and adding opencode presets support.
✨ 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 polite-ant-64d9eb

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0a42d6b and 90f5628.

⛔ Files ignored due to path filters (2)
  • apps/desktop/src/renderer/assets/app-icons/preset-icons/opencode-white.svg is excluded by !**/*.svg
  • apps/desktop/src/renderer/assets/app-icons/preset-icons/opencode.svg is excluded by !**/*.svg
📒 Files selected for processing (4)
  • apps/desktop/src/lib/trpc/routers/settings/index.ts (1 hunks)
  • apps/desktop/src/renderer/assets/app-icons/preset-icons/index.ts (2 hunks)
  • apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/DiffViewer/DiffViewer.tsx (1 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.tsx
  • apps/desktop/src/renderer/assets/app-icons/preset-icons/index.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/DiffViewer/DiffViewer.tsx
  • apps/desktop/src/lib/trpc/routers/settings/index.ts
apps/desktop/**/*.{ts,tsx}

📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)

apps/desktop/**/*.{ts,tsx}: Please use alias as defined in tsconfig.json when 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.tsx
  • apps/desktop/src/renderer/assets/app-icons/preset-icons/index.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/DiffViewer/DiffViewer.tsx
  • apps/desktop/src/lib/trpc/routers/settings/index.ts
**/*.{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.tsx
  • apps/desktop/src/renderer/assets/app-icons/preset-icons/index.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/DiffViewer/DiffViewer.tsx
  • apps/desktop/src/lib/trpc/routers/settings/index.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Avoid any type and prioritize type safety in TypeScript code

Files:

  • apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx
  • apps/desktop/src/renderer/assets/app-icons/preset-icons/index.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/DiffViewer/DiffViewer.tsx
  • apps/desktop/src/lib/trpc/routers/settings/index.ts
**/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.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/DiffViewer/DiffViewer.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.tsx
  • apps/desktop/src/renderer/assets/app-icons/preset-icons/index.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/DiffViewer/DiffViewer.tsx
⏰ 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). (6)
  • GitHub Check: Deploy Admin
  • GitHub Check: Deploy Web
  • GitHub Check: Deploy Docs
  • GitHub Check: Deploy API
  • GitHub Check: Deploy Marketing
  • GitHub Check: Build
🔇 Additional comments (4)
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx (1)

65-73: LGTM! New opencode preset follows the established pattern.

The new preset template is structured consistently with existing presets and will integrate seamlessly with the Quick add UI.

apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/DiffViewer/DiffViewer.tsx (1)

2-2: Monaco editor cleanup depends on library configuration and version stability.

The @monaco-editor/react DiffEditor handles model creation, updating, and disposal internally, intelligently updating models when props change. However, documented issues with Monaco 0.51+ show "TextModel got disposed before DiffEditorWidget model got reset" errors on unmount, and the library provides explicit control via disposeModifiedModelOnUnmount property, suggesting automatic disposal is not fully reliable across all versions.

Verify that disposeModifiedModelOnUnmount is properly configured or that the current Monaco version doesn't have documented unmount issues. Without these safeguards, removing cleanup logic risks memory leaks on frequent unmounting.

apps/desktop/src/renderer/assets/app-icons/preset-icons/index.ts (1)

7-8: Icon files verified to exist.

The opencode.svg and opencode-white.svg files are present at the expected paths and correctly imported at lines 7-8. The icons are properly mapped in the PRESET_ICONS object at line 20.

apps/desktop/src/lib/trpc/routers/settings/index.ts (1)

14-15: Confirm UI gracefully handles empty presets and verify no downstream dependencies.

The implementation correctly handles all three concerns:

  1. UI empty state: PresetsSettings component has explicit empty state handling with a user-friendly message ("No presets yet. Click 'Add Preset' to create your first preset."), rendered when localPresets.length > 0 is false.

  2. Existing users unaffected: The getTerminalPresets query returns db.data.settings.terminalPresets ?? [], which means existing stored presets are returned as-is. The empty array only applies to users with no presets.

  3. No downstream dependencies on defaults: Presets are used exclusively in the PresetsSettings component via the usePresets hook. No other code in the codebase depends on default presets being present.

The simplified implementation is safe and user-controlled, with appropriate UI support for the empty state.


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.

Copy link
Copy Markdown
Contributor

@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 (1)
apps/desktop/src/lib/trpc/routers/settings/index.ts (1)

12-27: Unused constant DEFAULT_PRESETS.

The DEFAULT_PRESETS constant is defined but never used since getTerminalPresets was simplified to directly return stored presets. Consider removing this dead code if preset seeding is no longer needed.

-/** Default presets to load when no presets exist */
-const DEFAULT_PRESETS: Omit<TerminalPreset, "id">[] = [
-	{
-		name: "codex",
-		description: "Danger mode: All permissions auto-approved",
-		cwd: "",
-		commands: [
-			'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',
-		],
-	},
-	{
-		name: "claude",
-		description: "Danger mode: All permissions auto-approved",
-		cwd: "",
-		commands: ["claude --dangerously-skip-permissions"],
-	},
-];
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e1a496c and 0a42d6b.

📒 Files selected for processing (6)
  • apps/desktop/package.json (1 hunks)
  • apps/desktop/src/lib/trpc/routers/settings/index.ts (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx (2 hunks)
  • apps/desktop/src/renderer/stores/tabs/store.ts (1 hunks)
  • apps/desktop/src/renderer/stores/tabs/types.ts (1 hunks)
  • apps/desktop/src/renderer/stores/tabs/utils.ts (1 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/stores/tabs/utils.ts
  • apps/desktop/src/renderer/stores/tabs/store.ts
  • apps/desktop/src/lib/trpc/routers/settings/index.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
  • apps/desktop/src/renderer/stores/tabs/types.ts
apps/desktop/**/*.{ts,tsx}

📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)

apps/desktop/**/*.{ts,tsx}: Please use alias as defined in tsconfig.json when possible
Prefer zustand for state management if it makes sense. Do not use effect unless absolutely necessary

Files:

  • apps/desktop/src/renderer/stores/tabs/utils.ts
  • apps/desktop/src/renderer/stores/tabs/store.ts
  • apps/desktop/src/lib/trpc/routers/settings/index.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
  • apps/desktop/src/renderer/stores/tabs/types.ts
**/*.{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/stores/tabs/utils.ts
  • apps/desktop/src/renderer/stores/tabs/store.ts
  • apps/desktop/src/lib/trpc/routers/settings/index.ts
  • apps/desktop/package.json
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
  • apps/desktop/src/renderer/stores/tabs/types.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Avoid any type and prioritize type safety in TypeScript code

Files:

  • apps/desktop/src/renderer/stores/tabs/utils.ts
  • apps/desktop/src/renderer/stores/tabs/store.ts
  • apps/desktop/src/lib/trpc/routers/settings/index.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
  • apps/desktop/src/renderer/stores/tabs/types.ts
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/stores/tabs/utils.ts
  • apps/desktop/src/renderer/stores/tabs/store.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
  • apps/desktop/src/renderer/stores/tabs/types.ts
**/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.tsx
🧠 Learnings (1)
📚 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/shared/ipc-channels.ts : Define IPC channel types in apps/desktop/src/shared/ipc-channels.ts before implementing handlers

Applied to files:

  • apps/desktop/src/renderer/stores/tabs/types.ts
🧬 Code graph analysis (1)
apps/desktop/src/renderer/stores/tabs/store.ts (1)
apps/desktop/src/renderer/stores/tabs/utils.ts (1)
  • createPane (46-62)
⏰ 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). (6)
  • GitHub Check: Deploy Docs
  • GitHub Check: Deploy Web
  • GitHub Check: Deploy Marketing
  • GitHub Check: Deploy API
  • GitHub Check: Deploy Admin
  • GitHub Check: Build
🔇 Additional comments (7)
apps/desktop/package.json (1)

5-5: LGTM!

Version bump to 0.0.24 is appropriate for this refactor.

apps/desktop/src/lib/trpc/routers/settings/index.ts (1)

34-36: LGTM!

Clean simplification - the query now performs a straightforward read with a safe fallback to an empty array, removing unnecessary initialization logic.

apps/desktop/src/renderer/stores/tabs/types.ts (1)

52-53: LGTM!

The simplified addPane signature aligns with the broader refactor to remove pane creation options. Initial data (commands, cwd) is now passed through addTab instead.

apps/desktop/src/renderer/stores/tabs/utils.ts (1)

46-61: LGTM!

Hardcoding the pane name to "Terminal" simplifies the API. The options parameter is still useful for createTabWithPane (line 95) which passes through initialCommands and initialCwd.

apps/desktop/src/renderer/stores/tabs/store.ts (1)

321-326: LGTM!

The simplified addPane implementation correctly delegates to createPane(tabId) without options. Initial data for panes is now exclusively handled through addTabcreateTabWithPane, which is a cleaner separation of concerns.

apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx (2)

57-62: LGTM!

Clean simplification of handleAddTab - directly creates a new tab without the previous pane-based branching logic.


69-84: LGTM!

The preset flow is now clearer: create a tab with initial commands/cwd, then rename if the preset has a name. The separation of tab creation and naming is a good simplification.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 17, 2025

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

Service Status
Neon Database (Neon)

Thank you for your contribution! 🎉


Preview resources have been processed for cleanup

@Kitenite Kitenite changed the title Revert presets and create in pane The Abhi Special: Don't add presets + don't create in pane + opencode presets Dec 17, 2025
@Kitenite Kitenite merged commit adfda50 into main Dec 17, 2025
12 checks passed
@Kitenite Kitenite deleted the polite-ant-64d9eb branch December 17, 2025 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant