Citation titles, chunk text and rewritten queries are rendered as markup

Open Beginner friendly
#3 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
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
cli

Research direction

Start in src/chatty/ui/widgets.py at lines 695 and 758, where queries, citation titles, and chunk text are passed to Textual widgets. Check how Collapsible handles its string title and how Textual supports Content or escaped text. Done means bracketed titles render intact and text containing [/ no longer raises MarkupError.

Written by the indexing model from the issue text.

Description

area: rag area: ui bug crash markup

CitationsWidget passes retrieved text to Textual widgets that parse markup:

  • the citation title [T.N] PMID:... | <paper title> goes to Collapsible(title=...) (src/chatty/ui/widgets.py:758), and CollapsibleTitle renders it as markup;
  • the chunk text goes to Static(full_text) in the same place;
  • the original and rewritten queries go to Static(content) (src/chatty/ui/widgets.py:695).

Effect:

  • Paper titles in brackets disappear. PubMed puts translated titles in brackets, so [1.3] PMID:123 | [Clinical features of COVID-19 in children]. shows as ▶ [1.3] PMID:123 | .
  • A title or chunk containing [/ (code, paths, regexes) raises MarkupError while the citations widget is composed. This happens outside the worker's try, so the app exits.

Fix: pass Content objects (or escaped text) for the title, chunk text and queries. Collapsible's title parameter is typed str, so check that a Content title renders, or escape the string.

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.