feat(control-plane): badge documents an in-flight retain op is updating - #3102
Merged
Conversation
Cross-check the documents table against pending/processing retain operations: when an in-flight op targets a document already in the list, that document is being rewritten — badge its row as 'Updating' (with a spinner) and poll until the op finishes, then refresh its content. Operations already expose document_id, but only file uploads populated it. Populate result_metadata.document_id for single-document retains too (engine: BatchRetainParent/ChildMetadata + submit_async_retain), so reprocesses and single-document async retains surface their target. Multi-document batches leave it unset (matched per single-document child) to avoid misattributing a row. No API response-shape change, so no client/OpenAPI regen. Adds 'documentUpdating' to all 10 locales and two engine regression tests.
The badge previously only appeared once an in-flight op was already detected, and detection only ran on load / bank-switch / upload-refresh — so from an idle table you had to catch the moment or reload. Run the (light) operations check on every poll tick while the view is open; keep the heavier document refresh gated to when something is actually in flight. Also kick detection right after a reprocess so its badge shows immediately.
…s table Badge: drop the spinning icon for a gentle pulsing dot on a soft neutral (muted) pill instead of the loud saturated-blue spinner. Table: auto-refresh on a timer (every 8s idle, 4s while something is in flight) so new/updated documents, counts, and badges appear without a manual reload — not only while an op is already detected in flight.
Stamp the wall-clock time on each list refresh and render it beside the count
('N total documents · Refreshed 14:41:32') so the auto-refresh is visible. Adds
'lastRefreshed' to all 10 locales.
Show the refresh time as a live relative label ('Refreshed 3 seconds ago') that
ticks every second — a self-contained component with its own 1s ticker so only
the label re-renders, localized via Intl.RelativeTimeFormat (no per-unit i18n
keys). Baseline-align the count row so the smaller label lines up with the
count text.
6 tasks
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.
What
Show in the Documents table which documents are being rewritten by an in-flight retain operation, and keep the table live.
document_idhas a pending/processing retain op (a soft pill with a gently pulsing dot).Refreshed 3 seconds ago, localized viaIntl.RelativeTimeFormat) so you can see the auto-refresh working.How
Operations already expose
document_id, but only file ops populated it — plain retains/reprocesses left itnullwhile pending. The engine now stampsresult_metadata.document_idfor single-document retains (submit_async_retain, via newdocument_idfields onBatchRetainParent/ChildMetadata), so reprocesses and single-document async retains surface their target. Multi-document batches leave it unset (matched per single-document child) so no row is misattributed.No endpoint/response-shape change (the
document_idfield already existed on the operations list) → no OpenAPI/client regen. No new migration (extra content inside the existingresult_metadataJSON).Tests
document_id; a multi-document batch does not misattribute one.documentUpdating+lastRefreshedadded to all 10 locales (message-parity tests pass).Verified
lint.sh,tsc, eslint, message-parity tests all pass.batch_retain/retainops report thedocument_id, whileconsolidation/refresh_mental_modelcorrectly staynull.