Commit Graph

102 Commits

Author SHA1 Message Date
7c00695398 refactor(navigation): include AppMode in view navigation stack
Introduce `ViewFrame` to store both the view name and the `AppMode` when
pushing to the navigation stack. Update `view_back_stack` and
`view_forward_stack` to use `ViewFrame` instead of `String` . Update
`CmdContext` and `Effect` implementations (SwitchView, ViewBack,
ViewForward) to handle the new `ViewFrame` structure. Add `is_editing()`
helper to `AppMode` .

Co-Authored-By: fiddlerwoaroof/git-smart-commit (gemma-4-26B-A4B-it-UD-Q5_K_XL.gguf)
2026-04-15 21:32:34 -07:00
38f83b2417 fix(records): include _Measure as visible column in records mode (improvise-rbv)
The records mode column filter excluded all categories starting with '_',
which hid _Measure. Changed to explicitly exclude only _Index and _Dim,
making _Measure visible as a data column. Updated the blank-model editing
test to reflect the new column order (_Measure first, Value last).

Made-with: Cursor
2026-04-15 03:56:18 -07:00
efab0cc32e test(ui): clean up formatting in app.rs tests
Clean up formatting of a test assertion in app.rs to improve readability.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (gemma-4-31B-it-UD-Q4_K_XL.gguf)
2026-04-15 03:01:30 -07:00
6f291ccd04 refactor(ui): extract record coordinates error message to constant
Extract the hardcoded error message "Record coordinates cannot be empty"
into a public constant in effect.rs to avoid duplication and improve
maintainability.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (gemma-4-31B-it-UD-Q4_K_XL.gguf)
2026-04-15 03:01:30 -07:00
9710fb534e feat(cmd): allow direct commit of synthetic records in records mode
Allow synthetic record edits to be applied directly to the model when not
in drill mode, whereas they remain staged in drill state when a drill
snapshot is active. This enables editing of records in plain records view.

Additionally, add validation to prevent creating records with empty
coordinates in both direct commits and when applying staged drill edits.
Includes regression tests for persistence in blank models, drill state
staging, and empty coordinate prevention.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (gemma-4-31B-it-UD-Q4_K_XL.gguf)
2026-04-14 02:32:03 -07:00
1cea06e14b fix(records): allow adding rows in empty records view
Add helper methods to CmdContext to clarify layout state and synthetic
record presence. Update AddRecordRow to check for records mode generally
rather than requiring a synthetic record at the current cursor, which
allows adding the first row to an empty records view.

Includes a regression test for the empty records view scenario.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (gemma-4-31B-it-UD-Q4_K_XL.gguf)
2026-04-14 01:26:29 -07:00
8b7b45587b refactor(ui): use iterator in TileBar loop
Update the loop in TileBar to use an iterator-based approach with
enumerate, take, and skip instead of indexing.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (gemma-4-31B-it-UD-Q4_K_XL.gguf)
2026-04-14 01:03:25 -07:00
d551d53eb4 refactor(test): simplify assertions and calls in various tests
Clean up various test cases by simplifying Option checks, removing
redundant clones, using contains instead of any for DateComponent checks,
and removing unnecessary references in string formatting.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (gemma-4-31B-it-UD-Q4_K_XL.gguf)
2026-04-14 01:03:25 -07:00
35e2626a7d style: add braces to if statements for consistency
Consolidate if-let chain formatting by adding missing braces throughout the
project. This improves readability and ensures consistency across the
codebase.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (gemma-4-31B-it-UD-Q4_K_XL.gguf)
2026-04-14 00:49:32 -07:00
8baa4c4865 test(grid): ensure formulas are recomputed before rendering
The render helper used in Grid tests previously did not recompute formulas,
meaning tests for computed values were either ignored or required manual
setup that didn't reflect actual application behavior.

Update the render helper to identify 'None' axis categories and trigger
recompute_formulas, and update all call sites to pass a mutable model.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (gemma-4-31B-it-UD-Q4_K_XL.gguf)
2026-04-14 00:49:31 -07:00
cb35e38df9 refactor(all): use let chains to flatten nested if statements
Replace nested if and if let blocks with combined if statements using let
chains. This reduces indentation and improves readability across the
project.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (gemma-4-31B-it-UD-Q4_K_XL.gguf)
2026-04-13 21:58:14 -07:00
6370f8b19f chore: format 2026-04-13 21:30:37 -07:00
1817494db2 chore: update app initialization and example data
Update application initialization and example data.

- `App::new` now recomputes formulas on startup to ensure formula-derived
  values are available immediately.
- Updated `examples/demo.improv` to reflect changes in formula and category
  structure.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
2026-04-11 00:08:02 -07:00
7fea5f67ed refactor(command): improve formula commitment and buffer management
Refactor command execution and buffer management.

- `CommitFormula` now defaults to targeting `_Measure` .
- `CommitFormula` no longer automatically clears the buffer; buffer
  clearing is now handled by keymap sequences.
- Added `ClearBufferCmd` to the command registry.
- Updated `AddFormulaCmd` to support optional target category.
- Added `SetBuffer` effect to allow clearing buffers.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
2026-04-11 00:08:02 -07:00
c8b9d29690 feat(model): introduce virtual '_Measure' category for formulas
Refactor formula handling to use a virtual '_Measure' category.

- Formulas now default to targeting '_Measure' if no category is specified.
- '_Measure' items are dynamically computed from existing data items and
  formula targets, preventing redundant item storage.
- Updated persistence to handle '_Measure' formulas and items correctly in
  Markdown.
- Updated UI and model to use 'effective_item_names' for layout and item
  resolution.
- Updated tests to reflect the new '_Measure' behavior.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
2026-04-11 00:08:01 -07:00
23a876d556 feat: rename Measure to _Measure (virtual), add fixed-point formula eval
_Measure is now a virtual category (CategoryKind::VirtualMeasure),
created automatically in Model::new() alongside _Index and _Dim.
Formula targets are added as items automatically by add_formula.

Formula evaluation uses a fixed-point cache: recompute_formulas()
iterates evaluation of all formula cells until values stabilize,
resolving refs through the cache for formula values and raw data
aggregation for non-formula values. This fixes formulas that
reference other measures when hidden dimensions are present.

evaluate_aggregated now checks the formula cache instead of
recursively evaluating formulas, breaking the dependency between
formula evaluation and aggregation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 00:07:59 -07:00
24c59fbf40 fix: Model::add_formula auto-adds target item; fix formula panel display
Model::add_formula now ensures the formula target exists as an item in
the target category (same fix as AddFormula effect, but at the model
level — covers file loading and headless paths).

Formula panel now shows raw formula text instead of debug-formatted
string with redundant target name and quotes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 00:07:59 -07:00
4686f47026 fix: scroll tile bar to keep selected tile visible
When there are more tiles than fit in the available width, the tile
bar now auto-scrolls to ensure the selected tile is always visible.
Overflow indicators (◀ ▶) show when tiles exist beyond the visible
area. Scroll offset is computed fresh each frame from tile_cat_idx.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 00:07:58 -07:00
32d215f3d6 fix: AddFormula now adds target item to category
When adding a formula interactively, the target (e.g. "Margin") was
registered as a formula but never added as an item to the target
category. The grid layout never created cells for it, making the
formula invisible. Now AddFormula::apply calls add_item before
registering the formula.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 00:07:58 -07:00
6239ac83ad chore: fmt + clippy 2026-04-11 00:07:57 -07:00
c8607b78ba test(ui): add unit tests for effects
Add unit tests for UI effects, covering:
- Model mutations
- View navigation
- App state changes
- Drill-down functionality

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
2026-04-11 00:06:50 -07:00
da076eadc8 test(model,ui): add tests for precision and cat tree
Add unit tests for model precision and category tree rendering:

- `src/model/types.rs` : Added `formula_chain_preserves_full_precision` to
  ensure formulas use full `f64` precision for calculations, even when
  display is rounded.
- `src/ui/cat_tree.rs` : Added comprehensive tests for `build_cat_tree` ,
  covering empty models (virtual categories), expanded/collapsed states,
  and item rendering.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
2026-04-11 00:06:50 -07:00
7dd9d906c1 refactor(ui): improve rendering, feedback, and help system
Improve UI rendering and feedback:

- `src/draw.rs` :
    - Automatically enter Help mode if the model is empty.
    - Render the `HelpWidget` with the current help page.
    - Render the `WhichKeyWidget` when a transient keymap is active.
- `src/ui/tile_bar.rs` : Use more descriptive labels for axes (e.g., "Row",
  "Col", "Pag").
- `src/ui/view_panel.rs` :
    - Include an axis summary (e.g., "R:Region C:Product") next to view
      names.
    - Refactor `ViewContent` to hold a reference to the `Model` .
- `src/ui/effect.rs` : Add error feedback to `AddItem` , `AddItemInGroup` ,
  and `AddFormula` when operations fail.
- `src/ui/help.rs` : Refactor `HelpWidget` into a multi-page system.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
2026-04-11 00:06:50 -07:00
d49bcf0060 feat(ui): implement which-key popup for command completions
Implement `WhichKey` popup to show available command completions.

- Added `format_key_label` to convert `KeyCode` to human-readable strings.
- Added `binding_hints` to `Keymap` to extract available commands for a
  given prefix.
- Added `src/ui/which_key.rs` for the widget implementation.
- Updated `src/ui/mod.rs` to export the new module.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
2026-04-11 00:06:49 -07:00
bbc009b088 feat(command): implement help page navigation
Implement help page navigation with `help-page-next` and `help-page-prev`
commands.

- Added `HelpPageNextCmd` and `HelpPagePrevCmd` to `src/command/cmd.rs` .
- Registered help navigation commands in `CmdRegistry` .
- Updated `HelpCmd` to initialize the help page.
- Added unit tests for help navigation in `src/ui/app.rs` .

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
2026-04-11 00:06:49 -07:00
5566d7349b feat(ui): add footer support to panels
Add footer_height method to PanelContent trait with default 0. Implement
footer_height in FormulaContent to return 1 when in FormulaEdit mode.
Update Panel::render to subtract footer height from item height. This
enables optional footers in panels.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (bartowski/nvidia_Nemotron-Cascade-2-30B-A3B-GGUF)
2026-04-11 00:06:48 -07:00
4b11b6e321 feat(ui): simplify AppMode minibuffer handling and panel rendering
Refactor AppMode to use MinibufferConfig for all text-entry modes. Update
command implementations to use new mode constructors. Introduce
PanelContent trait and replace panel structs with content types. Adjust
rendering to use Panel::new and minibuffer configuration. Update imports
and add MinibufferConfig struct. No functional changes; all behavior
preserved.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (bartowski/nvidia_Nemotron-Cascade-2-30B-A3B-GGUF)
2026-04-11 00:06:48 -07:00
de047ddf1a feat(effect): add changes_mode method to Effect trait and use it in ExecuteCommand
Add a `changes_mode` method to the `Effect` trait with a default implementation
returning `false` . Implement this method for the `ChangeMode` effect to return
`true` . Update the command execution logic to use `e.changes_mode()` instead of
string matching on formatted output. Adjust the corresponding test to assert the
presence of a mode‑changing effect directly via the new method, removing the
temporary debug string.

This change introduces a clear, typed way to detect mode‑changing effects,
improving readability and reducing reliance on string inspection.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (bartowski/nvidia_Nemotron-Cascade-2-30B-A3B-GGUF)
2026-04-11 00:06:48 -07:00
8f3a54bb38 feat(keymap): expose registry and update keybinding
Expose CmdRegistry via KeymapSet registry method.
Update Z keybinding to use SaveAndQuit command.
Pass registry to App's CmdContext construction.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (bartowski/nvidia_Nemotron-Cascade-2-30B-A3B-GGUF)
2026-04-11 00:06:48 -07:00
6f3af34056 chore: clippy 2026-04-11 00:06:48 -07:00
b3d80e2986 chore: clippy 2026-04-11 00:06:48 -07:00
9b8f939245 misc 2026-04-11 00:06:48 -07:00
d76efa9e0e refactor(ui): ensure layout is rebuilt and use Rc for drill state
Update UI components and effects to ensure layout is rebuilt when necessary.

- Rebuild layout in `EnterEditAtCursor` effect
- Use `Rc` for sharing records in `StartDrill` effect
- Improve formatting in `SetDrillPendingEdit` effect
- Update test case in `App` to use multi-line method calls

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
2026-04-11 00:06:48 -07:00
56838c0a61 style: cleanup formatting and code style across the project
Clean up formatting and code style across the project.

- Remove unnecessary whitespace and empty lines in `src/model/cell.rs` ,
  `src/model/types.rs` , and `src/draw.rs` .
- Reformat long lines and function calls in `src/command/cmd.rs` ,
  `src/ui/grid.rs` , and `src/ui/tile_bar.rs` for better readability.
- Consolidate imports and simplify expressions in `src/command/keymap.rs` and
  `src/ui/app.rs` .

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
2026-04-11 00:06:48 -07:00
def4f0b7df refactor(ui): improve TileBar rendering and width calculation
Update TileBar to use UnicodeWidthStr for accurate text width calculation and
improve axis display.

- Use `unicode_width::UnicodeWidthStr` for calculating label and hint widths
- Move `axis_display` to a static method on `TileBar`
- Update axis symbols for better visual clarity (e.g., '|', '-', '=', '.')
- Clear the tile bar area before rendering to prevent stale characters

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
2026-04-11 00:06:48 -07:00
e0171c758f refactor(ui): use pre-computed layout in GridWidget
Refactor GridWidget and other UI components to use the pre-computed layout from
App instead of re-creating it on every render. This improves performance and
ensures consistency.

- Update GridWidget to take a reference to GridLayout
- Update GridWidget::new and render to use the provided layout
- Update App::cmd_context and other call sites to pass the layout
- Update tests to provide the layout to GridWidget

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
2026-04-11 00:06:48 -07:00
a17802e07d refactor(ui): improve layout management and record sharing in App
Refactor App and DrillState to use Rc for sharing records, and introduce
rebuild_layout() to manage GridLayout lifecycle. This ensures the layout is
consistently updated when the model or drill state changes.

- Use Rc<Vec<(CellKey, CellValue)>> for DrillState.records to allow cheap
  cloning
- Add layout field to App
- Implement rebuild_layout() in App to refresh the GridLayout
- Update App::new and App::cmd_context to use the new layout management
- Ensure layout is rebuilt after applying effects and handling key events

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
2026-04-11 00:06:48 -07:00
b450d1add6 refactor(ui): simplify panel mode mapping and add scroll tests
Adds a `mode()` method to the `Panel` enum to map panels to their
corresponding `AppMode`. Simplifies `TogglePanelAndFocus` in `cmd.rs`
to use this method instead of a manual match block.

Also adds regression tests in `app.rs` to verify that viewport
scrolling now correctly handles small terminal heights.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-31B-it-GGUF:UD-Q5_K_XL)
2026-04-11 00:06:48 -07:00
b7e5115a8e refactor(view): unify cell handling for records and pivot modes
Unifies cell text retrieval and formatting across pivot and records modes.
Introduces `GridLayout::display_text` to centralize how cell content is
resolved, reducing duplication in `GridWidget` and `export_csv`.
Moves formatting logic from `src/ui/grid.rs` to a new dedicated `src/format.rs`
module to improve reusability.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-31B-it-GGUF:UD-Q5_K_XL)
2026-04-11 00:06:48 -07:00
395410b357 style: simplify panel titles
Clean up UI panel titles by removing redundant keyboard hints that are
already present in the app's status bar or are no longer needed.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-31B-it-GGUF:UD-Q5_K_XL)
2026-04-11 00:06:48 -07:00
b5418f2eea fix: use precise column widths for viewport scrolling
Improve grid viewport calculations by using actual column widths instead of
rough estimates. This ensures that the viewport scrolls correctly when the
cursor moves past the visible area.

- Move column width and visible column calculations to public functions in
  `src/ui/grid.rs`.
- Update `App::cmd_context` to use these precise calculations for `visible_cols`
  .
- Add a regression test to verify that `col_offset` scrolls when cursor moves
  past visible columns.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-31B-it-GGUF:UD-Q5_K_XL)
2026-04-11 00:06:48 -07:00
ebf4a5ea18 feat: add page scrolling, open-row, and tab-advance
Add new navigation and editing capabilities to improve data entry and
browsing efficiency.

- Implement `PageScroll` command for PageUp/PageDown navigation.
- Implement `OpenRecordRow` command (Vim-style 'o') to add a row and enter edit
  mode.
- Implement `CommitAndAdvanceRight` command for Excel-style Tab navigation.
- Add keybindings for Home, End, PageUp, PageDown, and Tab.
- Update UI hints to reflect new Tab functionality.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-31B-it-GGUF:UD-Q5_K_XL)
2026-04-11 00:06:48 -07:00
fbd672d5ed refactor!: unify records and pivot mode cell handling
Refactor records mode to use synthetic CellKeys (_Index, _Dim) for all columns,
allowing uniform handling of display values and edits across both pivot and
records modes.

- Introduce `synthetic_record_info` to extract metadata from synthetic keys.
- Update `GridLayout::cell_key` to return synthetic keys in records mode.
- Add `GridLayout::resolve_display` to handle value resolution for synthetic
  keys.
- Replace `records_col` and `records_value` in `CmdContext` with a unified
  `display_value`.
- Update `EditOrDrill` and `AddRecordRow` to use synthetic key detection.
- Refactor `CommitCellEdit` to use a shared `commit_cell_value` helper.

BREAKING CHANGE: CmdContext fields `records_col` and `records_value` are replaced by
`display_value` .
Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-31B-it-GGUF:UD-Q5_K_XL)
2026-04-11 00:06:48 -07:00
9e02939b66 refactor: update TogglePanelAndFocus to use open/focused flags
Update TogglePanelAndFocus and related components to use open/focused flags.

Changed TogglePanelAndFocus from currently_open to open+focused flags.
Parser accepts optional [open] [focused] arguments.

Interactive mode toggles between open+focus and closed/unfocused.

Keymap updates: F/C/V in panel modes close panels when focused.

Model initialization: Virtual categories _Index/_Dim default to None
axis, regular categories auto-assign Row/Column/Page.

App test context updated with visible_rows/visible_cols.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/Qwen3.5-35B-A3B-GGUF:Q5_K_M)
2026-04-11 00:06:48 -07:00
ad95bc34a9 refactor: update grid widget with adaptive widths and pruning support
Update grid widget with adaptive column/row widths and pruning support.

Replaced fixed ROW_HEADER_WIDTH (16) and COL_WIDTH (10) with adaptive
widths based on content. MIN_COL_WIDTH=5, MAX_COL_WIDTH=32. MIN_ROW_HEADER_W=4,
MAX_ROW_HEADER_W=24.

Column widths measured from header labels and cell content (pivot mode
measures formatted values, records mode measures raw values).

Row header widths measured from widest label at each level.

Added underlining for columns sharing ancestor groups with selected
column. Updated is_aggregated check to filter virtual categories.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/Qwen3.5-35B-A3B-GGUF:Q5_K_M)
2026-04-11 00:06:48 -07:00
21f3e2c58e chore: update app hints and mode descriptions
Update status bar hints for new features.

Normal mode hint: Added R:records P:prune, removed F/C/V:panels
CategoryPanel hint: Added d:delete

These hints reflect the new keybindings for records mode toggle,
prune empty toggle, and category deletion.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/Qwen3.5-35B-A3B-GGUF:Q5_K_M)
2026-04-11 00:06:48 -07:00
df98f6d524 feat: add effect to re-enter edit mode after commit+advance
Add EnterEditAtCursor effect to re-enter edit mode after commit.

Used by CommitCellEdit to continue data entry after advancing
cursor. Reads the cell value at the new cursor position and
starts editing mode with that value pre-filled.

Also adds TogglePruneEmpty, ToggleCatExpand, RemoveItem, and
RemoveCategory effects to effect.rs for the new commands.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/Qwen3.5-35B-A3B-GGUF:Q5_K_M)
2026-04-11 00:06:48 -07:00
55cad99ae1 feat: add new commands for records mode and category management
Add new commands for enhanced data entry and category management.

AddRecordRow: Adds a new record row in records mode with empty value.
TogglePruneEmpty: Toggles pruning of empty rows/columns in pivot mode.
ToggleRecordsMode: Switches between records and pivot layout.
DeleteCategoryAtCursor: Removes a category and all its cells.
ToggleCatExpand: Expands/collapses a category in the tree.
FilterToItem: Filters to show only items matching cursor position.

Model gains remove_category() and remove_item() to delete categories
and items along with all referencing cells and formulas.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/Qwen3.5-35B-A3B-GGUF:Q5_K_M)
2026-04-11 00:06:48 -07:00
5fe553b57a feat: add category tree with expand/collapse in category panel
Add a tree-based category panel that supports expand/collapse of categories.

Introduces CatTreeEntry and build_cat_tree to render categories as
a collapsible tree. The category panel now displays categories with
expand indicators (▶/▼) and shows items under expanded categories.

CmdContext gains cat_tree_entry(), cat_at_cursor(), and cat_tree_len()
methods to work with the tree. App tracks expanded_cats in a HashSet.

Keymap updates: Enter in category panel now triggers filter-to-item.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/Qwen3.5-35B-A3B-GGUF:Q5_K_M)
2026-04-11 00:06:48 -07:00
496a385c15 fix(ui): prevent grid column overflow with proper truncation
Fix column header and cell text truncation to prevent overflow
when text width equals column width. Changed truncate() calls to
use cw.saturating_sub(1) instead of cw, ensuring at least one
character of padding remains.

Affected areas:
- Column header labels (left-aligned)
- Column header labels (right-aligned)
- Cell values
- Total/summary rows

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/Qwen3.5-35B-A3B-GGUF:Q5_K_M)
2026-04-06 08:58:23 -07:00