Skip to content

feat: add setting to keep AI groups expanded after context navigation#173

Open
voidless wants to merge 1 commit intomatt1398:mainfrom
voidless:feat-add-setting-to-keep-ai-groups-expanded-after-context-navigation
Open

feat: add setting to keep AI groups expanded after context navigation#173
voidless wants to merge 1 commit intomatt1398:mainfrom
voidless:feat-add-setting-to-keep-ai-groups-expanded-after-context-navigation

Conversation

@voidless
Copy link
Copy Markdown

@voidless voidless commented Apr 10, 2026

Summary

Navigating from the Visible Context panel temporarily expands the target AI group to show the highlighted turn or tool, but it collapses again once the 2-second highlight fades. This makes it hard to inspect the content you just navigated to.

A new "Keep expanded after context navigation" toggle (Settings > General, off by default) calls expandAIGroupForTab alongside the highlight so the group stays open until manually collapsed.

Changes

  • Add keepContextNavExpanded to DisplayConfig with default false
  • Wire the setting through config validation, safe config, and reset defaults
  • In ChatHistory, read the flag during turn and tool navigation handlers and persist expansion when enabled
  • Add toggle to General settings section using existing onDisplayToggle handler
  • Update test mock with the new config key

Test plan

  • Toggle OFF (default): navigate from Visible Context panel — group expands briefly, collapses after highlight fades (existing behavior unchanged)
  • Toggle ON: navigate from Visible Context panel — group stays expanded after highlight fades
  • Toggle ON: navigate to a tool within an AI group — group stays expanded, tool is highlighted
  • Setting persists after restarting the app
  • Reset to defaults reverts the toggle to OFF

Summary by CodeRabbit

Release Notes

  • New Features
    • Added a new display setting "Keep expanded after context navigation" in General settings. When enabled, AI groups remain expanded when navigating between turns and tools from the Visible Context panel.

Navigating from the Visible Context panel temporarily expands the target
AI group, but it collapses again after the 2s highlight fades. A new
"Keep expanded after context navigation" toggle in Appearance settings
persists the expansion via expandAIGroupForTab so the group stays open
until manually collapsed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai coderabbitai bot added the feature request New feature or request label Apr 10, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new configuration setting, keepContextNavExpanded, which allows AI response groups to remain expanded after navigating to them from the Visible Context panel. The implementation includes updates to configuration validation, default settings, the settings UI, and the navigation logic within the chat history component. Review feedback suggests refactoring the repeated state access for this new setting into a memoized variable or custom hook to improve code maintainability and readability.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 64e53d05-2a54-42b1-87d4-d0fddff667e7

📥 Commits

Reviewing files that changed from the base of the PR and between 2cd1356 and 97639c0.

📒 Files selected for processing (9)
  • src/main/ipc/configValidation.ts
  • src/main/services/infrastructure/ConfigManager.ts
  • src/renderer/components/chat/ChatHistory.tsx
  • src/renderer/components/settings/SettingsView.tsx
  • src/renderer/components/settings/hooks/useSettingsConfig.ts
  • src/renderer/components/settings/hooks/useSettingsHandlers.ts
  • src/renderer/components/settings/sections/GeneralSection.tsx
  • src/shared/types/notifications.ts
  • test/mocks/electronAPI.ts

📝 Walkthrough

Walkthrough

A new boolean configuration setting keepContextNavExpanded has been introduced across the application. This setting allows users to preserve expanded AI groups after navigating from the Visible Context panel. The feature includes configuration validation, persistence, a UI toggle in the Settings panel, and conditional expansion logic in the ChatHistory component.

Changes

Cohort / File(s) Summary
Configuration & Type Definitions
src/shared/types/notifications.ts, src/main/ipc/configValidation.ts, src/main/services/infrastructure/ConfigManager.ts
Added keepContextNavExpanded boolean property to AppConfig.display, extended config validation to accept the new field, and initialized it in the default configuration with value false.
Settings UI
src/renderer/components/settings/SettingsView.tsx, src/renderer/components/settings/sections/GeneralSection.tsx, src/renderer/components/settings/hooks/useSettingsConfig.ts, src/renderer/components/settings/hooks/useSettingsHandlers.ts
Added UI toggle in GeneralSection for the new setting, wired display toggle handlers through SettingsView, exposed the setting in SafeConfig with safe fallbacks, and updated default reset values to include the new field.
Feature Implementation
src/renderer/components/chat/ChatHistory.tsx
Conditionally calls expandAIGroup when navigating to a turn or tool if keepContextNavExpanded is enabled, with updated hook dependencies.
Test Mocks
test/mocks/electronAPI.ts
Added keepContextNavExpanded with default value false to the mocked config object.

Suggested labels

feature request


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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant