[Part 1 of 2] Plugin SDK fixes: dark-mode input surface, ctx.rootFontSize, message-origin fast path - #56
Open
roger-datocms wants to merge 3 commits into
Open
[Part 1 of 2] Plugin SDK fixes: dark-mode input surface, ctx.rootFontSize, message-origin fast path#56roger-datocms wants to merge 3 commits into
roger-datocms wants to merge 3 commits into
Conversation
commit: |
roger-datocms
force-pushed
the
fix/plugin-sdk-issues-54-55-fontsize
branch
from
September 14, 2026 23:14
79f6adb to
75810a1
Compare
…gin fast path - react-ui TextInput/TextareaInput/SelectInput paint on the raised surface token, matching native inputs (dark-mode issue #54). - New ctx.rootFontSize; the runtime mirrors the host root font size onto the plugin so rem-based tokens match the host (community thread 8663). - Read event.origin before Penpal reads event.data so Chrome skips its slow cross-origin deserialization path (issue #55). - Changesets included. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RtS2SCFb7RgPeThjnPVngz
roger-datocms
force-pushed
the
fix/plugin-sdk-issues-54-55-fontsize
branch
from
September 14, 2026 23:45
75810a1 to
b3e97d8
Compare
applyHostAppearance runs on every ctx update (every keystroke in a sibling field). Writing documentElement.style.fontSize unconditionally reflowed the whole rem-based plugin frame each time; only write when the value actually changed, matching applyColorScheme. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RtS2SCFb7RgPeThjnPVngz
roger-datocms
marked this pull request as ready for review
September 15, 2026 23:45
`!(next > 0)` let Infinity through; use Number.isFinite so the guard matches its stated intent (reject non-positive and non-finite values). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RtS2SCFb7RgPeThjnPVngz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes two GitHub issues and one community thread about DatoCMS plugins. SDK side.
1. Dark-mode input surface (issue #54)
react-uiTextInput,TextareaInputandSelectInputnow paint on--color--surface-raised, the token native inputs use. Previously they sat on thepage-background token, so in dark mode they were one shade darker than the
controls around them.
The same token miss affected the search box inside
Dropdownmenus(
.Dropdown__menu__search__input), which sat one shade darker than its ownraised menu panel. Now fixed too:
2.
ctx.rootFontSize(community thread 8663)New base property carrying the host's
<html>font size in px. The runtimemirrors it onto the plugin's
<html>, sorem-based tokens measure the sameinside the frame as in the host. (Host sends it from the
cmsPR.) The runtimealso guards against a non-positive value collapsing the plugin to
0px.3. Message-origin fast path (issue #55)
A capture-phase
messagelistener readsevent.originbefore Penpal readsevent.data. Chrome slows the deserialization of cross-origin messages ≥16 KBwhen
datais read first (MaskDeserializationTimings); readingoriginfirstavoids it. Penpal is unchanged. Live micro-benchmark in Chrome, same 266 KB
message to two cross-origin iframes:
Synthetic test:
More realistic plugin test, before/after
(mean, P95, and max/worst should all improve)
typing-lag-before.mp4
typing-lag-after.mp4
Notes
Tested live against a local dev project. Images are hosted as DatoCMS assets
(no binaries committed to this repo).
🤖 Generated with Claude Code
https://claude.ai/code/session_01RtS2SCFb7RgPeThjnPVngz