Skip to content

Conversation

@vdavid
Copy link
Owner

@vdavid vdavid commented Jan 25, 2026

Summary

  • Add Settings dialog with sidebar navigation and search
  • Implement keyboard shortcut customization with scope-aware conflict detection
  • Support platform-specific key formatting (⌘⇧P on macOS, Ctrl+Shift+P elsewhere)
  • Add declarative settings registry with type-safe definitions

Changes

  • New src/lib/settings/ module with components, sections, and registry
  • New src/lib/shortcuts/ module for shortcut management
  • Settings window opens via ⌘, or menu
  • 27 tests for shortcuts, 19 tests for settings registry
  • Keyboard handler refactored to reduce complexity

Test plan

  • Unit tests pass (540 total)
  • ESLint, Prettier, Stylelint, svelte-check pass
  • Clippy and rustfmt pass
  • Manual testing of Settings dialog navigation and shortcut editing

@vdavid vdavid force-pushed the claude/add-settings-dialog-9XJ71 branch from 04913a4 to fdc802a Compare January 25, 2026 21:36
claude and others added 19 commits January 28, 2026 13:29
Documents the hybrid declarative registry approach for the settings
system, including search via uFuzzy and registry-UI completeness checks.
- docs/specs/settings.md: Complete spec for settings UI, registry,
  persistence, all sections, keyboard shortcuts editor, themes, and
  advanced settings
- docs/specs/settings-tasks.md: Phased implementation plan with ~80
  tasks covering foundation, UI, testing, and documentation
Implements a comprehensive settings system with:
- Settings registry for declarative setting definitions
- Ark UI components for all setting types (switch, select, slider, etc.)
- Settings persistence via tauri-plugin-store
- Fuzzy search using uFuzzy (same engine as command palette)
- Settings window accessible via Cmd+,
- Multiple sections: Appearance, File operations, Updates, Network,
  Keyboard shortcuts, Themes, Developer/MCP, Logging, Advanced
- Unit tests for registry and search functionality
- Rust port checker for MCP server configuration
- Remove async from functions that don't await (setSetting, resetSetting)
- Add eslint-disable comments for intentionally unused searchQuery props
- Replace non-null assertions with proper null coalescing defaults
- Fix template literal expressions with number types
- Add keys to all {#each} blocks
- Fix no-confusing-void-expression errors with proper braces
- Remove unused imports (onDestroy, searchSettings, toMilliseconds, etc.)
- Fix floating promises with void operator
- Simplify unnecessary conditionals flagged by ESLint
The console statements are intentional for logging warnings and errors
during settings initialization, persistence, and listener notifications.
Tests cover:
- Opening settings via keyboard shortcut (Meta+, or Ctrl+,)
- Settings sidebar navigation
- Search input functionality
- Section selection
- Closing settings with Escape key
- Fallback direct navigation tests

Note: Multi-window tests may be skipped if the test environment
doesn't support window switching with tauri-driver.
Implements spec from docs/specs/shortcut-settings.md:

- New shortcuts module (src/lib/shortcuts/) with:
  - Scope hierarchy for determining active scopes
  - Key capture and formatting (platform-specific)
  - Shortcuts store for persistence
  - Conflict detection between overlapping scopes
  - Keyboard handler for matching shortcuts

- Updated KeyboardShortcutsSection.svelte:
  - Click-to-edit shortcuts with 500ms confirmation
  - Conflict warning with resolve options
  - Modified indicator (blue dot)
  - Filter chips: All, Modified, Conflicts (with count)
  - Add/remove shortcuts per command
  - Reset to defaults (single and all)

- Documentation:
  - docs/specs/shortcut-settings.md: Full specification
  - docs/specs/shortcut-settings-tasks.md: Implementation tasks
  - docs/features/settings.md: Feature documentation

- Tests: 27 unit tests for scope hierarchy and key capture
- Add --color-warning-bg CSS variable for light and dark modes
- Remove inline color fallbacks from KeyboardShortcutsSection.svelte
- Add settings and shortcuts modules to knip ignore list (public API)
Extract shortcut matching into small helper functions to reduce
cyclomatic complexity from 19 to under 15.
Rust:
- Remove unused port checker commands from invoke_handler (not yet used)
- Keep port_checker module for future MCP server configuration

CSS:
- Add missing .subsections class to SettingsSidebar
Rust:
- Remove unused port_checker module (can be re-added when needed)
- Export only load_settings from settings module (others unused)

Coverage:
- Add settings components and sections to allowlist (UI components)
- Add shortcuts store files to allowlist (depend on Tauri APIs)
- Add DevTools permission for settings window
- Add window positioning (centered, max 852px)
- Remember last section (in app-status-store)
- Auto-apply UI density (row height in lists)
- Auto-apply date/time format
- Auto-apply Theme changes (setTheme() in ThemesSection)
- Add IntelliJ-style navigation with summary pages
- Add settings persistence (debounced save to store)
- Fix keyboard shortcuts error
- Fix slider visual bug
- Add debug logging
- Add cross-window settings sync via Tauri events so settings changes
  in Settings window immediately apply to main window
- Wire up `appearance.fileSizeFormat` setting:
    - Add formatFileSizeWithFormat() supporting binary (1024) and SI (1000) units
    - FullList uses reactive formatFileSize() for file size tooltips
- Wire up `appearance.useAppIconsForDocuments` setting:
    - Pass setting through Rust backend icon fetching
    - Add clearExtensionIconCache command to clear cache when setting changes
    - Icons update immediately when toggling the setting
- Add reactive settings infrastructure for immediate UI updates
- Add debug logging for settings changes
- Add cross-window settings sync via Tauri events (settings:changed)
- Create reactive-settings.svelte.ts for immediate UI updates
- Wire UI density to row heights in BriefList/FullList
- Wire date/time format with live formatting updates
- Wire file size format (binary/SI) throughout the app
- Wire network timeout settings to SMB client operations
- Wire developer settings (verbose logging, MCP config)
- Wire advanced settings (virtualization buffer, debounce, timeouts)
- Fix Reset feature not clearing modified indicators
- Fix app icons toggle causing missing icons (cache refresh)
- Fix BriefList bottom bar to use reactive file size format
- Add format-utils.ts for pure formatting functions
- Add network-settings.ts helpers for timeout calculations
- Add settings-applier.ts for CSS variable and backend sync
@vdavid vdavid force-pushed the claude/add-settings-dialog-9XJ71 branch from fdc802a to 3a7f5e9 Compare February 1, 2026 10:39
- 200ms debounce added to search input in SettingsSidebar
- Content filtering: SettingsContent now only shows sections containing matching settings, and only the individual setting rows that match the query
- Search highlighting: Matching text is highlighted with <mark class="search-highlight"> in setting labels. Added --color-highlight CSS variable (yellow tint) for light/dark modes.
- Updated all section components (Appearance, FileOperations, Updates, Network, McpServer, Logging, Themes, Advanced) to filter individual settings using getMatchingSettingIds()
- Bug fixes: Fixed ESLint error in SettingSelect, added CSS classes to allowlist
- Remove shortcut button: Each shortcut pill now has a hoverable "x" button on the right side with "Remove shortcut" tooltip
- ESC handling in "Add shortcut" mode: ESC now cancels the add mode instead of closing the settings window (uses stopPropagation)
- Reset button fixed: Removed unnecessary confirm dialog, added proper event handling so it actually resets to default
- Duplicate prevention: saveShortcut() now checks if the same shortcut already exists on that action and cancels if duplicate
- "Filter by keys" field improved:
    - Modifiers show while held, clear when released (unless a non-modifier was pressed)
    - Captures special keys (ESC, Backspace, Space, etc.)
    - Tab passes through for focus navigation
- Shortcuts now work:
    - Added initializeShortcuts() calls in both main window and settings window
    - The keyboard handler uses getEffectiveShortcuts() which returns custom shortcuts
- Fix searching for shortcuts Settings-wide
- Fix saving/loading settings
- Update Tauri menus when changing shortcuts
- Some more fixes
- Improve MCP server along the way
- Also remove some excessive debug logs
@vdavid vdavid force-pushed the claude/add-settings-dialog-9XJ71 branch from fd13fff to 42c361d Compare February 2, 2026 08:25
@vdavid vdavid changed the title Add ADR 018: Settings architecture Add Settings window Feb 2, 2026
@vdavid vdavid merged commit 4b5e191 into main Feb 2, 2026
7 of 8 checks passed
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.

2 participants