Skip to content

Make block card/file embed refs use the legible inline highlight#5532

Open
FadhlanR wants to merge 1 commit into
mainfrom
cs-11750-readability-of-compose-mode-cardfile-embed-synatx
Open

Make block card/file embed refs use the legible inline highlight#5532
FadhlanR wants to merge 1 commit into
mainfrom
cs-11750-readability-of-compose-mode-cardfile-embed-synatx

Conversation

@FadhlanR

@FadhlanR FadhlanR commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Problem

In the compose-mode markdown editor (RichMarkdownField → CodeMirror), a block card/file embed reference (::card[...] / ::file[...]) was highlighted with a teal background and taller padding, making the grey syntax text illegible. The inline reference (:card[...]) already used a legible light-grey highlight.

Per design feedback on CS-11750, both inline and block references should use the same light-grey treatment.

Root cause

Block refs always received an extra cm-bfm-card-ref--active class, whose CSS painted background-color: var(--boxel-highlight-hover) — which resolves to the teal --boxel-dark-teal (#00da9f). They also carried cm-bfm-card-ref--block, adding display: inline-block + extra vertical padding (the taller pill). Inline refs never got either.

Fix

  • In buildCardDecorations (packages/host/app/lib/codemirror-context.ts), the two block-ref branches now emit the same cm-bfm-card-ref cm-bfm-card-ref--inline class the inline branches use.
  • Removed the now-unused .cm-bfm-card-ref--block and .cm-bfm-card-ref--active CSS rules from packages/base/codemirror-editor.gts.

Purely a highlight/CSS change — no parsing, widget, or toolbar behavior is affected. The block preview widget (rendered below the cursor line) uses separate cm-card-widget--block classes and is unchanged.

Testing

  • pnpm lint:types in packages/host — no new type errors from this change.
  • Visual: open RichMarkdownPlayground in compose mode; with the cursor on a ::card[...] line the block ref now shows grey text on a light-grey highlight matching the inline :card[...], with no teal.

Screen Recording

Screen.Recording.2026-07-17.at.14.21.16.mov

🤖 Generated with Claude Code

In compose mode, block refs (::card[...] / ::file[...]) were highlighted
with a teal background (--boxel-highlight-hover) and taller padding, making
the grey syntax text illegible. Inline refs (:card[...]) already used a
legible light-grey highlight. Consolidate both to the inline treatment by
dropping the --block/--active classes and their now-unused CSS rules.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Preview deployments

Host Test Results

    1 files      1 suites   3h 7m 27s ⏱️
3 541 tests 3 526 ✅ 15 💤 0 ❌
3 560 runs  3 545 ✅ 15 💤 0 ❌

Results for commit a053d66.

Realm Server Test Results

    1 files      1 suites   16m 26s ⏱️
1 875 tests 1 875 ✅ 0 💤 0 ❌
1 954 runs  1 954 ✅ 0 💤 0 ❌

Results for commit a053d66.

@FadhlanR
FadhlanR marked this pull request as ready for review July 17, 2026 07:22
@FadhlanR
FadhlanR requested a review from a team July 17, 2026 07:23
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