Skip to content

fix(session-picker): avoid MissingStyle when confirming session delete#908

Open
syf2211 wants to merge 2 commits into
mistralai:mainfrom
syf2211:fix/session-picker-delete-shortcut-style
Open

fix(session-picker): avoid MissingStyle when confirming session delete#908
syf2211 wants to merge 2 commits into
mistralai:mainfrom
syf2211:fix/session-picker-delete-shortcut-style

Conversation

@syf2211

@syf2211 syf2211 commented Jul 15, 2026

Copy link
Copy Markdown

Summary

Fixes a crash when pressing d to delete a session in the session picker. The delete confirmation prompt now uses Textual markup (Content.from_markup) instead of Rich Text.append with $primary theme tokens.

Motivation

OptionList renders option prompts via Content.from_rich_text, which cannot parse Textual theme variables like $primary. The delete confirmation path used text.append("d", style=SHORTCUT_STYLE) where SHORTCUT_STYLE = "b not dim $primary", causing:

MissingStyle: Failed to get style 'b not dim $primary'

Reported in #907.

Changes

  • Build delete confirmation prompt with Content.from_markup and shortcut('d'), matching the pattern used in help text and quit_manager.py
  • Widen _option_text / _show_delete_state prompt types to Text | Content
  • Add regression test that exercises OptionList._update_lines() with the confirmation prompt

Tests

python3 -m pytest tests/cli/textual_ui/test_session_picker.py -q -o addopts=""

Result: 33 passed

Notes

  • Only the confirmation state is affected; feedback/pending prompts still use Rich Text without $primary
  • Reviewed with composer-2.5: APPROVE

Fixes #907

syf2211 added 2 commits July 15, 2026 12:05
OptionList renders option prompts via Content.from_rich_text, which cannot
parse the Textual theme token $primary in Rich style spans. Building the
delete confirmation prompt with Content.from_markup avoids MissingStyle
when pressing 'd' to delete a session.

Fixes mistralai#907
@syf2211
syf2211 requested a review from a team as a code owner July 15, 2026 12:06
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.

bug: Error when trying delete with session picker — MissingStyle: Failed to get style 'b not dim $primary'

1 participant