Decide Esc "back" from the current view, not the selected row (#7) #29

Merged
eric merged 1 commit from eric/fix-7-esc-back-navigation into master 2026-10-12 15:54:30 -05:00 AGit
Owner

Closes #7

Problem: Esc in browse mode decided where "back" went from the selected row and edit_details. That data is stale unless an episode row is selected. So in a series or season view where the filter matched nothing, Esc quit the app. With a Season row selected, it could return to the wrong series.

Fix (src/handlers.rs): one Esc handler that looks only at view_context.

  • Season view: goes to its series view and highlights the season you came from. The series id comes from get_season_by_id.
  • Series view: goes to the top level and highlights the series you came from.
  • Top level: exits, as before.
  • The selected row is now only used to pick what to highlight afterwards.

Header hints (src/components/header.rs) had the same mix-up:

  • In a series view they said [ESC] exit (it goes back) and [ENTER] show episodes even with an episode selected.
  • Now [ESC] follows the view: "back" in series and season views, "exit" at the top level.
  • [ENTER] follows the selected row: "show episodes" for a series or season, "play" for an episode.

Testing in the real app (tmux, dummy videos):

  • Put an episode in season 0 of a series, opened the season, and set a filter that matched nothing.
  • Esc went to the series view with the season highlighted, Esc again went to the top level with the series highlighted, and a third Esc exited cleanly.
  • The header showed the right [ENTER]/[ESC] labels at each step.
  • Full suite: 207 passed, 2 failed. The failures are the timing test and the flaky logger test, both fixed in #25.

🤖 Generated with Claude Code

https://claude.ai/code/session_01E2XefpQijvBcJBfgzuaoWA

Closes #7 **Problem:** Esc in browse mode decided where "back" went from the selected row and `edit_details`. That data is stale unless an episode row is selected. So in a series or season view where the filter matched nothing, Esc **quit the app**. With a Season row selected, it could return to the wrong series. **Fix** (`src/handlers.rs`): one Esc handler that looks only at `view_context`. - **Season view:** goes to its series view and highlights the season you came from. The series id comes from `get_season_by_id`. - **Series view:** goes to the top level and highlights the series you came from. - **Top level:** exits, as before. - The selected row is now only used to pick what to highlight afterwards. **Header hints** (`src/components/header.rs`) had the same mix-up: - In a series view they said `[ESC] exit` (it goes back) and `[ENTER] show episodes` even with an episode selected. - Now `[ESC]` follows the view: "back" in series and season views, "exit" at the top level. - `[ENTER]` follows the selected row: "show episodes" for a series or season, "play" for an episode. **Testing** in the real app (tmux, dummy videos): - Put an episode in season 0 of a series, opened the season, and set a filter that matched nothing. - Esc went to the series view with the season highlighted, Esc again went to the top level with the series highlighted, and a third Esc exited cleanly. - The header showed the right `[ENTER]`/`[ESC]` labels at each step. - Full suite: 207 passed, 2 failed. The failures are the timing test and the flaky logger test, both fixed in #25. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01E2XefpQijvBcJBfgzuaoWA
The Esc handlers in browse mode picked where to go from the selected
row and edit_details, which is only refreshed when an episode row is
selected. In a series or season view whose filter matched nothing, Esc
quit the app; with a Season row selected, it could return to the wrong
series.

Esc now uses view_context: Season -> its series (highlighting that
season), Series -> top level (highlighting that series), top level ->
exit. The series id for a season comes from get_season_by_id.

The browse header hints follow the same rule: [ESC] says "back" in
series and season views and "exit" at the top level, and [ENTER] says
"show episodes" or "play" based on the selected row.

Closes #7

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E2XefpQijvBcJBfgzuaoWA
eric merged commit 204e90b4ab into master 2026-10-12 15:54:30 -05:00
Sign in to join this conversation.
No reviewers
No labels
bug
chore
feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
spinach-dev/movies!29
No description provided.