Repository navigation
[#617] Clarify printing queues and add duration timers - #618
Conversation
Co-authored-by: Codex <codex@openai.com>
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: 🔵 Low · up to Organizers cannot edit notes on some existing running prints without setting a valid duration first. This is a bounded workflow issue to fix or explicitly accept before merging. Pre-merge checks |
|
There was a problem hiding this comment.
Note
Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.
🟡 Other comments (1)
.forge/features/printing-categories/status.md (1)
3-3: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winUpdate the stale PR step. Line 41 still says to open the correction as a PR, but this status says it awaits review. Change step 4 to say PR
#618is under review.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: KnightHacks/forge/.coderabbit.yml
- Review profile: QUIET
- Plan: Advanced
- Run ID:
c0c3228f-57ea-4df1-bd1e-f57cc48fa7dc
⛔ Files ignored due to path filters (1)
packages/api/src/tests/root/__snapshots__/api-surface.test.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (2)
.forge/features/printing-categories/status.mdpackages/api/src/utils/audit/coverage.ts
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
Co-authored-by: Codex <codex@openai.com>
There was a problem hiding this comment.
Note
Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.
🟡 Other comments (1)
apps/blade/src/app/_components/admin/printing/print-job-dialog.tsx (1)
215-220: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winAllow note-only saves for existing printing jobs without a valid timer.
When
job.status === "printing"has no estimate, the duration fields are blank and the button is disabled. An out-of-range legacy estimate initializes invalid nonblank fields, so a blank-only exception does not cover that path. Initialize invalid saved durations as blank, then omitdurationMinutesonly for an already-printing job with blank fields. Keep duration required for new starts.Suggested fix
const savedDuration = job.status === "printing" && job.estimate?.overridden ? Math.round( (job.estimate.estimatedReadyAt.getTime() - job.statusChangedAt.getTime()) / 60_000, ) : 0; + const savedDurationValid = + savedDuration >= 1 && savedDuration <= PRINTING.MAX_PRINT_MINUTES; const [hours, setHours] = useState( - savedDuration > 0 ? String(Math.floor(savedDuration / 60)) : "", + savedDurationValid ? String(Math.floor(savedDuration / 60)) : "", ); const [minutes, setMinutes] = useState( - savedDuration > 0 ? String(savedDuration % 60) : "", + savedDurationValid ? String(savedDuration % 60) : "", ); ... const durationValid = Number.isInteger(Number(hours)) && Number(hours) >= 0 && Number.isInteger(Number(minutes)) && Number(minutes) >= 0 && Number(minutes) < 60 && durationMinutes >= 1 && durationMinutes <= PRINTING.MAX_PRINT_MINUTES; + const durationBlank = hours.trim() === "" && minutes.trim() === ""; + const durationOptional = job.status === "printing" && durationBlank; ... - ...(status === "printing" ? { durationMinutes } : {}), + ...(status === "printing" && !durationOptional + ? { durationMinutes } + : {}), ... - (status === "printing" && !durationValid) + (status === "printing" && !durationOptional && !durationValid)
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: KnightHacks/forge/.coderabbit.yml
- Review profile: QUIET
- Plan: Advanced
- Run ID:
64ad6a2a-293b-4a1e-a57a-0fedb0bec883
📒 Files selected for processing (24)
.forge/features/printing-categories/spec.md.forge/features/printing-categories/srd.md.forge/features/printing-categories/status.md.forge/features/printing-categories/test-cases.mdapps/2026/src/app/(portal)/_components/hacker-printing.module.cssapps/2026/src/app/(portal)/_components/hacker-printing.tsxapps/2026/src/app/(portal)/_components/new-print-job-form.tsxapps/2026/src/app/(portal)/_components/printing-guidelines.tsxapps/blade/src/app/_components/admin/printing/print-duration-fields.tsxapps/blade/src/app/_components/admin/printing/print-job-dialog.tsxapps/blade/src/app/_components/admin/printing/print-queue-format.tsapps/blade/src/app/_components/admin/printing/printing-queue-workspace.tsxapps/blade/src/tests/e2e/printing-availability.spec.tsapps/blade/src/tests/e2e/printing-portal.spec.tspackages/api/src/hacker-portal/printing.tspackages/api/src/routers/printing.tspackages/api/src/tests/integration/printing.test.tspackages/api/src/utils/printing/queue.tspackages/consts/src/printing.tspackages/ui/src/countdown.tsxpackages/validators/src/audit.tspackages/validators/src/hacker-portal.tspackages/validators/src/printing.tspackages/validators/src/tests/printing.test.ts
💤 Files with no reviewable changes (1)
- apps/blade/src/app/_components/admin/printing/print-queue-format.ts
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
Why
Hackers need to know which filaments are available, the one-hour session policy, and what their queue number means. Organizers need to enter a print duration instead of calculating an exact ready timestamp.
What
Closes: #617
printing.updateCategoryAPI snapshot and hybrid audit-coverage corrections.Scope: Blade and the KHIX hacker portal, plus their shared printing API, validators, constants, and countdown component. Reuses existing timestamp columns and retains the older timestamp API for deployed clients. No new schema, dependency, environment, or email-template changes. This PR has not been deployed; the previous category/email rollout is already on main. No reminder emails were resent. The Hacker’s Guide iframe remains unchanged.
Test Plan
output/playwright/printing-session-policy/and shared in the Codex task; these images are not committed.pnpm format,pnpm lint, andpnpm analyze:react:changed: passed (existing lint warnings; 7 React components analyzed with 0 failures).pnpm typecheck: all 33 tasks passed before builds. After builds, 32 passed and Blade failed with TS2344 in.next/types/app/api/admin/resume-bundle/route.ts:42: the existingGET(request?: Request)is incompatible with generatedParamCheck<Request | NextRequest>. That source route is identical to main and outside this printing change. The commit hook reproduced the same failure after formatting/lint passed; the commit used a one-command hook override, with no hook configuration changes.Checklist