Repository navigation
fix(admin): keep form fields dark after a Turbo visit - #533
Merged
Merged
Conversation
Administrate 1.0 bundles the CSS anchor positioning polyfill in its auto-apply form: in every browser it swaps the <link> to Administrate's stylesheet for a blob: copy on load. On the next Turbo visit the head no longer matches, so Turbo appends the original stylesheet after the skin, and rules of equal specificity flip back to Administrate's - text fields get its white background under the skin's light grey text. A full page load never shows it, so the theme looked right until the first click. Telling the polyfill to leave stylesheets alone keeps the head order stable. The one element it positions, the search hint popover, uses the browser's native anchor positioning instead. The unbilled badge and the permanent-delete section carried the light palette inline; they use the skin's tokens now, and the token test reads the admin views too. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
artempartos
added a commit
to Hitin/flow
that referenced
this pull request
Oct 21, 2026
* commit '2ecb0ecb': fix(admin): keep form fields dark after a Turbo visit (AixleHQ#533) feat(overview): rename Total Spend card to Token Cost (AixleHQ#532) fix(admin): preload company session limits on the companies index (AixleHQ#523) fix(board): keep the board settings gear on the toolbar row (AixleHQ#524) feat(capacity): give every AWS Marketplace company at least 3 workers (AixleHQ#531) fix(mcp): refuse token changes while impersonating; error on a token no company accepts (AixleHQ#528) feat(feature-flags): registry, resolver and Feature facade (1/7) (AixleHQ#526)
Merged
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.
Problem
In the admin's dark theme, form fields (reported on Companies → New) render with a white background and the skin's light grey text, so typed values look like placeholders. A full page load looks right; it breaks from the first click onward.
Cause
Administrate 1.0 bundles the CSS anchor positioning polyfill (
vendor/css-anchor-positioning.js) in its auto-apply form. On every load, in every browser, it replaces the<link>toadministrate/application-*.csswith ablob:copy. On the next Turbo visit the incoming head carries the original link, Turbo treats it as a new stylesheet and appends it afteradmin.css. From then on every skin rule whose specificity equals Administrate's loses by source order —:root :where(input…)against[type=text] { background-color: #fff }— while the text color stays the skin's, because Administrate sets none.Head order after one Turbo visit, before the fix:
Fix
window.ANCHOR_POSITIONING_POLYFILL_OPTIONS = { elements: [] }before Administrate's script: the polyfill leaves stylesheets alone, so the head stays in the order the layout writes it. The only element it positions is the search hint popover. It now relies on native anchor positioning, which current Chrome, Safari and Firefox have. I checked it in Chromium: the popover opens anchored under its button.AdminSkinTokensTestalso reads the admin views, so a view that uses an undeclared--app-*token fails it.Verification
test/integration/admin/layout_test.rbpins the opt-out ahead of Administrate's script. It fails without the fix.test/lib/changelog_test.rb, rubocop on the changed files, brakeman. The full suite runs on CI here.🤖 Generated with Claude Code