Skip to content

feat(admin): a generic job-stage edit view - #972

Merged
sydevs-bot merged 12 commits into
mainfrom
claude/feat-960-job-stage-view
Oct 17, 2026
Merged

sydevs-bot merged 12 commits into
mainfrom
claude/feat-960-job-stage-view

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • A generic Edit view that closes editing while a job owns a document, driven by admin.custom.jobStage.
  • meditation-transcripts is its first consumer. ⚠ That collection is admin.hidden, so the route 404s — see Preview.

Change outline

Contract — what a collection declares

The whole seam. A collection opts in with two declarations and no code; the component names neither collection.

 export const MeditationTranscripts: CollectionConfig = {
   slug: 'meditation-transcripts',
   admin: {
+    components: { views: { edit: { default: { Component: '@/components/admin/JobStageView/JobStageView' } } } },
+    custom: {
+      jobStage: {
+        runningStages: ['processing'],
+        staleAfterMs: TRANSCRIPTION_STALL_MS,
+      } satisfies JobStageConfig,
+    },
     hidden: true,
JobStageConfig                                 src/components/admin/JobStageView/stages.ts
  runningStages: string[]                      # required — the statuses a worker holds
  statusField?:   string                       # dotted path, default `status`
  progressField?: string                       # dotted path; absent is the ordinary case
  totalField?:    string                       # dotted path; the denominator, where a job knows one
  staleAfterMs?:  number                       # how long a stage may stand against `updatedAt`

satisfies is load-bearing: admin.custom is Record<string, any>, so nothing else makes a misspelled key a build error rather than a view that never fires.

Behaviour — which branch the view renders

A custom views.edit.default.Component replaces DefaultEditView, so the settled case has to render it, and Payload gives it the client half of the props alone.

 JobStageView(props)                            src/components/admin/JobStageView/JobStageView.tsx
+  no collectionConfig, or no docID             → DefaultEditView   # the create form; no worker holds it
+  readJobStageConfig(admin.custom) → null      → DefaultEditView   # collection has not opted in
+  jobStageWait(config, props.doc) → null       → DefaultEditView   # stage settled, OR stale past staleAfterMs
+  otherwise                                    → Banner + <CheckAgain>
+    router.refresh()                                         # refetches the server render, past the router cache
+    clientPropsOf(props): PickedClientProps                  # picked, and the type is exhaustive

Files — one folder, split by who may import it

src/components/admin/JobStageView/
├── JobStageView.tsx   # the server view; reaches @payloadcms/ui and DefaultEditView
├── CheckAgain.tsx     # the one 'use client' module; it carries the refresh handler
└── stages.ts          # the contract + the pure decision; imports only `isRecord`

No barrel, deliberately: one would give a browser-side importer of stages.ts an edge into the view's half.

Preview

  • The transcript editor — the one page this change governs. ⚠ It answers 404 here and in every environment: admin.hidden: true unregisters a collection's routes, so a document drawer is the only surface that renders the view, and nothing in src/ joins to this collection yet.
  • Nothing else in the admin changes — no other collection registers the view.
  • Data: not seeded. A 404 route takes none, and there is no second page to show. The rendered behaviour was measured locally instead, under Manual verification.

Test results

  • Lean gate: ✓ pnpm lint, pnpm typecheck, pnpm typecheck:tests, pnpm test:unit (185 files / 2441 tests)
  • Targeted specs: tests/int/meditation-transcripts.int.spec.ts 7 passed, unchanged — the guard feat(admin): a generic job-stage edit view #960 asks for that the registration moves no behaviour
  • Build: N/A (Railway builds the preview)
  • No migration owed: admin.custom and admin.components are not schema

Manual verification

⚠ #960's checklist says to open /admin/collections/meditation-transcripts, and that cannot be done — the collection is admin.hidden, so the route 404s for everyone, admins included (accessPlugin preserves a literal true). I measured the rendered behaviour on a local dev server instead, by temporarily flipping hidden to false, and reverted it:

Fetch Result
hidden: true, status: queued 404 Not Found — the claim above, measured
hidden: false, status: queued 200, the real editor: Audio Filename, 3 field-type select, Save
hidden: false, status: processing 200, the waiting banner + the link back to /admin/collections/meditation-transcripts/1, and zero rendered field inputs

So the fall-through to DefaultEditView works and the gate closes the form. The one api/meditation-transcripts/1 string on the waiting page is DocumentInfoProvider's apiURL prop (what the API tab links to), not a fetch the view makes.

⚠ That table was measured on the first push, and three review rounds have moved past it. It describes the page's structure, not its current copy or its control: the banner was reworded, the button renamed to Check again, and the button is now a client component calling router.refresh() rather than a link. A stale processing row — one past staleAfterMs — now lands in the third row's second column instead, which the unit lane asserts rather than a fetch.

What a reviewer may still want to check by hand, and I could not: the view rendering inside a document drawer, the surface #912's event-imports uses. Nothing joins to a jobStage collection yet, so there is no drawer to open. ⚠ No control re-reads the stage there — DocumentDrawerContent renders the document through the renderDocument server function and keeps the result in React state, which no route refresh re-runs.

Notes for reviewer

  • Both question threads are answered and built. A on the stalled row → staleAfterMs (44b0171); B on the drawer link → a 'use client' CheckAgain (4703ffb). Each is one commit, and each thread carries the detail.
  • CheckAgain lost its branch in 8a4a957. router.refresh() serves the full-page route as well: it refetches that route's server render and bypasses the client router cache, which is Payload's own idiom — useRouteCache's clearRouteCache is that call. The anchor it replaced rested on the premise that only a full load re-reads the stage, and that premise was wrong.
  • staleAfterMs releases the gate, and nothing else does. Nothing on main expires a running stage, so without a declared window a run lost to a restart held its row behind the waiting view for good. Past the window the form opens, and setting status back to queued is the retry — no job identity, no deleteJobOnComplete change, no access widening.
  • A waiting page costs exactly what rendering the full editor costs. Payload selects the view after awaiting the document, permissions, the lock, versions and buildFormState({ renderAllFields: true }), so the waiting branch discards all of it. feat(admin): a generic job-stage edit view #960 claims no second request, which holds; it is not a saving on the first one.
  • progressField is a dotted path rather than a column name, and totalField sits beside it, which is the one place I went past feat(admin): a generic job-stage edit view #960's wording. feat(events): CSV class import as a Payload collection driven by jobs #912's event-imports keeps its count in a progress group of done/total, so a flat key could never have reached the view's first real count, and one path alone would render "7 done so far" for a job that knows it is 7 of 20 — and "feat(events): CSV class import as a Payload collection driven by jobs #912 adopts the view without changing it" is feat(admin): a generic job-stage edit view #960's central promise.
  • tests/utils/importGraph.ts gains one export, hasDirective. clientEntries() walked all 685 files under src/ to answer a question about two (49ms of the case's 61ms); hasDirective is the same rule without the walk.
Detail

Dismissed review findings.

  • Replace the view with Payload's own document lock (lockDocuments / isLocked / DocumentLocked). It cannot carry this: a job holds no manager identity, and payload-locked-documents is activeManagersOnly in this repo; the built-in UI offers Take over, which hands the form to a human mid-run; and one lock per document cannot distinguish feat(events): CSV class import as a Payload collection driven by jobs #912's review stage, which is editable, from resolving, which is not. Raised as the deepest alternative, and settled rather than asked, because those three are facts.
  • A withJobStage config transform, in withUploadNotice's mould, so one declaration implies the view. feat(admin): a generic job-stage edit view #960 specifies per-collection registration, two collections do not yet pay for a transform, and the spec pins the pairing meanwhile. Worth revisiting at the third consumer.
  • Drop progressField as having no declarer. It is feat(admin): a generic job-stage edit view #960's third acceptance criterion.
  • Generalise the server-component check to the repo's other four registered views. A real gap (AnalyticsView, AtlasMapView, AtlasNav, SignIn have no such guard) and tests/utils/importGraph.ts already walks every entry generically — but not this branch's.
  • A job relationship, so the view reads a job's real status (thread 1's option B). deleteJobOnComplete: true drops a finished job row and payload-jobs is admin-only (systemEntities.ts:112), so it would need both changed. The reviewer chose the window instead.

What covers the acceptance criteria no rendered page can show. Two are the spec's: the view names no collection (checked against the code with comments stripped — a comment naming the shape that drove a decision is not a dependency), and the server half is a server component that fetches nothing (via hasDirective, the rule the two bundle guards apply). CheckAgain.tsx is excluded from that list by name, and pinned in the opposite direction — it must carry 'use client', since a server component cannot carry the refresh handler. The third is the type's. Every DocumentSlots member is optional, so a slot a Payload release adds would be dropped with no type error and no symptom but a missing control — PickedClientProps keys off Required<DocumentViewClientProps>, so that upgrade is TS2741 in the lean gate and in CI. A spec read the installed .d.ts with a regex until the review round; the type replaced it, because [^}]* stopped at the first } and pinned none of the three non-slot props.

Every assertion was watched failing at its real site — declaring queued as running, a flat progress read, a defaulted progressField, an undeclared totalField, a hardcoded status column, 'use client' on stages.ts, a collection identifier in the view, the wrong edit route key, a deleted slot (TS2741 from the new annotation), runingStages (TS2561 from the new satisfies), the stall fall-through removed from jobStageWait, and 'use client' removed from CheckAgain.tsx.

Anomaly, recorded not explained. dev-server.sh teardown reported dropdb failed after stopping the server. The database was the per-worktree ephemeral one. On the first review round, mcp__github__issue_read method:get_labels answered "Could not resolve to an Issue with the number of 972" while method:get on the same number returned the PR with its labels.

Closes #960

🤖 Generated with Claude Code

https://claude.ai/code/session_01FyTK4ApV8PtiuXzrk7hVwC

An Edit view any collection can register to close editing while a worker
holds a document. It reads `admin.custom.jobStage` —
`{ runningStages, statusField?, progressField? }` — so the component names
no collection and no status value, and PR #912 can adopt it for
`event-imports` without changing it.

The stored stage at page load is the whole input. There is no poll, and so
no second request per open document: a stage that settles is one page load
away, which **Continue** is. It is an `<a href>` rather than a `next/link`
for that reason — a client navigation can be answered from the route cache
and redraw the same stale waiting view, which is the problem #912's
`clearRouteCache()` exists to work around.

`progressField` is optional because `meditation-transcripts`, the first
consumer, publishes no count. A waiting view with no number is the ordinary
case rather than a misconfiguration.

Three things worth knowing about the shape:

- `stages.ts` carries the contract with no `'use client'`, no React and no
  import at all. A field component on the same collection may read the same
  declaration from the browser, and the view reaches `adminDocPath` and so
  `serverEnv` — a module either side can import must reach neither bundle.
  That is also why the folder has no barrel: one would give a client
  importer an edge into the server half.
- A custom `views.edit.default.Component` *replaces* `DefaultEditView`
  rather than wrapping it, so a settled stage falls through by rendering
  it. Payload hands a view the server and client prop sets merged and gives
  `DefaultEditView` the client half alone, so `clientPropsOf` rebuilds that
  half by picking: a prop Payload adds server-side then stays server-side,
  where `req` or `payload` crossing into a client component would throw.
- No document id is the create form, which no worker can be holding. The
  guard is what keeps a collection whose running stage is also its
  `defaultValue` from opening every new row behind a view nothing can move
  on — the trap `meditation-transcripts` avoids by declaring `processing`
  and not `queued`.

The unit spec pins the decision, the optional count, and the two
structural criteria no assertion about a rendered page can reach: that the
view names neither collection, and that it is a server component which
fetches nothing. The server-component half asks `clientEntries()` rather
than grepping, because both files explain the directive in prose and a bare
regex fails on a correct file.

Its last three cases read the real collection config, so the declaration
and the `status` default cannot drift apart silently — a stranded row is
what drift would cost. Every case was watched failing at its real site.

No migration is owed: `admin.custom` and `admin.components` are not schema.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MnoRkjfXJnpFFHwmA3R9Pr
Findings from /simplify's four lenses and /code-review high. Behaviour
changes in one place, named below.

- `adminDocPath` is gone from the view. Its own docblock scopes it to "a URL
  that leaves the app" and says an in-panel `href` stays relative, so it was
  composing `getServerUrl()` and parsing the host back off for the page the
  request is already on — and it was the one edge dragging validated server
  env into a render path. Every other in-panel link in `src/components/` is
  a plain `/admin/collections/…` literal; this is now the eighth.
- `isRecord` replaces two hand-rolled `typeof x !== 'object' || x === null`
  guards and the two casts beside them. That utility exists to be the single
  source for this guard, and it imports nothing, so `stages.ts` stays safe
  for a browser-side reader.
- `progressField` is a dotted path, not a column name. #912's
  `event-imports` keeps its count in a `progress` group of `done`/`total`,
  so the flat read this had could never reach the view's first real count —
  which would have made adopting the view a change to it. The only
  behaviour change here, and `statusField` reads the same way for free.
- `decideJobStage` is `jobStageWait`, returning the wait or `null`. The
  `{ waiting: false }` arm carried no data, so the discriminant existed only
  to tell one empty object from another.
- `DEFAULT_STATUS_FIELD` is unexported — it had no importer — and the two
  conditional spreads are plain ternaries, since `exactOptionalPropertyTypes`
  is off and nothing asserts the key's absence.
- The declaration carries `satisfies JobStageConfig`. `admin.custom` is
  `Record<string, any>`, so that is the only thing making a misspelled key a
  build error instead of a view that never fires. Watched red: `runingStages`
  is now TS2561.
- The spec reads through `tests/utils/importGraph.ts` — `SRC`, the memoised
  `sourceOf`, and `hasDirective`, newly exported. `clientEntries()` walked
  all 685 files under `src/` to answer a question about two: 49ms of the
  case's 61ms, in a lane with a stated per-edit budget. `hasDirective` is
  the same rule without the walk. Building the paths from `SRC` also matters
  on its own — two spellings of one root have to keep agreeing or the
  comparison passes vacuously.
- A new case reads `DocumentSlots` off the installed Payload declaration and
  fails unless `clientPropsOf` forwards every member. That was the one
  silent failure left in the diff: the members are all optional, so a slot a
  release adds would be dropped with no type error and no symptom but a
  missing control. Watched red by deleting `Upload`.
- The identifier check now reads the code without its comments. The criterion
  is that the component depends on no collection's identifier, and a comment
  naming the shape that drove a decision is not a dependency.

Dismissed:

- Replace the view with Payload's own document lock (`lockDocuments`,
  `isLocked`, `DocumentLocked`). It cannot carry this: a job holds no
  manager identity, and `payload-locked-documents` is `activeManagersOnly`
  here; the built-in UI offers Take over, which hands the form to a human
  mid-run; and one lock per document cannot distinguish #912's `review`
  stage, which is editable, from `resolving`, which is not.
- A `withJobStage` config transform in `withUploadNotice`'s mould, so one
  declaration implies the view. #960 specifies per-collection registration,
  two collections do not yet pay for a transform, and the spec pins the
  pairing meanwhile.
- Drop `progressField` as having no declarer. #960's third acceptance
  criterion is the optional count.
- Generalise the server-component check to the repo's other four registered
  views. Real gap, but not this branch's.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MnoRkjfXJnpFFHwmA3R9Pr
`docs/rules/admin-ui.md` is what loads when someone edits an admin
component, and a view that replaces Payload's own Edit view carries four
facts the code cannot state: that `views.edit.default` replaces rather than
wraps, so the client prop set has to be rebuilt by picking; that a waiting
page costs exactly what the full editor costs, because Payload selects the
view after loading everything; why Continue is an anchor; and that a running
stage must never be the column's `defaultValue`.

The ⚠ is the one that would otherwise cost someone an afternoon: on a
`hidden: true` collection the route 404s, so the view is reachable only
through a document drawer. Measured on a dev server rather than inferred —
`/admin/collections/meditation-transcripts/1` answers 404.

`tests/COVERAGE.md` is read as complete, so a guard absent from it reads as
one that does not exist.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MnoRkjfXJnpFFHwmA3R9Pr
@railway-app

railway-app Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-972 environment in sahajcloud

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Oct 17, 2026 at 12:35 am UTC
1 service not affected by this PR
  • mailpit

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

2 questions for the reviewer, one per thread.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 16, 2026
@sydevs-bot

sydevs-bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 00:25Z address-review · attempt 1 · session · done
  • 00:25Z address-review · attempt 1 · session
  • 00:05Z address-review · attempt 1 · session · done
  • 00:05Z address-review · attempt 1 · session
  • 23:46Z address-review · attempt 1 · session · done

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🧐 Adversarial review

The shape is #960's and the diff is its size: one folder, two declarations per collection, no identifier of either consumer. Nothing is smuggled in — the hasDirective export and the COVERAGE row are the ticket's own cost, and no contract surface moves, since admin.custom is not schema.

The headline is sequencing, not design. meditation-transcripts is admin.hidden and nothing joins to it, so no surface in any environment renders this view today. The waiting branch, the count and the Continue link all first run under #912. That leaves the fall-through as the only code a merge puts in front of anyone, and its guard is a regex over a .d.ts where a type would do.

Findings

  • should-fix — clientPropsOf's exhaustiveness belongs in the type, not in a spec. JobStageView.tsx:16
  • consider — the count cannot express #912's done/total. JobStageView.tsx:60
  • consider — banner and button copy speak in internal vocabulary. JobStageView.tsx:59
  • consider — the rule doc restates the component's docblocks. docs/rules/admin-ui.md:221

What was checked

Read whole: both new modules, the spec, the collection hunk, the admin-ui.md section. Checked against the repo: accessPlugin spreads ...collection.admin, so the registration survives it; payload-locked-documents is activeManagersOnly (systemEntities.ts:116), which holds the dismissal of Payload's own lock; the /admin literal is house convention, pinned by admin-route-config.int.spec.ts; toWords has precedent in LogTable; nothing in src/ joins this collection. The preview answers 200 unauthenticated for any collection, hidden or not, and I hold no preview credential, so it neither confirms nor refutes the 404. The two open question threads are left to the reviewer.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread docs/rules/admin-ui.md Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Oct 16, 2026
`clientPropsOf` rebuilds the client half of the props by picking, and every
`DocumentSlots` member is optional, so a slot a Payload release adds would be
dropped with no type error. The spec standing in for that read the installed
`.d.ts` with a regex whose `[^}]*` stops at the first `}`, with
`toBeGreaterThan(5)` as its only guard against a truncated match, and it
pinned none of the three non-slot props.

`PickedClientProps` keys off `Required<DocumentViewClientProps>`, so the
upgrade that adds a member is TS2741 in the lean gate and in CI. Mapping with
`-?` instead would strip `undefined` from each value type, which every slot
Payload hands over carries.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qGqT2FiatrKd8c66p3r5S
#960's promise is that #912 adopts this view unchanged, and #912's
`event-imports` keeps `done` and `total` in a group — so one path could only
ever render "7 done so far" for a job that knows it is 7 of 20.

`totalField` is a second dotted path rather than a group shape the view
infers, so the contract still names no consumer's key. With both declared the
banner reads "7 of 20 done"; with neither, nothing, which stays
`meditation-transcripts`' case.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qGqT2FiatrKd8c66p3r5S
"a job owns this document" names an internal concept, and **Continue** reads
as "go on to the next step" where the link redraws this same page.

The reader is a non-technical volunteer who wants to know whether to wait and
what to press. The stage word stays, because it is the one thing the banner
knows that the sentence does not.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qGqT2FiatrKd8c66p3r5S
One bullet restated `clientPropsOf`'s docblock almost sentence for sentence,
and its last clause named a spec that no longer exists. Another stated a cost
nobody acts on.

What a reader reaching this rule needs is above the list: the declaration, the
`satisfies` line, and the warning about `hidden`.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qGqT2FiatrKd8c66p3r5S
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-972 October 16, 2026 18:35 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Adopted all four critic findings, one commit each, pushed as bc7dc6c.

Lean gate green: lint, typecheck, typecheck:tests, 2434 unit tests. Body refreshed — the config block, the behaviour block and the Detail section all named the old shape.

The two question threads stay open. Both still read correctly, except that the drawer one calls the button Continue.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 16, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review October 16, 2026 18:49
@sydevs-bot
sydevs-bot requested a review from Ardnived October 16, 2026 18:49
@sydevs-bot
sydevs-bot enabled auto-merge October 16, 2026 18:49
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed awaiting labels Oct 16, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Answered the lease thread with a question. Nothing pushed — the ask is a design decision, not a fix.

No commit, no push, head unchanged at bc7dc6c.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot added awaiting and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Oct 16, 2026
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed awaiting labels Oct 17, 2026
`router.refresh()` serves the full-page edit route as well as a drawer,
so the branch and the `url` prop go.

The anchor was there on the premise that only a full load re-reads the
stage server-side. It is wrong: `router.refresh()` refetches this
route's server render and bypasses the client router cache, which is the
cache the premise was about. Payload reaches for the same call —
`useRouteCache`'s `clearRouteCache` is `router.refresh()`, and
`DefaultEditView` reloads stale document data with it.

The drawer half bought nothing either way. `DocumentDrawerContent`
renders the document through the `renderDocument` server function and
keeps the result in React state, so no route refresh re-runs it. Neither
control re-reads a stage in a drawer; the anchor would have re-read it
only by leaving the host document and discarding its unsaved edits.

`CheckAgain.tsx` stays the folder's one client component — a server
component cannot carry the handler — and the spec still pins it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyTK4ApV8PtiuXzrk7hVwC
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-972 October 17, 2026 00:13 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

One adopted. Pushed 8a4a957.

  • Adopted · router.refresh() for both cases → 8a4a957. Yes. The branch, the url prop and the useDocumentDrawerContext read are gone; CheckAgain is now one button. The anchor's premise was wrong — router.refresh() refetches this route's server render and bypasses the client router cache, and Payload reaches for the same call (useRouteCache's clearRouteCache). Thread resolved.

⚠ The drawer half never worked, and the simplification does not fix it. DocumentDrawerContent renders the document through the renderDocument server function and keeps the result in React state, so no route refresh re-runs it. Neither control re-reads a stage inside a drawer; the anchor would have re-read it only by leaving the host document. The rule doc and the PR body now say so.

Lean gate green: lint, both typechecks, 185 files / 2441 tests.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot added awaiting and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Oct 17, 2026
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed awaiting labels Oct 17, 2026
The 19-line block restated what `docs/rules/admin-ui.md` § JobStageView
already carries: the `router.refresh()` / `clearRouteCache` idiom and the
anchor that was weighed against it. What a reader of this file cannot
re-derive is why it is its own module and that a drawer re-reads nothing,
so those two stay.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JZ1GScEPJoyyQDzxWvagcn
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-972 October 17, 2026 00:32 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

One adopted, one rebutted. Pushed 2bea10e.

  • Adopted · the excessive comments → 2bea10e. CheckAgain.tsx's docblock goes from 19 lines to 4. The clearRouteCache idiom and the anchor it replaced already sit in docs/rules/admin-ui.md. What stays is what the file alone carries: why it is its own module, and the ⚠ that a drawer re-reads nothing.
  • Rebutted · the inlining half of the same thread. 'use client' is module-scoped, and JobStageView must stay a server component — Payload hands a view payload: Payload and i18n: I18nClient (payload/dist/config/types.d.ts:317), both carrying methods. Left open for you.

Lean gate green: lint, both typechecks, 185 files / 2441 tests.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot added awaiting and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Oct 17, 2026
@sydevs-bot
sydevs-bot added this pull request to the merge queue Oct 17, 2026
@sydevs-bot sydevs-bot moved this from Revising to Approved in SYDevelopers Technical Roadmap Oct 17, 2026
Merged via the queue into main with commit 6c1e9c2 Oct 17, 2026
34 checks passed
@sydevs-bot
sydevs-bot deleted the claude/feat-960-job-stage-view branch October 17, 2026 00:59
@sydevs-bot sydevs-bot moved this from Approved to Done in SYDevelopers Technical Roadmap Oct 17, 2026
sydevs-bot pushed a commit that referenced this pull request Oct 17, 2026
Adopts #972's generic job-stage Edit view for `event-imports`, which is what
the review asked for, and deletes the two modules that existed only because
the form stayed open while a worker wrote to it.

`ImportProgress.tsx` polled the batch every three seconds and cleared the
route cache on settle; `progressUrl.ts` composed that read and held a second
copy of the running set. The stored stage at page load replaces both: the
view renders the count from `progress.done`/`progress.total` and the form
opens on the next page load. A settled batch now costs no request at all,
rather than one armed from form state.

Two things the adoption had to settle, neither of them a change to the view:

- **`staleAfterMs` is load-bearing here, not optional.** The view replaces
  the whole form, the `SaveButton` slot included, so `DISCARD_RUNNING` — the
  only way out of a batch a dead worker stranded — is reachable only past
  that window. Fifteen minutes, from the `imports` queue's five-minute sweep
  plus the minutes a 500-row resolve holds a worker.
- **`status` defaults to `resolving`, a running stage**, which the view's
  own rules warn against. It is correct here because the create queues the
  resolve job, so a saved row at that default really is one a worker owns —
  and the stall window is what keeps the warning's failure out of it.

`useBatchReadOnly` stays: the form still opens for `finished`, `failed` and
`discarded`, where the rows table and the region tree are nobody's to edit.
The `progress` group loses its component and goes `admin.hidden`, since the
banner is now the only reader of that count.

Every new assertion was watched failing at its real site: the declaration
without its stall window, a count path the group does not hold, a running
stage the status column cannot hold, and the view unregistered.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Wqo55uk4y7XWhVEaB1K3ru

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-972 — 2bea10e5 Deployed Oct 17, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

feat(admin): a generic job-stage edit view

3 participants