Skip to content

feat(docs[_ext]): Add {toolicon} role variants — icon-only tool refs#4

Draft
tony wants to merge 7 commits intomainfrom
toolicon
Draft

feat(docs[_ext]): Add {toolicon} role variants — icon-only tool refs#4
tony wants to merge 7 commits intomainfrom
toolicon

Conversation

@tony
Copy link
Copy Markdown
Member

@tony tony commented Mar 28, 2026

Summary

Add {toolicon} role family for icon-only tool cross-references — bare emoji glyphs that act as lightweight semantic marks without the full badge.

Four placement variants

Role Position Use case
{tooliconl} Icon left, outside code Prose mentions
{tooliconr} Icon right, outside code Suffix semantics
{tooliconil} Icon inline-left, inside code Best default — compact lists, scan-heavy surfaces
{tooliconir} Icon inline-right, inside code Tool name primary, icon secondary

Design

  • No background, no border, no box — bare emoji carries the tier signal
  • Outside variants smaller (0.72rem) than inside (0.78rem) to stay subordinate
  • Asymmetric margins: right-side variants tighter than left-side
  • Bomb emoji (💣) gets special sizing: smaller + lower opacity than 🔍/✏️
  • Demo page at /demo/ shows all variants side by side

WIP

Still iterating on optical refinements. Not ready for merge — keeping as draft for visual review.

Test plan

  • just build-docs — builds without new warnings
  • http://localhost:8024/demo/ — all 4 variants render correctly
  • uv run ruff check . && uv run mypy && uv run pytest -q — all pass

tony added 6 commits March 27, 2026 19:57
why: Exploring a compact badge variant for dense inline prose where
the full {tool} badge is too wide and {toolref} has no visual tier
indicator at all.
what:
- Add {toolicon} role: code-linked tool name with square icon-only
  badge positioned to the left of the <code> element
- Badge is 14x14px square with 3px border-radius, emoji only, no text
- CSS: .sd-badge.icon-only with fixed pixel sizing for crisp rendering
- Added to demo page for visual testing
- WIP: vertical alignment and sizing still being refined
why: Need to test all icon-badge positions to find the best visual fit.
what:
- {tooliconl}: icon left, outside code — [🔍] `capture_pane`
- {tooliconr}: icon right, outside code — `capture_pane` [🔍]
- {tooliconil}: icon inline-left, inside code — `[🔍]capture_pane`
- {tooliconir}: icon inline-right, inside code — `capture_pane[🔍]`
- {toolicon} remains as alias for {tooliconl}
- Factory function _make_toolicon_role creates role variants
- CSS: .icon-only-inline for inside-code variants (tighter margins)
- Demo page shows all 4 variants side by side
why: 14px colored square was too heavy — emoji alone carries the tier
signal. Inline variants had invisible icons (font-size: 0.8em of 0 = 0).
what:
- Remove background, border, fixed dimensions from .sd-badge.icon-only
- Bare emoji with opacity: 0.88, no containment box
- Fix inline ::before to use 0.8rem (absolute) not 0.8em (relative to 0)
- Inline variants use vertical-align: middle
- Tighter margins: 0.2em outside, 0.15em inside code
why: Expert feedback identified outside icons as too heavy, vertical
alignment too aggressive, inside spacing too loose, and bomb emoji
carrying more visual mass than the other glyphs.
what:
- Outside variants: 0.72rem (was 0.85rem), vertical-align -0.06em (was -0.15em)
- Inside variants: 0.78rem, vertical-align -0.01em, margins 0.12em (was 0.15em)
- Right-side variants get tighter gap than left (asymmetric: suffix needs less space)
- Bomb emoji (💣): slightly smaller and lower opacity than 🔍/✏️
- display: block on ::before for consistent line-height clipping
…font-size:0

why: .sd-badge.icon-only has font-size:0 to hide text. Margins in em
units (0.25em, 0.15em) resolved to 0px since em is relative to the
element's own font-size. Discovered via Playwright computed style audit.
what:
- Switch outside variant margins to fixed px (5px right, 4px left)
- Restore colored square box for tooliconl/tooliconr (was bare emoji)
- Keep bare emoji for tooliconil/tooliconir (inside code, no box)
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 28, 2026

Codecov Report

❌ Patch coverage is 15.68627% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.15%. Comparing base (fa2ab1d) to head (572dafb).

Files with missing lines Patch % Lines
docs/_ext/fastmcp_autodoc.py 15.68% 43 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #4      +/-   ##
==========================================
- Coverage   73.01%   71.15%   -1.86%     
==========================================
  Files          20       20              
  Lines        1371     1418      +47     
  Branches      175      186      +11     
==========================================
+ Hits         1001     1009       +8     
- Misses        325      364      +39     
  Partials       45       45              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

why: Verified via Playwright that tooliconl had 5px gap while tooliconr
had 4px. The asymmetry was visually noticeable.
what:
- .sd-badge.icon-only margin-right: 5px → 3px
- tooliconl now 3px, tooliconr remains 4px (close and balanced)
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