- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13
Open
Description
Summary
Several notebook view snapshot tests currently poke into App::context_mut() to flip internal state (e.g. setting last_log, mutating tabs, forcing vim_keymap). This bypasses real user flows and makes the tests fragile.
Examples
- tui/tests/notebook_views.rsmanually edits- context.notebook.editors, pushes synthetic tabs, and sets breadcrumb vectors directly.
- The same file toggles context.vim_keymapto display overlays instead of driving the key sequences that would normally open them.
Impact
- Tests couple snapshots to internal implementation details instead of public behaviour.
- It is hard to refactor the TUI context because tests rely on private state.
- App::context_mutremains in- tui/app.rspurely to support these tests.
Proposal
- Introduce helper functions or actions that exercise the notebook flows through real transitions (e.g. dedicated commands to show Vim keymaps, helpers for log/saving indicators).
- Refactor tests to use those helpers or existing input sequences instead of reaching into context.
- Remove App::context_mutentirely once no tests depend on it.
Acceptance Criteria
- Notebook view snapshot tests operate via user-level inputs or dedicated helpers; no direct contextmutation remains.
- App::context_mutis no longer needed and is removed from- tui/app.rs.
- Existing coverage stays unchanged after the refactor.
Metadata
Metadata
Assignees
Labels
No labels