Skip to content

Size the citation chip icon from the font's point size - #3

Open
curusarn wants to merge 6 commits into
mainfrom
chip-icon-size
Open

Size the citation chip icon from the font's point size#3
curusarn wants to merge 6 commits into
mainfrom
chip-icon-size

Conversation

@curusarn

Copy link
Copy Markdown

Claude summary

Brief

  • A citation chip's icon is drawn at 1.15x the chip font's point size (16pt at 13.5pt), still capped by the label's line height, instead of the font's cap height. The cap-height box left the icon at about half the label's height once the glyph's own padding inside its viewbox was subtracted; web draws a text-size icon beside a chip label.

Implementation changes

  • InlineCitationAttachment.iconScale is the one knob; the layout math is unchanged otherwise.
  • Branched from 03d74ae (the revision the iOS app pins) so the app can pin this commit directly; it also applies cleanly on main.
  • Consumer: BetterStackHQ/ios-app#290 (U-9330 item 11, Simon's device feedback).

🤖 Generated with Claude Code

https://claude.ai/code/session_01PjDUZsPjzUx6tcSvCe1cr2

gyfis and others added 6 commits August 19, 2026 20:31
Better Stack patches on top of 21893c1: three additive config seams the iOS
app needs for web-parity chat rendering. Defaults preserve upstream behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jApPFeZUN7G2g2kWJC4Ur
CitationConfig gains citationImage, an optional (destination) -> MDImage?
closure resolved once per attachment and composited ahead of the title,
sized to the chip font's cap height and tinted to match the resolved text
color in each appearance. Ignored by CitationConfig's Hashable/Equatable
(a function value can't be compared), same treatment TextContextMenuItem
already gives its own image field. Default nil keeps every existing call
site source-compatible.
Citation chips visibly ride high on their line when taller than the
line box — the existing font.descender baselineOffset only accounts
for the glyph descender space, not a chip's own extra height. Add
CitationConfig.citationBaselineAdjustment (points, default 0) applied
additively to the existing offset in both call sites (Paragraph+'s
buildParagraphContent and TableView's applyTypographyThemingAndGetContent).

Default 0 keeps today's behavior byte-identical; hosts opt in per
render config to pull a chip back toward the line's vertical center.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…default off)

The table tap-to-expand and its copy/download buttons were shown whenever a
MarkdownController was attached — which hosts do for context-menu routing, so
they couldn't get the menu without the table chrome. Gate both behind a new
MarkdownTableTextStyle.showsActionButtons (default false); attaching a listener
no longer implies table buttons.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FdgmrPkDKRvT6uu4JzNdNg
[Fable] Table copy/download controls are opt-in (default off)
…eight

A cap-height box left the icon at about half the label's height once the
glyph's own padding inside its viewbox was subtracted; web draws a
text-size icon beside the label. 1.15x the point size (16pt at 13.5pt),
still capped by the text's line height.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PjDUZsPjzUx6tcSvCe1cr2
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