Skip to content

Redis Client: restore layout the host stylesheet never carried - #20

Merged
DianaSensei merged 1 commit into
app/redis-client/mainfrom
claude/miniapp-css-audit-redis-client
Sep 22, 2026
Merged

DianaSensei merged 1 commit into
app/redis-client/mainfrom
claude/miniapp-css-audit-redis-client

Conversation

@DianaSensei

Copy link
Copy Markdown
Owner

Found while fixing the Container Manager log dialog (#19) — the same cause reaches every plugin, so all four were audited.

Root cause

A plugin bundle ships no CSS. scripts/makePluginConfig.mjs builds one ESM file and emits nothing else; the UI is styled entirely by the host app's compiled Tailwind sheet, which is generated by scanning the host's src/**. This repo is never scanned — the plugin is fetched at runtime from a URL.

So a class written only here has a rule only if some host file happens to spell it identically. Otherwise it renders as nothing at all.

What was broken

Class What broke
grid-cols-[minmax(0,1fr)_minmax(0,1.4fr)] The INFO panel's two-column key/value layout collapsed to one auto column
min-h-16 The stream-entry editor had no minimum height and collapsed to a single row
mx-5 The selection bar ran flush to both pane edges
align-top Stream fields centred against a multi-line cell instead of aligning with the ID beside them

The fix

Each becomes an inline style, which no build step can drop, and which works on whatever host the user already has — a plugin installs into an existing host, not a future one.

Adds scripts/check-host-classes.mjs, which resolves every class this plugin writes against a real host stylesheet, and a "Styling" section in README.md.

Verification

  • npm run typecheck — clean
  • npx vitest run — 28 tests pass
  • npm run build — bundle builds
  • scripts/check-host-classes.mjs clean against builds of both the currently released host and the host with the new safelist

Related

DianaSensei/developer-desktop-utils#165 adds a plugin-facing safelist host-side. That only helps hosts built from here on, which is why this PR fixes the classes directly. Arbitrary values like the grid template above can never be safelisted at all.

Not verified here: opening the app to look at the views by eye.

🤖 Generated with Claude Code

https://claude.ai/code/session_017Nz2ELEkkMQzn6N429NkFy


Generated by Claude Code

A plugin bundle ships no CSS — it is styled entirely by the host app's
compiled Tailwind sheet, which Tailwind generates by scanning the HOST's
src/**. This repo is never scanned (the plugin is fetched at runtime from a
URL), so a class written only here has a rule only if some host file happens
to spell it identically. Four did not:

- min-h-16 on the stream-entry editor: no minimum height, so the field
  collapsed to a single row.
- mx-5 on the selection bar: ran flush to both pane edges.
- align-top on stream rows: fields centred against a multi-line cell instead
  of aligning with the ID beside them.
- grid-cols-[minmax(0,1fr)_minmax(0,1.4fr)] in the INFO panel: the two-column
  key/value layout collapsed to one auto column.

Each becomes an inline style, which no build step can drop. Adds
scripts/check-host-classes.mjs, which resolves every class this plugin writes
against a real host stylesheet; verified clean against a build of the
currently released host, since a plugin installs into whatever host the user
already has.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Nz2ELEkkMQzn6N429NkFy
@DianaSensei
DianaSensei merged commit 59f50dd into app/redis-client/main Sep 22, 2026
4 checks passed
@DianaSensei
DianaSensei deleted the claude/miniapp-css-audit-redis-client branch September 22, 2026 08:02
DianaSensei added a commit that referenced this pull request Sep 22, 2026
#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
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.

1 participant