Repository navigation
fix(sync,chat,notes): delete resurrection, maxSteps persistence, chat quick-settings, notes DnD - #91
Conversation
… quick-settings, notes DnD Sync: - Fix deleted note resurrecting when a peer's stale put is drained after a local hard-delete (no local tombstone). drainPending now inserts a tombstone shell when the delete UPDATE matches 0 rows so the staleness guard holds. Chat / AI settings: - Persist full AI config in the backend cache (maxSteps/temperature/contextLimit/ aiEnabled) and merge (not shadow) in hydrateFromElectron, fixing "Max steps reverts to 30" mid-conversation. - Add in-chat quick-settings gear popover (model + Refresh/Custom model, max steps, temperature, subagents) editing the global aiConfig; tooltip-on-overflow for long model names. - Make Subagents a global preference (aiConfig.subagentsEnabled); remove the per-thread pill and retire setThreadUseSubagents / ChatThread.useSubagents. Notes: - Persist folder-tree expand/collapse state per-project in localStorage. - Pin the "Move to root" drop zone to the bottom of the panel; clear lingering drag state via a document-level dragend/drop listener after a cross-project drop.
|
Warning Review limit reached
Next review available in: 48 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. 📝 WalkthroughWalkthroughVersion 2.5.5 adds global AI settings and in-chat controls, persists notes folder expansion state, revises notes drag/drop behavior, hardens sync tombstone handling, and documents regression fixes. ChangesAI and Chat Configuration
Notes Folder State and Dragging
Sync Convergence
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant ChatQuickSettings
participant CairnStore
participant ChatPanel
User->>ChatQuickSettings: Open and edit chat settings
ChatQuickSettings->>CairnStore: Update aiConfig
ChatPanel->>CairnStore: Read global Subagents setting
ChatPanel->>ChatPanel: Pass useSubagents to sendStream
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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: 1
🤖 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 `@src/store/index.ts`:
- Around line 327-346: Always persist the fully merged configuration through
window.electron.saveAiSettings after constructing mergedAiConfig, including when
backendAiConfig exists. Update the conditional in the hydration logic around
savedConfig and mergedAiConfig, while retaining the existing availability checks
for Electron and saveAiSettings.
🪄 Autofix (Beta)
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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 0fe55f58-79e4-4fde-9f59-9d3f6560e982
📒 Files selected for processing (15)
changelogs/v2.5.5.mdelectron/lib/config-cache.test.tselectron/lib/config-cache.tsshared/sync/engine.test.tsshared/sync/engine.tssrc/components/chat/chat-panel/ChatQuickSettings.tsxsrc/components/chat/chat-panel/index.tsxsrc/components/notes/notes-view.tsxsrc/components/notes/notes-view/FolderTreeNode.tsxsrc/components/settings/AISettings.tsxsrc/lib/constants.tssrc/store/index.tssrc/store/slices/chat.tssrc/store/slices/ui.tssrc/types/index.ts
💤 Files with no reviewable changes (2)
- src/store/slices/chat.ts
- src/types/index.ts
…ig even when backend config exists)
What does this PR do?
Fixes a sync bug where deleted notes could resurrect, makes the chat "Max steps" limit persist, adds an in-chat quick-settings popover, moves Subagents to a global preference, persists notes folder expand/collapse state, and fixes two notes drag-and-drop issues.
Type of change
Details
Sync
putresurrect the note. Desktop does a physicalDELETE(no tombstone), sodrainPending's deleteUPDATEmatched zero rows and the staleness guard inreconcileOnewas bypassed (localHlcnull).drainPendingnow inserts a tombstone shell when the delete matches no rows (FK-toggled likeapplyRemote). Regression test added.Chat / AI settings
maxSteps(andtemperature/contextLimit/aiEnabled), andhydrateFromElectron(run after every write-tool turn) let the field-poor backend config shadow the richer localStorage copy. The cache now persists all AI fields and hydrate merges instead of shadowing.aiConfig.subagentsEnabled) surfaced in Settings + the popover; the per-thread pill is removed andsetThreadUseSubagents/ChatThread.useSubagentsretired (DB column left dormant, no migration).Notes
dragend/droplistener (the dragged element unmounts mid-drag so itsonDragEndnever fired).Screenshots / recording
Checklist
npm run type-check:allpassesnpm run lintpassesnpm testpasses — 1271/1272 pass; the sole failure istool-schema-optimization.test.ts, a LIVE, opt-in LLM benchmark that failed by its 1-item non-determinism slack (10 >= 11) and is unrelated to these changesnpm run test:e2e— not run yettext-[Npx]pixel font classes — rem equivalents onlyhandle()and returnIpcResult<T>— n/a (no new IPC handlers)schema.ts— n/a (no schema changes; dormantuse_subagentscolumn left as-is)electron/db/queries.ts— n/a (no new SQL)ROLE_MAP/licenses.json— n/a (no new deps)--external:<pkg>flags — n/a (unchanged)Notes for reviewer
tool-schema-optimizationfailure is a flaky live-model benchmark, not a regression — happy to re-run.chat_threads.use_subagentsDB column is intentionally left dormant (dropping a SQLite column needs a risky table rebuild for no benefit); the globalaiConfig.subagentsEnablednow drives behaviour.setThreadUseSubagents,ChatThread.useSubagents) removed from the renderer.Summary by CodeRabbit
New Features
Bug Fixes