Session names and model IDs are rendered as markup in the session browser, delete prompt and model picker

Open Beginner friendly
#4 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
cli, frontend

Research direction

Read src/chatty/ui/modals.py, especially _refresh_session_list, SessionDeleteConfirmModal.compose, and ModelPickerModal.on_mount; inspect how these widgets handle markup and compare with the Content approach mentioned in issue #1. Check the additional error-message and notify() cases identified in the issue. Done means user- or endpoint-provided text displays literally without markup errors or altered appearance in these widgets.

Written by the indexing model from the issue text.

Description

area: sessions area: ui bug crash markup

Three modals put user or endpoint text into widgets that parse markup:

  • SessionBrowserModal._refresh_session_list (src/chatty/ui/modals.py:242): the session name in each Option label. Session names default to the first line of the first user message (generate_session_name).
  • SessionDeleteConfirmModal.compose (src/chatty/ui/modals.py:548): Label(f"Delete '{self._session_name}'?").
  • ModelPickerModal.on_mount (src/chatty/ui/modals.py:655): model IDs returned by the endpoint's /models call.

Effect: a session named notes [/i] draft raises MarkupError as soon as the session browser (Ctrl+L) opens, so no session can be loaded from the browser until the file is renamed by hand. Pressing d on it raises the same error. Names with brackets, such as list[str] question, show as list question.

Fix: escape these strings, or pass Content, as in #1. ModelInputModal's Label(self._error_message) (modals.py:997) and the notify() calls that include exception text (such as notify(f"Compression failed: {e}"), app.py:940) are worth checking at the same time.

Dominant language
Python
Stars
0
Forks
2
Avg merge
1d 4h
Merged PRs (30d)
13

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lanl/chatty

All issues in lanl/chatty

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.