refactor(admin): edge config card grid and plain-language dialog copy - #2406
Merged
Conversation
Contributor
|
Capy auto-review is paused for this organization because the usage-cycle auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews. |
Comment on lines
+383
to
+390
| deriveStatus: (data) => { | ||
| const entries = Object.values(asRecord(asRecord(data).queues)); | ||
| const paused = entries.filter( | ||
| (entry) => asRecord(entry).enabled === false, | ||
| ).length; | ||
|
|
||
| return paused === 0 | ||
| ? { label: "All active", tone: "neutral" } |
Contributor
There was a problem hiding this comment.
Queue defaults produce false status
When the sparse job-queue config omits the default-disabled Customer Creation Recovery Queue, this code counts only explicitly stored entries and reports “All active,” causing the overview to hide a queue that is paused at runtime.
Prompt To Fix With AI
This is a comment left during a code review.
Path: vite/src/views/admin/components/edgeConfigCards.ts
Line: 383-390
Comment:
**Queue defaults produce false status**
When the sparse job-queue config omits the default-disabled Customer Creation Recovery Queue, this code counts only explicitly stored entries and reports “All active,” causing the overview to hide a queue that is paused at runtime.
How can I resolve this? If you propose a fix, please make it concise.
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.
Reworks the admin Edge Config UI. No functional changes — every endpoint, payload key, validation rule and min/max bound is byte-identical to
dev(verified: 21 admin endpoints before, 21 after, identical set).Why
The Edge Config tab was 14 undifferentiated rows of identical visual weight, and dialog help text read as engineering notes rather than operator instructions. You couldn't tell a queue was paused or a ramp was at 40% without opening every dialog.
What changed
Sectioned card grid. Both Edge Config and Queue/Cron now render a card grid grouped into sections (Access Control, Cache & Redis, Rollouts & Flags, Integrations). Each card shows a live status line derived from its own config endpoint —
2 orgs blocked,40% ramped,1 queue paused— so state is visible without opening anything. Card definitions live in one registry keyed by config id, so regrouping is a data edit.Plain-language copy. Every field description rewritten to one short sentence. Representative:
Cross-cutting caveats (the ÷ fleet-count rule) are now stated once in the dialog footer instead of repeated per field.
Fixed 5 factually wrong propagation claims. Several dialogs told operators the wrong refresh interval. Each is now checked against its store's actual
pollIntervalMs:Org Limits (30s) and Stripe Sync (60s) have custom intervals; everything else uses the 10s default. These were pre-existing bugs.
Consistency (
/charlie). ExtractedEdgeConfigDialogBodyfor the loading/error/retry states — removes 9 duplicated copies, including 3 nested ternaries. Migrated 4 dialogs fromuseEffect+axios to TanStack Query, each split into Dialog/Form/types per the existingResetJobV2Config*pattern. Replaced hand-rolled toggles and a bespokerole="switch"div with shadcnSwitch; swapped hardcodedbg-amber-50/emeraldbadges (which broke in dark mode) for theme-aware primitives; addedaria-labels to previously unlabelled inputs.Safety-relevant copy. Job Queues now states that paused work backs up rather than being dropped. Raw JSON editing spells out that it overwrites the file for every org, and surfaces the real parser error (
Unexpected token } at position 214) instead of a bare "Invalid JSON".Verification
bun tsclean, Biome clean on all 46 filesorigin/dev— identicalJSON.parse(jsonText), the text buffer, not form state)Notes for review
useState/useEffectstate. Their PUT body is the JSON text buffer, so converting risks changing what's written to S3. Copy and consistency fixes applied; restructure left for a follow-up.rateLimitRedisAllowlistDialogState.tsare now unused in prod (the stale-data invariant they guarded is enforced structurally byEdgeConfigDialogBody), but ~5 tests still cover them. Deleting them drops regression coverage for a real past bug — left as a deliberate follow-up decision.packages/uiAlerthas nowarningvariant (several dialogs want one), and per-queue descriptions are server-owned inKNOWN_JOB_QUEUES.Summary by cubic
Refactored the admin Edge Config and Queue/Cron tabs into a sectioned card grid with live status and clearer, plain‑language dialogs. No backend changes — endpoints, payloads, validation, and bounds are unchanged.
Refactors
EdgeConfigDialogBodyfor shared load/error/retry UI; migrated several dialogs to@tanstack/react-queryand split them into Dialog/Form/types for consistency.@autumn/uicomponents (e.g.,Switch) and added ARIA labels for inputs; dark-mode friendly.Bug Fixes
pollIntervalMs(Org Limits 30s; Stripe Sync 60s; others 10s).Written for commit 2c1e44d. Summary will update on new commits.
Greptile Summary
Refactors the admin Edge Config interface and operator-facing copy without changing its API surface.
Confidence Score: 4/5
The incorrect Job Queues status should be fixed before merging because the new overview can claim every queue is active while a default-disabled queue remains paused.
The status registry derives queue state from only explicitly persisted entries, whereas runtime behavior applies server-owned defaults to omitted queues, producing a false operational summary in the default configuration.
vite/src/views/admin/components/edgeConfigCards.ts
Important Files Changed
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "refactor(admin): plain-language copy and..." | Re-trigger Greptile