Repository navigation
Redis Client: guard against new classes the host may not carry - #25
Conversation
#20 fixed four classes that had no rule in the host's compiled stylesheet. Nothing stops the next one: this plugin ships no CSS and is styled by the host's sheet, which never scans this repo, so any class written only here resolves purely by coincidence. Adds ui/hostCssClasses.test.ts — the same guard container-manager has — run by npm test. It gates arbitrary-value sizing and layout classes, which is the half no host-side safelist can ever cover. The allowlist holds the five this plugin already uses. They resolve today only because the host carries externalPluginClassnamesSafelist.ts, a snapshot taken once when these tools left that repo, whose own comment says it has "no automated re-sync" — so an entry there is a dependency on a file nobody regenerates, not a guarantee. Four of the five (w-[5px], w-[3px], left-[2px], left-[1px]) also appear behind group-hover: variants on the resize handle, which an inline style cannot express; the list is documented as not meant to grow. Verified: typecheck clean, 37 tests pass, build clean, and scripts/check-host-classes.mjs clean against a build of the currently released host. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Nz2ELEkkMQzn6N429NkFy
ff64b2f to
fae5315
Compare
|
The earlier red run on this branch was my mistake, now fixed and force-pushed. What happened: the first commit carried two files that do not belong to this plugin — Why I did not catch it: I verified with The branch now contains only Generated by Claude Code |
Follow-up to #20, which fixed four classes but left nothing stopping the next one.
Why this is needed
This plugin ships no CSS and is styled entirely by the host's compiled Tailwind sheet, which never scans this repo. A class written only here resolves purely by coincidence.
Only container-manager had the offline guard. This adds it here.
What I found while writing it
The host has carried a safelist all along:
src/styles/externalPluginClassnamesSafelist.ts— a snapshot of plugin class names extracted once when these tools left that repo, kept purely as scannable text so Tailwind emits them.It is not broken. It is stale, exactly as its own comment predicted:
Plugin code moved on after that extraction and nothing re-synced it. That is precisely why
min-h-16,mx-5andalign-tophad no rule, whilemax-w-[9rem]andgrid-cols-[3rem_minmax(0,1fr)_6.5rem_5.5rem]— both in the snapshot — did. The apparent arbitrariness of which classes survived has a cause: a date.This change
ui/hostCssClasses.test.ts, run bynpm test. Gates arbitrary-value sizing and layout classes — the half no host-side safelist can ever enumerate.The allowlist holds the five this plugin already uses:
Four of them also appear behind
group-hover:variants on the resize handle, which an inline style cannot express. Each is documented as a dependency on a file nobody regenerates — not a guarantee — and the list is marked as not meant to grow.Verification
npm run typecheck— cleannpx vitest run— 37 tests passnpm run build— bundle buildsscripts/check-host-classes.mjsclean against a build of the currently released host🤖 Generated with Claude Code
https://claude.ai/code/session_017Nz2ELEkkMQzn6N429NkFy
Generated by Claude Code