Skip to content

fix(shell): retain header effort when location does not fit - #2277

Merged
Alan-TheGentleman merged 2 commits into
Gentleman-Programming:mainfrom
manutepowa:fix/1977-header-effort-fallback
Oct 30, 2026
Merged

Alan-TheGentleman merged 2 commits into
Gentleman-Programming:mainfrom
manutepowa:fix/1977-header-effort-fallback

Conversation

@manutepowa

@manutepowa manutepowa commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Linked Issue

Closes #1977

PR Type

  • Bug fix

Summary

  • Add a model · effort fallback stage to the header's left-side cascade, used once location has been removed.
  • Restores the reasoning effort when it still fits beside the right-aligned counters and the usage segment, instead of dropping straight to model-only. It applies to every density, including minimal, which strips the brand from each stage.
  • Models without configurable reasoning effort keep their existing fallback order.

Changes

File Change
lib/shell-bar.ts Insert [brand, withEffort] after the location stages in headerLeftStages, guarded by model.effort; update the two cascade comments.
tests/shell-bar.test.ts Add coverage for the new stage across minimal, compact and comfortable: effort retained with full usage windows, model-only fallback one column narrower, and models without effort.
docs/gentle-shell.md Document the restored model · effort stage in the header fallback order.

Test Plan

  • node --experimental-strip-types --test tests/shell-bar.test.ts → 59 passed, 0 failed (58 before the change; the new case is added).
  • pnpm run typecheck → exit 0, 186 recorded diagnostic(s), no regressions.
  • Not applicable: no shell script changed, so no shellcheck; no skill changed.

Contributor Checklist

  • Linked issue referenced (Closes #1977)
  • Bug fix type checked
  • Conventional commit message (fix(shell): retain header effort when location does not fit)
  • No Co-Authored-By trailers
  • Applicable tests run and passing
  • Docs updated for the changed behavior
  • Exactly one type:* label — type:bug cannot be applied from this fork account (pull-only permission on the upstream repo); a maintainer needs to add it.
  • status:approved on the linked issue — pending maintainer action; the issue currently carries only bug and type:bug.

Summary by CodeRabbit

  • Bug Fixes
    • Narrow headers now retain the model and effort details when they fit after the location is hidden. If space is tighter, the header keeps the model and usage details while dropping effort. This behavior applies across display densities, including minimal. Usage details and counters are reduced only after the header has tried these model display options. Models without effort continue to use their existing fallback.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Walkthrough

The header now tries a model-and-effort layout without location before falling back to the model alone. Regression tests cover this behavior across minimal, compact, and comfortable densities, and the documentation describes the updated fallback.

Changes: Header layout

Layer / File(s) Summary
Effort-bearing fallback
lib/shell-bar.ts, tests/shell-bar.test.ts, docs/gentle-shell.md
The header adds a brand-and-effort stage without location when effort is present. Tests cover available and constrained widths across three densities, including models without effort. The documentation describes the fallback before usage details or counters are reduced.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: alan-thegentleman

Merge Risk: Minimal · up to 8e353

The header retains model effort as intended while preserving usage and counter priorities. No merge-blocking risk remains.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the header keeps the reasoning effort (model · effort) when the location does not fit. The raw summary shows the header left-side cascade in lib/shell-bar.ts now adds …
Linked Issues check Passed Issue #1977 requires four coding behaviors: (1) a model plus effort header stage when location does not fit; (2) model-only fallback when model plus effort does not fit; (3) no change for models witho…
Out of Scope Changes check Passed The whole-PR diff contains three files. lib/shell-bar.ts adds the model plus effort stage and updates the cascade comments. The one-line change to the headerContent comment only describes the new stag…
Full details: Title check

Explanation

The title names the main change: the header keeps the reasoning effort (model · effort) when the location does not fit. The raw summary shows the header left-side cascade in lib/shell-bar.ts now adds a brand-plus-effort stage without location, and the tests and docs cover the same behavior. The title is specific and matches the changeset and linked objectives.

Full details: Linked Issues check

Explanation

Issue #1977 requires four coding behaviors: (1) a model plus effort header stage when location does not fit; (2) model-only fallback when model plus effort does not fit; (3) no change for models without effort; (4) regression coverage for minimal density with multiple usage windows, wide layouts, model-only fallback, and models without effort. The whole-PR diff (merge base to head) shows lib/shell-bar.ts adding ...(model.effort ? [[brand, withEffort]] : []) in headerLeftStages after the three location stages and before [brand, modelOnly]. This gives the required order. The guard keeps models without effort on the existing cascade. tests/shell-bar.test.ts adds a test that loops over minimal, compact, and comfortable. It asserts that location and profile drop and effort remains beside full usage windows at the fitting width. It asserts model-only with full usage at width minus one. It asserts that an undefined effort omits effort, profile, and location while keeping full usage. The test covers the requested cases. Limits: the test uses computed widths, not the 128/180-column synthetic repro from the issue. The incremental diff from the previous reviewed head could not be read because it exceeded the inspection buffer. The assessment therefore relies on the whole-PR diff. The reported test run (59 passed) and typecheck were not re-executed.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff contains three files. lib/shell-bar.ts adds the model plus effort stage and updates the cascade comments. The one-line change to the headerContent comment only describes the new stage in the degradation order. tests/shell-bar.test.ts adds one regression test for the new behavior. docs/gentle-shell.md records the restored fallback order, per the AI summary. No usage segment priority, usage stage, counter, sidebar, or unrelated behavior change appears in the reviewed diff. The changes match the scope in #1977, which excludes changes to usage priorities and location or profile visibility. The docs file was not read directly. Its change was taken from the supplied summary, which is treated as secondary evidence.

Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 2 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@carlosmoradev carlosmoradev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spot-on fix and very thorough regression coverage, @manutepowa.

What works well

  1. Accurate cascade positioning: Placing ...(model.effort ? [[brand, withEffort]] : []) immediately following the location-bearing stages restores the missing degradation step without perturbing minimal density or usage priorities.
  2. Comprehensive density coverage: The tests in tests/shell-bar.test.ts thoroughly exercise the restored stage across minimal, compact, and comfortable densities, including width clamping and models without reasoning effort.
  3. Documentation: docs/gentle-shell.md clearly reflects the restored fallback order.

Approved. Ready for maintainer merge.

@Alan-TheGentleman Alan-TheGentleman added the type:bug Bug fix label Oct 29, 2026
@Alan-TheGentleman
Alan-TheGentleman merged commit b0c70ca into Gentleman-Programming:main Oct 30, 2026
10 checks passed
@manutepowa
manutepowa deleted the fix/1977-header-effort-fallback branch October 30, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(shell): header hides reasoning effort despite available space

3 participants