fix(admin): debounce SEO sidebar saves#87
Conversation
|
i noticed a few issues:
|
|
matt could u commit those?
changeset @ascorbic is there any other way I can suggest changes to the code besides commenting on them in PRs? |
|
Thanks to Nick Gray for sponsoring my time on this review |
🦋 Changeset detectedLatest commit: 4938e3d The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
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 |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/blocks
@emdash-cms/cloudflare
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
70349fc to
76fecae
Compare
|
Pushed a follow-up on top of current main: addressed the SEO panel review notes, added the changeset, updated the PR body to the template, and reran targeted validation for SeoPanel plus admin typecheck and lint:quick. |
7f32ed5 to
0d5208c
Compare
|
Latest follow-up commit: txhno@0d5208c . This is the current PR head after rewriting the format-only change into a normal commit. |
There was a problem hiding this comment.
Pull request overview
This PR updates the admin content editor’s SEO sidebar behavior to avoid firing a content update request on every keystroke, while also preventing older save responses from clobbering newer locally-typed values.
Changes:
- Debounce SEO text field (
title,description,canonical) saves while keepingnoIndexupdates immediate. - Add local draft + snapshot syncing logic to avoid overwriting newer local edits when stale props arrive.
- Add browser tests covering debouncing, immediate
noIndex, stale-props protection, and reset on content switch.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
packages/admin/src/components/SeoPanel.tsx |
Introduces debounced draft-based editing + stale-props guards; adds contentKey reset behavior. |
packages/admin/src/components/ContentEditor.tsx |
Passes contentKey into SeoPanel and routes SEO changes through a callback. |
packages/admin/tests/components/SeoPanel.test.tsx |
Adds new test coverage for debounced saves and stale response protection. |
.changeset/fair-donkeys-ring.md |
Adds a changeset entry describing the behavior change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@txhno I'd love to get this in. Can you address the review comments so I can merge it? |
0064081 to
8e21e69
Compare
|
All contributors have signed the CLA ✍️ ✅ |
|
Follow-up on the remaining review threads:
Validation rerun: |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
recheck |
|
@ascorbic the follow-up changes are in now: the remaining review comments have been addressed, the review threads are resolved, the CLA is passing, and the checks are green. This should be good to merge. |
b44810d to
4938e3d
Compare
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-playground | 4938e3d | Apr 13 2026, 07:36 PM |
* fix(admin): flush pending seo sidebar saves * style: format * fix(admin): flush pending seo sidebar saves * test(admin): use non-deprecated vitest browser import * style: format * fix(admin): tighten seo panel follow-up * style: format --------- Co-authored-by: emdashbot[bot] <emdashbot[bot]@users.noreply.github.com>
What does this PR do?
Closes #78
Debounces SEO sidebar text-field saves in the admin sidebar instead of issuing a PUT on every keystroke, keeps stale save responses from overwriting newer local typing, and preserves immediate
noIndexupdates.Type of change
Checklist
pnpm typecheckpassespnpm --silent lint:json | jq '.diagnostics | length'returns 0pnpm testpasses (or targeted tests for my change)pnpm formathas been runAI-generated code disclosure
Screenshots / test output
npx pnpm@10.28.0 --filter @emdash-cms/admin exec vitest run tests/components/SeoPanel.test.tsxnpx pnpm@10.28.0 --filter @emdash-cms/admin typechecknpx pnpm@10.28.0 --silent lint:quick