Skip to content

Add configurable query-results grid layout with keyboard navigation#900

Merged
multiplex55 merged 2 commits intomasterfrom
codex/add-query-results-layout-settings
Feb 20, 2026
Merged

Add configurable query-results grid layout with keyboard navigation#900
multiplex55 merged 2 commits intomasterfrom
codex/add-query-results-layout-settings

Conversation

@multiplex55
Copy link
Owner

Motivation

  • Provide an optional grid layout for query results so users can view results in rows/columns instead of a single vertical list.
  • Make layout selection plugin-aware so plugins can advertise compatibility and the UI can fall back to a list when appropriate.
  • Allow users to configure the grid (enable/rows/cols) from the settings UI and have changes apply immediately at runtime.
  • Improve keyboard navigation to support 2D movement in grid mode (arrow keys + numpad mapping).

Description

  • Settings: added QueryResultsLayoutSettings to src/settings.rs with serde defaults and a Default impl, and wired it into Settings::default() and (de)serialization so existing configs remain compatible. (fields: enabled, rows, cols, respect_plugin_capability, plugin_opt_out).
  • Settings editor: extended SettingsEditor in src/settings_editor.rs with fields for the layout, populated them in SettingsEditor::new(...), converted back in to_settings(...) (rows/cols clamped to >=1), and added UI controls (toggle, numeric rows/cols, capability-respect toggle and comma-separated plugin opt-out). Changes are applied to runtime LauncherApp immediately when saved.
  • Runtime and rendering: added query_results_layout + resolved_grid_layout to LauncherApp in src/gui/mod.rs, recompute hooks (should_use_grid_layout / recompute_query_results_layout), and wire recompute calls into search and settings-apply flows so edits take effect immediately. Implemented a grid rendering path (egui::Grid) for the main query results pane while preserving the existing vertical list as a fallback and handling overflow/scrolling naturally.
  • Plugin-aware gating: added capability markers in src/plugin.rs (grid_results_compatible and force_list_results) and implemented logic in LauncherApp::should_use_grid_layout that resolves grid vs list based on active plugins, capability presence, and the opt-out list; mixed or ambiguous sources fall back to list mode.
  • Keyboard navigation: extended LauncherApp::handle_key(...) to support Left/Right and numpad 2/4/6/8 for 2D navigation in grid mode, while preserving list behavior in list mode and keeping Enter activation semantics.
  • Tests: added focused unit tests covering settings serde/defaults and roundtrip, settings-editor conversion roundtrip & clamping, grid keyboard navigation (arrows + numpad), and plugin-aware layout selection logic (all added in src/settings.rs, src/settings_editor.rs, and src/gui/mod.rs test modules).

Testing

  • Ran cargo fmt to format the code; it completed successfully.
  • Attempted to run unit tests (compiled a targeted test group), but the build aborted due to a missing system library required by a dependency (alsa): running cargo test in this environment failed with a pkg-config/alsa.pc error from alsa-sys during compilation, so automated tests could not be completed here.
  • Unit tests added: settings defaults & round-trip (src/settings.rs), settings-editor conversion & clamping (src/settings_editor.rs), grid navigation and plugin capability/resolution (src/gui/mod.rs), intended to pass when dependencies and native build tools are available.

Codex Task

@multiplex55 multiplex55 merged commit 9f4b0fd into master Feb 20, 2026
1 check passed
@multiplex55 multiplex55 deleted the codex/add-query-results-layout-settings branch February 20, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant