Restore Shinychat ownership of verified citation display - #127
Conversation
|
Preview deployed to Connect ( Deployed from commit ade21dd. |
|
Preview deployed to Connect ( Deployed from commit ade21dd. |
simonpcouch
left a comment
There was a problem hiding this comment.
Nice! Happy to take this on after some iteration.
Two UI pieces that related PRs and commits have had some back and forth on--in this:
- I would prefer that the text in the pills is not bolded. I think the shinychat default weight is 600 and I had changed it to 400.
- The "Verified answer" badge and text doesn't need to be duplicated inside of the popup
Also, with this PR, I'm seeing that citations often land on separate lines:
Otherwise, the UI changes are fine with me!
| - Citations are rendered as footnotes at the end of the preceding line. Place | ||
| each citation on its own line immediately after the text it supports; that | ||
| text should stand on its own. | ||
| - Place each citation immediately after the paragraph it supports. |
There was a problem hiding this comment.
From my understanding of the changes, it doesn't seem necessary to change this line? If so, my more concrete feedback is that I'd prefer not to say "paragraph" here, which might make the agent think it should refrain from writing short replies in favor of writing paragraphs.
There was a problem hiding this comment.
Yea, thanks for catching this. Fixed in 9d82a3b.
| # State spans the unflushed raw-input tail, the text/citation/discard mode, and | ||
| # whether the next raw character is at line start. Text mode retains only a | ||
| # trailing prefix of a reserved literal; citation mode buffers one bounded | ||
| # element body; discard mode drops invalid reserved markup through its close. |
There was a problem hiding this comment.
Could you do a pass on these comments with a GPT or otherwise non-Claude model, asking the agent to remove all new code comments and then restore only those that speak to the "why" rather than the "what" with clear, concise language? I find Claude code comments to be quite hard to read and often much longer than they need to be.
There was a problem hiding this comment.
Relatedly, if you could write a couple sentences in the PR description yourself that help me orient to the changes and understand what you're going for, that would be appreciated! These Claude-generated PR descriptions are hard to parse for me
There was a problem hiding this comment.
Removed the scanner implementation narration and audited the other new comments. The remaining comments are concise rationale for cross-layer trust, trace-lineage, and temporary Shinychat contracts. Updated in 8bff158.
| '<small class="text-body-secondary">', | ||
| "Quote matched exactly against trusted context. ", | ||
| "Explanation generated by AI.", | ||
| "</small>" |
|
|
||
| # trajectory_read() attaches one recorded provenance entry per reconstructed | ||
| # exchange. Review rendering consumes that audit record rather than re-deriving | ||
| # trust from message text. |
There was a problem hiding this comment.
Would prefer that these comment-additions-only changes to otherwise unchanged files would be reverted.
There was a problem hiding this comment.
Removed the comment-only additions from trajectory-review.R in 8bff158.
Done in cb33814
Ahh, good catch. For multi-page
Another good catch. |
There was a problem hiding this comment.
Looks great, thanks!
[edit: there had previously been a screenshot here where i said there was still a newline before citations. i was wrong--didn't have the most recent shinychat. that's fixed!]
Otherwise, looks good. I trust you to make changes as needed and merge when the changes are ready!
Co-authored-by: Simon P. Couch <simonpatrickcouch@gmail.com>
|
Cleaned up 6 preview bundle(s) on https://dogfood.team.pct.posit.it: 362412, 362413, 362439, 362440, 362444, 362777 |
|
Cleaned up 6 preview bundle(s) on https://connect.staging.pct.posit.it: 1886, 1896, 1927, 1928, 1932, 1985 |


This PR restores the boundary originally established in #107: Commons is responsible for server-side citation verification and audit records; Shinychat is responsible for client-side citation display and interaction.
Shinychat#326 adds compact asides (i.e., superscripts), letting Commons request and style compact citations through supported display and CSS APIs rather than reconstructing citation UI with custom markup and private selectors.
Behavior
Verification
Citation scanner and trajectory-review tests cover projection and replay. Browser tests cover streamed compact citations, source-aware markers, and popovers.
Closes #123.