Skip to content

[#617] Clarify printing queues and add duration timers - #618

Merged
Adr1an04 merged 2 commits into
mainfrom
codex/printing-category-ci
Oct 10, 2026
Merged

Adr1an04 merged 2 commits into
mainfrom
codex/printing-category-ci

Conversation

@Adr1an04

@Adr1an04 Adr1an04 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Show all eight Shinies filaments and the 60-minute fairness policy on the KHIX printing page and request form.
  • Show project/personal totals, overall queue positions, and held requests separately. Running prints finish first; waiting hackathon projects have priority, then original submission order within each category.
  • Replace the organizer date/time picker with hours and minutes. Starting Printing saves the server-calculated finish estimate, and both dashboards display a live countdown. Editing the duration keeps the original start; note-only edits and repeated saves do not restart it. Expiry requires an organizer update and never marks a job ready automatically.
  • Allow estimates such as 1h30m with a visible warning above the one-hour session policy. Status/note/timing changes continue through the existing branded email notification flow, once per actual change.
  • Include the existing printing.updateCategory API 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

  • Printing integration: 24 tests passed against disposable local Postgres, with delivery mocked. Focused API regression run: 41 tests across 5 files.
  • Validators: 350 tests; Hacker SDK: 57; KHIX: 190; email: 116; Blade queue formatting: 3 — all passed.
  • Desktop and 320px mobile browser flows: 4 tests passed for organizer and hacker views. Covered duration persistence after reload, 1h30m entry and warning, category totals, overall position, all filaments, closed-state drafts, and expired timers.
  • Inspected actual desktop/mobile screenshots using synthetic data. Local review artifacts are in output/playwright/printing-session-policy/ and shared in the Codex task; these images are not committed.
  • pnpm format, pnpm lint, and pnpm 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 existing GET(request?: Request) is incompatible with generated ParamCheck<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.
  • Blade and KHIX production builds: passed using local-only database/portal overrides. These builds skip built-in type validation; the separate typecheck limitation is recorded above. Isolated browser database removed afterward.

Checklist

  • Database: No schema changes.
  • Environment Variables: No environment variables changed.

Co-authored-by: Codex <codex@openai.com>
@Adr1an04 Adr1an04 added Bug Something isn't working Minor Small change - 1 reviewer required API Change modifies code in the global API/tRPC package labels Oct 10, 2026
@Adr1an04 Adr1an04 self-assigned this Oct 10, 2026
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

📝 Walkthrough
📝 Walkthrough

Walkthrough

The printing queue now includes category and on-hold counts. Organizers can set print durations, and both dashboards show estimated finish times and countdowns. The participant interface displays Knight Hacks IX filament and session guidance. The changes also update API validation, audit data, tests, and rollout documentation.



Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to df1f1

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 | Passed 7 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 13.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 19 files. (5 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (7 passed)
Check name Status Explanation
Linked Issues check Passed Issue #617 requirements are implemented. The PR adds the KHIX filament and session-policy guidance, queue counts and positions, held-request handling, project priority, duration entry with over-limit …
Out of Scope Changes check Passed The changes stay within issue #617. The feature status and specification documents record the printing rollout and requirements. Runtime changes are limited to the shared printing API, validators, con…
No Hardcoded Secrets Passed No hardcoded API keys, passwords, tokens, or secrets were introduced. The added lines contain ordinary UI text, printing constants, endpoint names, and issue/PR URLs. Credential-format and credential-…
Validated Env Access Passed No new direct process.env usage appears in the pull-request diff. The only occurrence in a changed source file is the pre-existing process.env.DATABASE_URL line in `packages/api/src/tests/integrat…
No Typescript Escape Hatches Passed The pull-request TypeScript diff introduces no any types, @ts-ignore, @ts-expect-error, or non-null assertions. Matches for any are only ordinary text such as “any minute now” and test data.
Title check Passed The title starts with the required bracketed issue number, describes the printing queue and duration changes, and is 54 characters long.
Description check Passed The description directly explains the printing queue, duration timer, filament guidance, testing, and rollout scope covered by the changeset.

Full details: Docstring Coverage

Explanation

Docstring coverage is 13.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 19 files. (5 skipped: 5 unsupported.)


  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR





🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 win

Update 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 #618 is 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
📥 Commits

Reviewing files that changed from the base of the PR and between 349574e and 3b4dbcc.

⛔ Files ignored due to path filters (1)
  • packages/api/src/tests/root/__snapshots__/api-surface.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (2)
  • .forge/features/printing-categories/status.md
  • packages/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>
@Adr1an04 Adr1an04 added Blade Change modifies code in Blade app Hack Sites Change modifies code in a Hackathon app (ex. 2025) and removed Minor Small change - 1 reviewer required labels Oct 10, 2026
@Adr1an04 Adr1an04 changed the title [#617] Register printing category endpoint in API contract checks [#617] Clarify printing queues and add duration timers Oct 10, 2026
@Adr1an04 Adr1an04 added UI Changes modifies code in the global UI package Feature New Feature or Request Major Big change - 2+ reviewers required labels Oct 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 win

Allow 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 omit durationMinutes only 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
📥 Commits

Reviewing files that changed from the base of the PR and between 3b4dbcc and df1f13b.

📒 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.md
  • apps/2026/src/app/(portal)/_components/hacker-printing.module.css
  • apps/2026/src/app/(portal)/_components/hacker-printing.tsx
  • apps/2026/src/app/(portal)/_components/new-print-job-form.tsx
  • apps/2026/src/app/(portal)/_components/printing-guidelines.tsx
  • apps/blade/src/app/_components/admin/printing/print-duration-fields.tsx
  • apps/blade/src/app/_components/admin/printing/print-job-dialog.tsx
  • apps/blade/src/app/_components/admin/printing/print-queue-format.ts
  • apps/blade/src/app/_components/admin/printing/printing-queue-workspace.tsx
  • apps/blade/src/tests/e2e/printing-availability.spec.ts
  • apps/blade/src/tests/e2e/printing-portal.spec.ts
  • packages/api/src/hacker-portal/printing.ts
  • packages/api/src/routers/printing.ts
  • packages/api/src/tests/integration/printing.test.ts
  • packages/api/src/utils/printing/queue.ts
  • packages/consts/src/printing.ts
  • packages/ui/src/countdown.tsx
  • packages/validators/src/audit.ts
  • packages/validators/src/hacker-portal.ts
  • packages/validators/src/printing.ts
  • packages/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.

@Adr1an04
Adr1an04 merged commit d8fa137 into main Oct 10, 2026
13 checks passed
@Adr1an04
Adr1an04 deleted the codex/printing-category-ci branch October 10, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Change modifies code in the global API/tRPC package Blade Change modifies code in Blade app Bug Something isn't working Feature New Feature or Request Hack Sites Change modifies code in a Hackathon app (ex. 2025) Major Big change - 2+ reviewers required UI Changes modifies code in the global UI package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify printing queues and add duration timers

1 participant