Skip to content

[cueweb/docs] Allow delaying a layer start - #2507

Merged
ramonfigueiredo merged 7 commits into
AcademySoftwareFoundation:masterfrom
ramonfigueiredo:cueweb-layer-start-after
Aug 12, 2026
Merged

[cueweb/docs] Allow delaying a layer start#2507
ramonfigueiredo merged 7 commits into
AcademySoftwareFoundation:masterfrom
ramonfigueiredo:cueweb-layer-start-after

Conversation

@ramonfigueiredo

@ramonfigueiredo ramonfigueiredo commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Related Issues

Summarize your change.

Bring CueWeb to parity with the CueGUI half of the layer start-after gate: the time before which no frame of a layer may be booked, written either by an operator or automatically by Cuebot's exit-status backoff (dispatcher.layer_delay.rules).

  • Layers table gains a sortable "Start After" column. The proto field is an int64, so the gateway marshals it as a JSON string the way it already does for minMemory/maxRss; layerStartAfterSeconds() normalizes string | number | undefined in one place and the column's accessor sorts on that number rather than on the formatted date.
  • Delayed rows are tinted via SimpleDataTable's getRowClassName hook - the same mechanism the Hosts table uses - on both the job detail page and the inline job panel. The tint compares against the current time, so it clears itself on the first render after the deadline passes.
  • "Set Start After..." in the layer context menu and on layer nodes in the Job Dependency Graph opens a dialog with the same +15m / +1h / +4h / Tonight 18:00 presets as CueGUI. The picker reads and writes local time and the RPC carries UTC epoch seconds; Clear sends 0.
  • New /api/layer/action/setstartafter proxies to /job.LayerInterface/SetStartAfter and rejects a non-integer, negative, or more-than-five-years-out value before it reaches the gateway, mirroring the INVALID_ARGUMENT Cuebot raises for a milliseconds-for-seconds mistake. The signed-in username travels with the request and is stored as the layer's start-after reason, which is rendered as plain text in both the column tooltip and the dialog.

rest_gateway needs no registration change - it generates a route per RPC from job.proto, so SetStartAfter appears once the image is rebuilt. The news post is corrected accordingly; it had listed both that and CueWeb parity as open follow-up work.

LLM usage disclosure

Parts of this solution's implementation were developed with assistance from Claude Opus.

Summary by CodeRabbit

New Features

  • Added deferred layer scheduling through Set Start After… actions in layer menus and dependency-graph nodes.
  • Added scheduling presets, local-time editing, delay clearing, reason display, and attribution.
  • Added a sortable Start After column and visual highlighting for delayed layers.
  • Added validation, success/error feedback, and safety controls for restricted job interactions.

Documentation

  • Updated user and developer documentation with scheduling behavior, controls, validation, and display details.

Bring CueWeb to parity with the CueGUI half of the layer start-after gate: the time before which no frame of a layer may be booked, written either by an operator or automatically by Cuebot's exit-status backoff (dispatcher.layer_delay.rules).

- Layers table gains a sortable "Start After" column. The proto field is an int64, so the gateway marshals it as a JSON string the way it already does for minMemory/maxRss; layerStartAfterSeconds() normalizes string | number | undefined in one place and the column's accessor sorts on that number rather than on the formatted date.
- Delayed rows are tinted via SimpleDataTable's getRowClassName hook - the same mechanism the Hosts table uses - on both the job detail page and the inline job panel. The tint compares against the current time, so it clears itself on the first render after the deadline passes.
- "Set Start After..." in the layer context menu and on layer nodes in the Job Dependency Graph opens a dialog with the same +15m / +1h / +4h / Tonight 18:00 presets as CueGUI. The picker reads and writes local time and the RPC carries UTC epoch seconds; Clear sends 0.
- New /api/layer/action/setstartafter proxies to /job.LayerInterface/SetStartAfter and rejects a non-integer, negative, or more-than-five-years-out value before it reaches the gateway, mirroring the INVALID_ARGUMENT Cuebot raises for a milliseconds-for-seconds mistake. The signed-in username travels with the request and is stored as the layer's start-after reason, which is rendered as plain text in both the column tooltip and the dialog.

rest_gateway needs no registration change - it generates a route per RPC from job.proto, so SetStartAfter appears once the image is rebuilt. The news post is corrected accordingly; it had listed both that and CueWeb parity as open follow-up work.
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 43ed75b5-7c58-4849-a14d-b61c70f14e20

📥 Commits

Reviewing files that changed from the base of the PR and between a7725b4 and 638a36e.

📒 Files selected for processing (5)
  • docs/_docs/developer-guide/cueweb-development.md
  • docs/_docs/other-guides/cueweb.md
  • docs/_docs/quick-starts/quick-start-cueweb.md
  • docs/_docs/tutorials/cueweb-tutorial.md
  • docs/_docs/user-guides/cueweb-user-guide.md
🚧 Files skipped from review as they are similar to previous changes (5)
  • docs/_docs/developer-guide/cueweb-development.md
  • docs/_docs/quick-starts/quick-start-cueweb.md
  • docs/_docs/user-guides/cueweb-user-guide.md
  • docs/_docs/tutorials/cueweb-tutorial.md
  • docs/_docs/other-guides/cueweb.md

📝 Walkthrough

Walkthrough

CueWeb adds deferred layer booking through a validated API route, client actions, start-after display fields, delayed-row styling, dialogs, context-menu actions, tests, and documentation. It also fixes jobs-table worker URL resolution.

Changes

Layer Start After Scheduling

Layer / File(s) Summary
API and action flow
cueweb/app/api/layer/action/setstartafter/route.ts, cueweb/app/utils/action_utils.ts, cueweb/lib/metrics-service.ts, cueweb/app/__tests__/api/utils/layer_start_after.test.ts
The route validates timestamps and derives username provenance from the session. Client actions support setting and clearing values without sending a username. Tests cover payloads, success responses, and backend rejection handling.
Layer display and delayed-row state
cueweb/app/utils/layer_start_after_utils.ts, cueweb/app/layers/layer-columns.tsx, cueweb/app/jobs/[job-name]/page.tsx, cueweb/components/ui/job-details-inline.tsx, cueweb/app/__tests__/api/utils/layer_start_after.test.ts
Layer timestamps and reasons appear in a sortable column. Utilities normalize numeric and string values. Future delays receive conditional row styling.
Dialog and layer controls
cueweb/components/ui/layer-extra-dialogs.tsx, cueweb/components/ui/context_menus/action-context-menu.tsx, cueweb/components/ui/job-dependency-graph.tsx, cueweb/app/utils/action_utils.ts
The dialog supports local datetime input, presets, clearing, reason display, and busy states. Layer menus and graph nodes open the dialog. Mutating graph actions follow the interaction safety state.
Feature documentation
docs/_docs/developer-guide/cueweb-development.md, docs/_docs/other-guides/cueweb.md, docs/_docs/reference/cueweb.md, docs/_docs/user-guides/cueweb-user-guide.md, docs/_docs/tutorials/cueweb-tutorial.md, docs/news/2026-08-07-layer-start-after-deferred-booking.md, docs/_docs/quick-starts/quick-start-cueweb.md
Documentation covers API validation, timestamp conversion, display behavior, controls, context-menu actions, safety gating, and feature availability.

Worker URL Resolution

Layer / File(s) Summary
Relative worker URLs
cueweb/app/jobs/data-table.tsx
The refresh and search-filter worker URLs now use paths relative to data-table.tsx.

Estimated code review effort: 4 (Complex) | ~45 minutes

Mergeability Score: ⚪ Minimal · up to 638a3

The PR adds user-controlled layer start delays and related UI and documentation updates. Remaining concerns are limited to minor documentation wording and maintenance-comment clarity, so no actionable merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant LayerMenu
  participant LayerStartAfterDialog
  participant setLayerStartAfter
  participant SetStartAfterRoute
  participant Cuebot

  LayerMenu->>LayerStartAfterDialog: open for selected layer
  LayerStartAfterDialog->>setLayerStartAfter: submit UTC start_after
  setLayerStartAfter->>SetStartAfterRoute: POST action request
  SetStartAfterRoute->>Cuebot: call SetStartAfter with session username
  Cuebot-->>SetStartAfterRoute: return result
  SetStartAfterRoute-->>setLayerStartAfter: return response
  setLayerStartAfter-->>LayerStartAfterDialog: show success or rejection
Loading

Possibly related PRs

Suggested labels: devdays26

Suggested reviewers: lithorus, diegotavares

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 62.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding CueWeb support for delaying layer starts.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ramonfigueiredo ramonfigueiredo self-assigned this Aug 12, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cueweb/app/api/layer/action/setstartafter/route.ts`:
- Around line 43-60: Update the route’s request handling before calling
handleRoute so the authenticated user identity is obtained server-side and used
as the username forwarded to Cuebot; ignore or overwrite jsonBody.username
rather than trusting the client-provided value, while preserving the existing
layer and start_after validation.

In `@cueweb/components/ui/job-dependency-graph.tsx`:
- Line 671: Update the “Set Start After...” Item in the graph menu to use
useDisableJobInteraction(), matching LayerContextMenu, so it is disabled when
job interaction is unavailable and cannot open LayerStartAfterDialog or invoke
setstartafter.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6e9c73c1-1b2b-407e-a65e-cf42ceecc3b6

📥 Commits

Reviewing files that changed from the base of the PR and between d9f5ba2 and 0edfe41.

📒 Files selected for processing (17)
  • cueweb/app/__tests__/api/utils/layer_start_after.test.ts
  • cueweb/app/api/layer/action/setstartafter/route.ts
  • cueweb/app/jobs/[job-name]/page.tsx
  • cueweb/app/layers/layer-columns.tsx
  • cueweb/app/utils/action_utils.ts
  • cueweb/app/utils/layer_start_after_utils.ts
  • cueweb/components/ui/context_menus/action-context-menu.tsx
  • cueweb/components/ui/job-dependency-graph.tsx
  • cueweb/components/ui/job-details-inline.tsx
  • cueweb/components/ui/layer-extra-dialogs.tsx
  • cueweb/lib/metrics-service.ts
  • docs/_docs/developer-guide/cueweb-development.md
  • docs/_docs/other-guides/cueweb.md
  • docs/_docs/reference/cueweb.md
  • docs/_docs/tutorials/cueweb-tutorial.md
  • docs/_docs/user-guides/cueweb-user-guide.md
  • docs/news/2026-08-07-layer-start-after-deferred-booking.md

Comment thread cueweb/app/api/layer/action/setstartafter/route.ts Outdated
Comment thread cueweb/components/ui/job-dependency-graph.tsx Outdated
Resolve two review findings on the Start After work:

- Derive the start-after username from the session in the route (getServerSession, as lib/audit.ts does) and ignore any username in the request body, so a caller cannot attribute a delay to someone else. The browser no longer sends one at all.
- Honour the "Disable Job Interaction" safety flag in the Job Dependency Graph's layer menu. It gated none of its entries, so the flag stopped applying whenever an operator right-clicked a node instead of a table row; gating follows LayerContextMenu's choices.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
cueweb/app/__tests__/api/utils/layer_start_after.test.ts (1)

85-93: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Add a route provenance regression test.

This test verifies the browser payload only. It does not verify that the route replaces a hostile username with the authenticated session identity.

Mock getServerSession and handleRoute. Submit a request with a different body username. Assert that the forwarded Cuebot payload contains only the session-derived username.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cueweb/app/__tests__/api/utils/layer_start_after.test.ts` around lines 85 -
93, Extend the setLayerStartAfter route tests around the existing success case
to mock getServerSession and handleRoute, then submit a request whose body
contains a different username. Assert the forwarded Cuebot payload uses only the
authenticated session identity and excludes the hostile body username.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@cueweb/app/__tests__/api/utils/layer_start_after.test.ts`:
- Around line 85-93: Extend the setLayerStartAfter route tests around the
existing success case to mock getServerSession and handleRoute, then submit a
request whose body contains a different username. Assert the forwarded Cuebot
payload uses only the authenticated session identity and excludes the hostile
body username.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 53be78cf-1ad4-4e4e-9e61-cdf12730bd39

📥 Commits

Reviewing files that changed from the base of the PR and between 0edfe41 and d0961f1.

📒 Files selected for processing (7)
  • cueweb/app/__tests__/api/utils/layer_start_after.test.ts
  • cueweb/app/api/layer/action/setstartafter/route.ts
  • cueweb/app/utils/action_utils.ts
  • cueweb/components/ui/job-dependency-graph.tsx
  • cueweb/components/ui/layer-extra-dialogs.tsx
  • docs/_docs/developer-guide/cueweb-development.md
  • docs/_docs/reference/cueweb.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/_docs/reference/cueweb.md
  • docs/_docs/developer-guide/cueweb-development.md

@ramonfigueiredo

ramonfigueiredo commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author
cueweb_cuetopia_monitor_jobs_layers_set_start_after_1_layer_before cueweb_cuetopia_monitor_jobs_layers_set_start_after_2_layer_right_click cueweb_cuetopia_monitor_jobs_layers_set_start_after_3_layer_set_start_after cueweb_cuetopia_monitor_jobs_layers_set_start_after_4_set_start_after_confirmation cueweb_cuetopia_monitor_jobs_layers_set_start_after_5_layer_after

Add the Set Start After walkthrough to the CueWeb docs, and fix the row tint the screenshots exposed.

TableRow carries `hover:bg-muted/50`, which beat the plain `bg-amber-100` on the delayed-layer row - so the tint vanished exactly when an operator hovered the row to read the Start After reason. layerRowClassName now restates the tint under `hover:` (and its dark-mode pair), so a delayed row darkens instead of going blank.

Screenshots cover the flow end to end: a layer with no delay and a blank Start After column, the right-click entry, the dialog with its presets, the confirmation, and the delayed layer tinted with the time in the column. Both light and dark captures are committed; the pages reference the light ones.

Docs updated:
- user guide, tutorial: step-by-step walkthroughs
- other guides: Figures 74-78
- reference: a Set Start After dialog section alongside the other dialogs
- quick start: had no coverage of the feature at all; also missing from its job-graph layer-menu list and its Layers column list

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/_docs/other-guides/cueweb.md`:
- Line 98: Correct the figure caption text in the documentation by changing
“ftart After” to “Start After.”

In `@docs/_docs/quick-starts/quick-start-cueweb.md`:
- Line 266: Update the “Set Start After” description to clarify that Clear
removes the current delay, while OpenCue may automatically apply a new delay
again if the underlying condition persists.

In `@docs/_docs/tutorials/cueweb-tutorial.md`:
- Line 345: Update the “Pick a time” instruction to use the American English
spelling “afterward” instead of “afterwards,” without changing the surrounding
guidance.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 07e5550c-bf2b-4f56-b690-c06fe31db6cb

📥 Commits

Reviewing files that changed from the base of the PR and between d0961f1 and 9ae2687.

⛔ Files ignored due to path filters (10)
  • docs/assets/images/cueweb/cueweb_cuetopia_monitor_jobs_layers_set_start_after_1_layer_before.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuetopia_monitor_jobs_layers_set_start_after_1_layer_before_dark.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuetopia_monitor_jobs_layers_set_start_after_2_layer_right_click.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuetopia_monitor_jobs_layers_set_start_after_2_layer_right_click_dark.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuetopia_monitor_jobs_layers_set_start_after_3_layer_set_start_after.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuetopia_monitor_jobs_layers_set_start_after_3_layer_set_start_after_dark.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuetopia_monitor_jobs_layers_set_start_after_4_set_start_after_confirmation.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuetopia_monitor_jobs_layers_set_start_after_4_set_start_after_confirmation_dark.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuetopia_monitor_jobs_layers_set_start_after_5_layer_after.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuetopia_monitor_jobs_layers_set_start_after_5_layer_after_dark.png is excluded by !**/*.png
📒 Files selected for processing (6)
  • cueweb/app/utils/layer_start_after_utils.ts
  • docs/_docs/other-guides/cueweb.md
  • docs/_docs/quick-starts/quick-start-cueweb.md
  • docs/_docs/reference/cueweb.md
  • docs/_docs/tutorials/cueweb-tutorial.md
  • docs/_docs/user-guides/cueweb-user-guide.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • cueweb/app/utils/layer_start_after_utils.ts
  • docs/_docs/user-guides/cueweb-user-guide.md
  • docs/_docs/reference/cueweb.md

Comment thread docs/_docs/other-guides/cueweb.md Outdated
Comment thread docs/_docs/quick-starts/quick-start-cueweb.md Outdated
Comment thread docs/_docs/tutorials/cueweb-tutorial.md Outdated
Next 16 rejects the server-relative new URL('/public/workers/...', import.meta.url) the jobs table used for its two workers. Make both paths relative to data-table.tsx, as the build error asks.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
cueweb/app/jobs/data-table.tsx (1)

705-706: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Clarify the version-specific explanation.

Next.js exposes files from public at the site root, so /public/workers/... is not the runtime asset path. new URL("../../public/workers/...", import.meta.url) is a bundler-resolved worker module reference. Replace the claim that Next.js 16 dropped server-relative worker URL support with this precise explanation. Next.js documents root-relative public assets, and webpack documents this worker-constructor pattern. (nextjs.org)

Please also verify the emitted worker in both development and production builds.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cueweb/app/jobs/data-table.tsx` around lines 705 - 706, Update the comment
near the worker URL construction to explain that public files are served from
the site root, so /public/workers/... is not the runtime asset path, while new
URL("../../public/workers/...", import.meta.url) is a bundler-resolved worker
module reference. Remove the inaccurate Next.js 16 version claim, and verify the
emitted worker path in both development and production builds.

Source: MCP tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@cueweb/app/jobs/data-table.tsx`:
- Around line 705-706: Update the comment near the worker URL construction to
explain that public files are served from the site root, so /public/workers/...
is not the runtime asset path, while new URL("../../public/workers/...",
import.meta.url) is a bundler-resolved worker module reference. Remove the
inaccurate Next.js 16 version claim, and verify the emitted worker path in both
development and production builds.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d634ac02-546e-4f8d-ac13-fe16ab03ba66

📥 Commits

Reviewing files that changed from the base of the PR and between 9ae2687 and a7725b4.

📒 Files selected for processing (1)
  • cueweb/app/jobs/data-table.tsx

- Restore the Figure 74 caption in the other-guides page, which had been truncated to "ftart After column is blank" by a bad edit; it now matches the image alt text and the wording used in the other pages.
- Clarify what Clear does in the quick start and the other-guides layer action list: it drops the delay the layer currently has, but the exit-status backoff can apply a new one while the underlying condition persists. The user guide and tutorial already said so.
- Use "afterward" rather than "afterwards" in the three places this change introduced.
@ramonfigueiredo
ramonfigueiredo merged commit 1cea9a8 into AcademySoftwareFoundation:master Aug 12, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants