Repository navigation
Sponsor doc: autosave every edit (UTM suggest, uploads, typing) with visible saving/saved/NOT SAVED status - #502
Merged
alexeygrigorev merged 1 commit intoNov 23, 2026
Conversation
…saving/saved/NOT SAVED status Root cause (t2909u): the Add UTM button only changed the in-page draft; nothing was sent until a manual Save draft click, so reload lost the value (reproduced on main in Chromium: 0 PUTs after the click, reload shows the old ctaUrl). There was no unsaved indicator. - sponsor-doc-autosave.js: debounced (1.2 s) autosave on every input/change, helper edit (preview hook: uploads, bullets, radios, selects) and re-render; the UTM button saves immediately. Autosave updates only the status line, never re-renders the form, so focus is kept. - Visible status: All changes saved / Unsaved, saving automatically / Saving / NOT SAVED (role=alert) + Retry save. 20 s request timeout; 5xx/timeout reported by the request layer, 4xx reported here to /api/client-errors (server ERROR client_check_failed). - Guest time choice keeps its explicit Save time choice step. - beforeunload warns while dirty or in flight; tab hide flushes. - Upload status no longer says 'Save to keep it'. - New modules served to the anonymous sponsor page and listed in the frontend asset manifest; image file reading moved to sponsor-doc-files.js to keep sponsor-docs.js under the 1,000-line limit. - Unit + Playwright regression: UTM click autosaves and survives reload; typing + image upload autosave; forced 500 shows NOT SAVED, is reported, and Retry saves.
alexeygrigorev
force-pushed
the
hub/intake-66d1ea5f014acca06779079b73f592888e6dfed53ca2657dd6e112a7b331e0ee
branch
from
November 23, 2026 12:50
132aacb to
d549207
Compare
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.
Fixes t2909u/t2910u/t2911u (Hub intake e6ec25cc): clicking the UTM suggestion on a sponsor doc never saved.
Root cause (reproduced on main in Playwright/Chromium): the Add UTM button only changed the in-page draft. Nothing was sent until a manual Save draft click (0 PUTs after the click), and reload showed the old ctaUrl. There was no unsaved indicator.
Fix: autosave
client_check_failed), 4xx are now reported too.Tests
backend/e2e/sponsor-doc-utm-save.spec.js: UTM click → autosaved → reload shows utm_source; typing + image upload autosave and survive reload; forced 500 → NOT SAVED alert + client error report → Retry → saved → reload.