Skip to content

Bottom toolbar format string for customization#1655

Merged
rolandwalker merged 1 commit intomainfrom
RW/custom-toolbar-format-string-second-line
Feb 28, 2026
Merged

Bottom toolbar format string for customization#1655
rolandwalker merged 1 commit intomainfrom
RW/custom-toolbar-format-string-second-line

Conversation

@rolandwalker
Copy link
Contributor

@rolandwalker rolandwalker commented Feb 28, 2026

Description

Like the prompt, the bottom toolbar can be customized, using the same format strings, with a special format string \B to represent the standard toolbar (in the first position only).

When \B is included the user's customizations appear on the second line.

When \B is not included, the user may override the toolbar completely. Transient notices will still appear to the right of the user's format.

Like the prompt, both a CLI option --toolbar and a ~/.myclirc option are provided, with the CLI option taking precedence.

Motivation: useful information takes up repeated space in the prompt, but needs to be displayed only once in the toolbar.

Example:

status_bar_styled

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

@rolandwalker rolandwalker self-assigned this Feb 28, 2026
@github-actions
Copy link

  1. Medium: Missing regression tests for the new toolbar formatting paths.
    The PR adds multiple branches with behavior differences (\B prefix, full override, dynamic notice placement, cached rendering while typing) but no tests exercise them, so regressions are likely to slip in.
    Relevant code: mycli/clitoolbar.py:67, mycli/main.py:1506

    Suggested tests:

    • toolbar='\B\d' keeps default toolbar on line 1 and renders custom content on line 2.
    • toolbar='\d' fully overrides default toolbar, but transient/dynamic notices still append on the right.
    • toolbar='\B' keeps current default behavior (no extra custom line).
    • get_custom_toolbar() caching behavior while buffer is non-empty vs empty.

No correctness or security defects stood out in the implementation itself.

@rolandwalker rolandwalker force-pushed the RW/custom-toolbar-format-string-second-line branch from 4829522 to 4e7d405 Compare February 28, 2026 14:10
@scottnemes
Copy link
Contributor

Verified toolbar customization works as expected

@rolandwalker rolandwalker force-pushed the RW/custom-toolbar-format-string-second-line branch from 4e7d405 to 6e31561 Compare February 28, 2026 23:09
Like the prompt, the bottom toolbar can be customized, using the same
format strings, with a special format string \B to represent the
standard toolbar (in the first position only).

When \B is included the user's customizations appear on the second line.

When \B is not included, the user may override the toolbar completely.
Transient notices will still appear to the right of the user's format.

Like the prompt, both a CLI option --toolbar and a ~/.myclirc option are
provided, with the CLI option taking precedence.
@rolandwalker rolandwalker force-pushed the RW/custom-toolbar-format-string-second-line branch from 6e31561 to ead41c3 Compare February 28, 2026 23:10
@rolandwalker rolandwalker merged commit 025f33e into main Feb 28, 2026
8 checks passed
@rolandwalker rolandwalker deleted the RW/custom-toolbar-format-string-second-line branch February 28, 2026 23:14
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.

2 participants