Skip to content

Help-screen grouping + better --slice diagnostics (work-ixhv)#14

Merged
ak2k merged 2 commits into
mainfrom
worktree-work-ixhv-help-grouping
May 17, 2026
Merged

Help-screen grouping + better --slice diagnostics (work-ixhv)#14
ak2k merged 2 commits into
mainfrom
worktree-work-ixhv-help-grouping

Conversation

@ak2k

@ak2k ak2k commented May 17, 2026

Copy link
Copy Markdown
Owner

Stacked on top of #13 (work-4uls surface hygiene). Merge order: #12#13 → this. Retarget this PR's base to `main` once #13 merges, before #13's branch gets deleted (per gh_stacked_pr_base_branch_deletion).

Summary

Two changes that compound nicely on the surface-hygiene work in #13:

  1. Grouped help panels. `flight search --help` (plus `calendar` and `detail`) now renders flags inside named Rich panels — Itinerary / Filtering / Output / Backend & providers — instead of one undifferentiated dump. Same group names across commands so the user gets a consistent mental map for where each flag lives. Zero behavior change; pure rendering via Typer's `rich_help_panel` kwarg.

  2. --slice parser diagnostics. The original `BadParameter` message was fine for missing-date but useless for the most common typo (`r-LH+` instead of `r=LH+` — silently ignored by the lookahead split). Each failure mode now surfaces a specific message:

Input Old message New message
`JFK-LHR` should be ORIGIN-DEST:DATE[...] missing date — expected ORIGIN-DEST:DATE...
`JFKLHR:2026-08-15` (would've crashed inside split) missing '-' between origin and destination
`JFK-LHR:2026-13-99` (typer.Exit with bad-date envelope) invalid date '2026-13-99' (expected YYYY-MM-DD)
`JFK-LHR:2026-08-15:r-LH+` (silently dropped) unknown key prefix in 'r-LH+'; valid keys are r=ROUTING and e=EXTENSION (note the '=')

The unknown-key-prefix branch closes a real silent-failure path: `r-LH+` previously fell off the lookahead split's allow-list and the routing was just gone with no warning.

Test plan

  • 232 tests pass (10 new in `tests/test_slice_diagnostics.py`)
  • Pyright clean: `0 errors, 0 warnings, 0 informations`
  • Live smoke: `flight search --help` shows grouped panels; `flight calendar --help` same; bad slice spec produces specific error message

@ak2k ak2k force-pushed the worktree-work-4uls-surface-hygiene branch from 949f2a6 to d87de40 Compare May 17, 2026 04:53
@ak2k ak2k force-pushed the worktree-work-ixhv-help-grouping branch from e46039d to 3a15e63 Compare May 17, 2026 05:29
@ak2k ak2k force-pushed the worktree-work-4uls-surface-hygiene branch from 7e9926a to 8409d8e Compare May 17, 2026 05:52
@ak2k ak2k changed the base branch from worktree-work-4uls-surface-hygiene to main May 17, 2026 05:53
ak2k added 2 commits May 17, 2026 01:53
`flight search --help` (and calendar/detail) now show flags grouped into
named panels: Itinerary / Filtering / Output / Backend & providers.
Same group names across commands so the user gets a consistent mental
map. Zero behavior change — pure rendering.

--slice parser now surfaces the specific failure mode instead of the
generic "should be ORIGIN-DEST:DATE[:r=...:e=...]":
  - missing date         → "missing date — expected ORIGIN-DEST:DATE..."
  - malformed origin-dest → "missing '-' between origin and destination"
  - empty origin/dest    → "must both be non-empty"
  - invalid date         → "invalid date 'YYYY-MM-DD'"
  - unknown key prefix   → "unknown key prefix in 'r-LH+'; valid keys are
                          r=ROUTING and e=EXTENSION (note the '=')"

The unknown-key-prefix branch closes a silent-failure path: typing
`r-LH+` instead of `r=LH+` previously got dropped by the lookahead split
without warning, so the user got a search that ignored their routing.

10 new tests in tests/test_slice_diagnostics.py pin each error path.

Stacked on top of work-4uls (#13).
@ak2k ak2k force-pushed the worktree-work-ixhv-help-grouping branch from 8e1c55e to 57f471d Compare May 17, 2026 06:11
@ak2k ak2k merged commit 06e8bfb into main May 17, 2026
2 checks passed
@ak2k ak2k deleted the worktree-work-ixhv-help-grouping branch May 17, 2026 06:13
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.

1 participant