Skip to content

fix(admin): remove sticky editor header - #955

Merged
ascorbic merged 4 commits into
mainfrom
fix/admin-sticky-header
May 8, 2026
Merged

ascorbic merged 4 commits into
mainfrom
fix/admin-sticky-header

Conversation

@ascorbic

@ascorbic ascorbic commented May 8, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Removes the sticky editor header from ContentEditor, ContentTypeEditor, SectionEditor, and the settings sub-pages. The sticky implementation had multiple compounding problems:

  1. Transparency artifacts -- bg-kumo-base/95 supports-[backdrop-filter]:bg-kumo-base/80 backdrop-blur let scrolled content show through. Looked particularly bad when columns scrolled at different rates (e.g. ContentTypeEditor's settings column scrolling while the fields column appeared static behind the blurred header).
  2. Layout fragility -- the -mx-6 -mt-6 trick canceling parent padding to make the header span edge-to-edge broke whenever an ancestor's padding changed.
  3. Z-index conflicts with the app bar header above (header had z-10, sticky had z-30, but the surrounding scroll context made it inconsistent).
  4. ~85px of permanent vertical chrome on every editor page — paid on every page load, only useful on long forms when scrolled.

The save action remains reachable via the form's bottom Save button (rendered after all fields, the natural keyboard tab order target) and the standard Cmd+S shortcut, so the sticky behavior wasn't earning its visual cost.

Changes

  • EditorHeader.tsx: drops the sticky prop entirely. Renders as a normal block. Component API still accepts leading / actions / children.
  • ContentEditor.tsx: removes the inline sticky/backdrop classes from its custom header. Preserves the distraction-free mode hover-revealed overlay — different use case (keeping chrome out of the way while writing rich text).
  • EditorHeader.test.tsx: drops the two assertions about sticky classes; the rest of the test file (rendering, leading slot, actions slot, no-actions case) is unchanged.

Visual verification

Captured before/after screenshots:

  • Content type editor (was: faded header overlapping fields panel; now: clean header at top of page)
  • Content editor (Edit Post — was: same blur issue; now: clean)
  • General settings (was: sticky chrome; now: regular header)
  • Scrolled state on each: header scrolls away naturally, no more overlap or transparency

Tests: 859/859 passing.

Closes #

Type of change

  • Bug fix
  • Feature
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore

Checklist

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: Claude Opus 4.7 (OpenCode)

The sticky save header had multiple compounding problems:
- Backdrop-blur transparency let scrolled content show through, looking
  visually broken when columns scrolled at different rates
- Fragile negative-margin trick (-mx-6 -mt-6) had to perfectly cancel
  parent padding; broke when ancestors changed
- z-index conflicts with the app bar header above
- ~85px of permanent vertical chrome on every editor page

The save action is already reachable via the form's bottom Save button
and the standard Cmd+S keyboard shortcut, so the sticky variant wasn't
earning its cost. Drop it across ContentEditor, ContentTypeEditor,
SectionEditor, and the settings sub-pages. Preserve the
distraction-free mode hover-revealed overlay in ContentEditor (different
use case: keep chrome out of the way while writing).

Drops the EditorHeader `sticky` prop entirely. Updates the test to
remove the now-irrelevant sticky-class assertions.
Copilot AI review requested due to automatic review settings May 8, 2026 15:02
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 8, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-playground 92b069c May 08 2026, 04:15 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 8, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
docs 92b069c May 08 2026, 04:14 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 8, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-cache 92b069c May 08 2026, 04:15 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 8, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-perf-coordinator 92b069c May 08 2026, 04:13 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 8, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-i18n 92b069c May 08 2026, 04:14 PM

@changeset-bot

changeset-bot Bot commented May 8, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 92b069c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@emdash-cms/admin Patch
emdash Patch
@emdash-cms/cloudflare Patch
@emdash-cms/fixture-perf-site Patch
@emdash-cms/perf-demo-site Patch
@emdash-cms/cache-demo-site Patch
@emdash-cms/auth Patch
@emdash-cms/blocks Patch
@emdash-cms/gutenberg-to-portable-text Patch
@emdash-cms/x402 Patch
create-emdash Patch
@emdash-cms/auth-atproto Patch
@emdash-cms/plugin-embeds Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented May 8, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@955

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@955

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@955

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@955

emdash

npm i https://pkg.pr.new/emdash@955

create-emdash

npm i https://pkg.pr.new/create-emdash@955

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@955

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@955

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@955

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@955

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@955

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@955

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@955

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@955

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@955

commit: 92b069c

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the “sticky” editor header pattern across the admin editor surfaces by making EditorHeader render as a normal (non-sticky) block and stripping sticky/backdrop styling from the content editor’s header (while keeping the distraction-free hover overlay behavior).

Changes:

  • Remove the sticky prop and all sticky/backdrop/negative-margin styling from EditorHeader.
  • Make ContentEditor’s normal-mode header non-sticky (distraction-free overlay remains).
  • Update EditorHeader tests to drop sticky-class assertions and add a changeset documenting the behavior change.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/admin/tests/components/EditorHeader.test.tsx Removes assertions tied to sticky header behavior that no longer exists.
packages/admin/src/components/EditorHeader.tsx Drops sticky prop and sticky/backdrop styling; updates component-level documentation accordingly.
packages/admin/src/components/ContentEditor.tsx Removes sticky/backdrop classes from the content editor header in normal mode; keeps distraction-free overlay header.
.changeset/sixty-wombats-itch.md Adds a patch changeset describing the removal of sticky editor headers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .changeset/sixty-wombats-itch.md Resolved
ascorbic added 3 commits May 8, 2026 16:43
Address PR review feedback (#955): the previous commit claimed save was
'always reachable via in-form Save button + Cmd+S' but neither was true
for ContentEditor or SectionEditor (header was the only Save button, no
Cmd+S handler exists).

- ContentEditor: add a bottom-of-form SaveButton (mirrors the header
  state, last interactive control in DOM order)
- SectionEditor: add a bottom-of-form SaveButton (after the content
  editor, before the sidebar)
- Update doc comments and changeset to describe what's actually true
  (bottom save button per editor; no Cmd+S claim)
- Update ContentEditor.test.tsx queries to use .first() since there are
  now two Save buttons matching the same role/name (both submit the
  same form, so either works for the assertion)
The previous commit put the Save button at the absolute bottom of the
form -- after both the main editing column AND the entire sidebar
(Publish/Status/Taxonomies/SEO/Outline/Revisions). Visual testing
showed users had to scroll past the whole sidebar to reach it; way too
hidden to be discoverable.

Move the bottom SaveButton inside the main column (lg:col-span-2 in
ContentEditor, col-span-8 in SectionEditor) so it appears right after
the body field, where users naturally land when they finish editing.

SectionEditor was already correct -- just the ContentEditor placement
was wrong.
…e two

Editor pages now render two SaveButtons (one in the header, one at the
bottom of the main column). Both submit the same form, so playwright's
strict-mode click can target either, but the unscoped queries
('button:has-text("Save")', 'getByRole("button", { name: "Save" })')
match both elements and fail.

- e2e/fixtures/admin.ts: clickSave() and waitForSaveComplete() now use
  .first() on the Save / Saved button locators.
- e2e/tests/form-data-loss.spec.ts: 3 inline Save queries updated to
  .first().

Other E2E save references are either dialog-scoped (redirects), text
'Save Changes' instead of 'Save' (content-types), or on bylines panel
which has only one save button -- those are unaffected.
@ascorbic
ascorbic merged commit 49b66d9 into main May 8, 2026
36 checks passed
@ascorbic
ascorbic deleted the fix/admin-sticky-header branch May 8, 2026 16:27
@emdashbot emdashbot Bot mentioned this pull request May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants