Skip to content

fix(Theme): keep shared injected CSS until the last Theme instance unmounts - #1

Merged
thecodebasedot merged 12 commits into
mainfrom
ccr-53090a73-sd4z53
Oct 27, 2026
Merged

thecodebasedot merged 12 commits into
mainfrom
ccr-53090a73-sd4z53

Conversation

@thecodebasedot

@thecodebasedot thecodebasedot commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Runtime style injection was owned by whichever Theme instance ran its
insertion effect first, and every later instance of the same theme
skipped with no cleanup. Unmounting that owner, typically a nested
Theme wrapping a dialog, removed the document-wide <style> tags while
other Theme instances still relied on them. Track a per-theme mount
count and release the CSS only when it reaches zero.

claude added 12 commits October 27, 2026 08:20
…mounts

Runtime style injection was owned by whichever Theme instance ran its
insertion effect first, and every later instance of the same theme
skipped with no cleanup. Unmounting that owner, typically a nested
Theme wrapping a dialog, removed the document-wide <style> tags while
other Theme instances still relied on them. Track a per-theme mount
count and release the CSS only when it reaches zero.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YEUUZbBab9KaX34tjjQ1Go
ArrowUp/ArrowDown committed a stepped time and announced it, but never
cleared pendingInput, so the box kept showing the pre-step text. On
blur that stale draft was re-parsed and committed over the step,
undoing it. Clear the draft when the step commits.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YEUUZbBab9KaX34tjjQ1Go
Controlled focus requires both focusDate and onFocusDateChange, and the
imperative navigateTo handle honored that. The Prev/Next buttons and
keyboard month crossing in Calendar, and navigateMonth in
useCalendarNavigation, branched on the callback alone, so a
listener-only calendar reported the new month but never moved. Always
fire the callback and update internal state unless focus is controlled.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YEUUZbBab9KaX34tjjQ1Go
scheduleShow already returned early when isOpen === false, but
handleFocusIn opened the card unconditionally, so keyboard focus on
the trigger overrode a controlled closed state and fired
onOpenChange(true). Apply the same guard on the focus path.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YEUUZbBab9KaX34tjjQ1Go
…he timer

Hover, focus-within, window blur and a held gesture all shared a single
isPausedRef boolean. pauseTimer was a no-op when already paused and
resumeTimer unconditionally restarted the countdown, so mouse-leave
while focus was still inside (or vice versa) resumed the timer and the
toast auto-dismissed under the focused user. Track a pause count and
restart only when it drops to zero; isTimerPaused reads the count.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YEUUZbBab9KaX34tjjQ1Go
The explicit-domain branch in computeLayout ran before the numeric-x
check, so a categorical chart given xDomain got a linear scale over
string categories: bar.resolve returned nothing and line/area/dot
x positions were NaN. Apply xDomain only when x is numeric or data is
empty, matching the documented contract.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YEUUZbBab9KaX34tjjQ1Go
An inline region literal is a new object every render, so the effect
re-ran, re-fetched and re-sampled the image, then set state and
rendered again, in an unbounded loop. Read the region's x, y, width
and height into the dependency array instead.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YEUUZbBab9KaX34tjjQ1Go
satisfiesComparator ignored how many parts a caret target carried, so
^0 and ^0.0 fell through to the 0.0.x patch lock. A hyphen range was
tokenized into two exact comparators that could never both hold.
Widen a partial caret to the parts given and rewrite A - B as
>=A <=B before tokenizing.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YEUUZbBab9KaX34tjjQ1Go
rewriteImports keeps the deep path for cross-directory .stylex
imports, but Layer/layerStructureReset.stylex and
DropdownMenu/menuBottomSheet.stylex were missing from the exports
map, so a swizzled Dialog, Drawer, BottomSheet, Lightbox, MobileNav,
Toast or ContextMenu could not resolve its imports. Add both to
STATIC_EXPORTS and regenerate; widen the swizzle resolution test from
Button to every component directory.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YEUUZbBab9KaX34tjjQ1Go
listComponents excluded just hooks, theme and utils, so __tests__,
gestures, i18n and motion were advertised and accepted as swizzle
targets. Exclude the shared infrastructure directories and require a
capitalized component name.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YEUUZbBab9KaX34tjjQ1Go
getByLabelText returns HTMLElement, so reading .value failed the
package typecheck; use the matcher the rest of the file uses.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YEUUZbBab9KaX34tjjQ1Go
The copy read only the regular files directly in the component
directory and skipped every subdirectory, so Markdown, Table, Dialog
and others came out with dangling ./plugins, ./modules or ./hooks
imports. Walk the component recursively (skipping __tests__ and
__snapshots__), create nested output directories and roll them back on
a failed copy, and give rewriteImports the file's depth so imports that
stay inside the component remain relative while escaping ones are still
mapped to the owner package.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YEUUZbBab9KaX34tjjQ1Go
@thecodebasedot
thecodebasedot merged commit 1a54a4b into main Oct 27, 2026
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