Skip to content

feat: Business Production Cookbook dashboard (production-cookbook/) - #243

Open
Tarik Skalić (tarikskalic33) wants to merge 2 commits into
mainfrom
feat/production-cookbook-dashboard
Open

feat: Business Production Cookbook dashboard (production-cookbook/)#243
Tarik Skalić (tarikskalic33) wants to merge 2 commits into
mainfrom
feat/production-cookbook-dashboard

Conversation

@tarikskalic33

Copy link
Copy Markdown
Member

Standalone React/Vite production-management dashboard under production-cookbook/, driven from the repo root via npm run dev:batchbook / build:batchbook / preview:batchbook.

What's on the branch

2229 insertions across 8 files (origin/main...c3801ff1):

File Lines
production-cookbook/src/main.jsx 235
production-cookbook/src/styles.css 101
production-cookbook/package-lock.json 1846
production-cookbook/package.json 20
production-cookbook/index.html 15
production-cookbook/public/favicon.svg 5
package.json 5
.claude.json 6

Two commits: 9072f39a feat: add Business Production Cookbook dashboard and c3801ff1 chore(manifest): refresh cognitive-state anchors.

Known conflict — one file, generated

The branch is 14 commits behind and 2 ahead of main, and git merge-tree reports a single conflict:

CONFLICT (content): Merge conflict in .claude.json

Every production-cookbook/** file and the root package.json merge cleanly. .claude.json is the generated cognitive manifest (scripts/build-cognitive-manifest.py); main and this branch each rewrote the same source_ref / parent_state_hash / state_hash lines. The fix is to regenerate the manifest on top of current main rather than hand-resolve the hashes — deliberately not done here, since it requires a merge/rebase that needs operator authorization.

Verification provenance

Reported by the prior session, not independently re-run in this one: npm install clean, npm run build passing, desktop and mobile render, batch filtering, new-batch notification, no console errors.

Independently verified here, by command:

  • 9072f39a and c3801ff1 both resolve via git cat-file after fetch
  • remote tip is c3801ff1, one commit ahead of the 9072f39a named in the handoff
  • production-cookbook/src/main.jsx is 11,358 bytes with 14 component/hook definitions — real implementation, not a stub
  • the three *:batchbook scripts are present in the root package.json at the tip
  • the conflict set above

No deployment or merge is claimed.

🤖 Generated with Claude Code

@cloudflare-workers-and-pages

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
aegisomega c3801ff Commit Preview URL

Branch Preview URL
Jul 28 2026, 04:26 PM

@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hook-generator Ready Ready Preview Jul 29, 2026 8:33pm
hub Ready Ready Preview Jul 29, 2026 8:33pm
platform-picker Ready Ready Preview Jul 29, 2026 8:33pm

@qodo-code-review

qodo-code-review Bot commented Jul 29, 2026

Copy link
Copy Markdown

PR Summary by Qodo

Add standalone Production Cookbook dashboard (React/Vite) under production-cookbook/

✨ Enhancement ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Add standalone React/Vite production dashboard UI under production-cookbook/.
• Wire root npm scripts to dev/build/preview the dashboard via --prefix.
• Refresh generated cognitive manifest metadata (may require regeneration when rebasing).
Diagram

graph TD
  A["Root package.json"] --> B["production-cookbook/package.json"] --> C["Vite toolchain"] --> D["index.html"] --> E["src/main.jsx"] --> G["Browser UI"]
  E --> F["src/styles.css"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Make `production-cookbook` a workspace package
  • ➕ Single top-level install and lockfile management
  • ➕ Easier CI integration (lint/test/build) and consistent Node/tooling constraints
  • ➕ Avoids potential version drift across subprojects
  • ➖ More monorepo wiring (workspaces config, dependency hoisting considerations)
  • ➖ May be premature if this is intended as a disposable prototype
2. Integrate into an existing frontend shell (if one exists)
  • ➕ Shared routing/layout/auth patterns and a consistent design system
  • ➕ Avoids duplicating React/Vite/tooling stacks
  • ➖ Higher coupling to existing app architecture
  • ➖ Harder to keep as a standalone deliverable or experiment
3. Scaffold with a component library (e.g., MUI/Chakra/Tailwind)
  • ➕ Faster iteration on complex dashboard UI patterns
  • ➕ More consistent accessibility defaults for common components
  • ➖ Heavier dependency surface and styling constraints
  • ➖ May conflict with desired bespoke visual identity

Recommendation: For an isolated, quickly-reviewable prototype, the current approach (standalone Vite app + root proxy scripts) is a good fit and keeps the existing repo largely untouched. If this dashboard is expected to live long-term, consider promoting it to a workspace package to centralize dependency management and CI checks; also plan for shared auth/data integration rather than expanding hardcoded mock data.

Files changed (8) +2229 / -4

Enhancement (4) +356 / -0
index.htmlAdd Vite HTML entrypoint for dashboard +15/-0

Add Vite HTML entrypoint for dashboard

• Introduces the standalone app's HTML shell with metadata (theme color/description) and mounts the React application at '#root' via 'src/main.jsx'.

production-cookbook/index.html

favicon.svgAdd dashboard favicon asset +5/-0

Add dashboard favicon asset

• Adds an SVG favicon matching the dashboard's navy/green palette for branding in browser tabs and bookmarks.

production-cookbook/public/favicon.svg

main.jsxImplement dashboard UI (sidebar, metrics, tables, yield chart) +235/-0

Implement dashboard UI (sidebar, metrics, tables, yield chart)

• Implements the React application entrypoint and core components (sidebar navigation, metric cards, production table filtering, yield SVG chart, and toast notifications). Uses local mock data for batches/stock/orders and sets up responsive navigation behavior.

production-cookbook/src/main.jsx

styles.cssAdd full dashboard styling and responsive layout +101/-0

Add full dashboard styling and responsive layout

• Defines the dashboard visual system (colors, layout grid, typography) and component styles for navigation, panels, tables, chart, and toast notifications. Includes breakpoints for tablet/mobile and reduced-motion handling.

production-cookbook/src/styles.css

Other (4) +1873 / -4
.claude.jsonUpdate generated cognitive manifest provenance/state hash +3/-3

Update generated cognitive manifest provenance/state hash

• Updates the manifest provenance to point at the new branch/source_ref and refreshes the stored state hashes. This file is generated and will likely need regeneration after rebasing onto main rather than manual conflict resolution.

.claude.json

package.jsonAdd root scripts to run/build/preview production-cookbook app +4/-1

Add root scripts to run/build/preview production-cookbook app

• Extends the root npm scripts with 'dev:batchbook', 'build:batchbook', and 'preview:batchbook', delegating execution to the 'production-cookbook/' folder via 'npm --prefix'. Keeps existing backend dev script as the default 'dev' entrypoint.

package.json

package-lock.jsonLock dependencies for production-cookbook app +1846/-0

Lock dependencies for production-cookbook app

• Adds a new lockfile capturing the exact dependency graph for the standalone dashboard (React, Vite, lucide-react, and transitive packages). Large, generated content; reviewers typically spot-check top-level versions and Node engine compatibility.

production-cookbook/package-lock.json

package.jsonDefine standalone dashboard package and Vite scripts +20/-0

Define standalone dashboard package and Vite scripts

• Creates a new private package for the dashboard with 'vite' dev/build/preview scripts. Declares runtime dependencies on React and lucide-react and dev dependencies on Vite and the React plugin.

production-cookbook/package.json

@qodo-code-review

qodo-code-review Bot commented Jul 29, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (4) 📘 Rule violations (1) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 11 rules

Grey Divider


Action required

1. Batchbook scripts won't run 🐞 Bug ☼ Reliability
Description
The new root scripts (dev:batchbook/build:batchbook/preview:batchbook) run `npm ... --prefix
production-cookbook, but a standard repo-root npm ci/install` will not install
production-cookbook dependencies because it is not part of the root workspace set, so these
scripts can fail with missing vite/React modules on a clean checkout.
Code

package.json[R7-9]

+    "dev:batchbook": "npm run dev --prefix production-cookbook",
+    "build:batchbook": "npm run build --prefix production-cookbook",
+    "preview:batchbook": "npm run preview --prefix production-cookbook"
Relevance

●●● Strong

Reliability fixes ensuring needed npm binaries/deps exist are usually accepted.

PR-#213

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR adds scripts that run commands inside production-cookbook/, but the root workspace
configuration/install scope does not include that package, so its dependencies will not be present
unless installed separately (e.g., by running npm ci inside production-cookbook/).

package.json[1-10]
package-lock.json[6-15]
production-cookbook/package.json[1-20]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Root-level scripts invoke `production-cookbook` via `--prefix`, but the repo-root install does not install `production-cookbook/node_modules` because it is not part of the root workspace set. This makes `npm run dev:batchbook` / `build:batchbook` / `preview:batchbook` unreliable on a clean checkout.

### Issue Context
- Root `package.json` only lists `backend` in `workspaces`.
- The new scripts run in `production-cookbook/`, which has its own `package.json` and dependencies.

### Fix
Choose one:
1) **Recommended:** add `production-cookbook` to root `workspaces` and regenerate the **root** `package-lock.json` so `npm ci` at the repo root installs it.
2) Alternatively, make the root scripts install before running, e.g. `npm ci --prefix production-cookbook && npm run dev --prefix production-cookbook` (slower, but self-contained).

### Fix Focus Areas
- package.json[1-10]
- package-lock.json[6-15]
- production-cookbook/package.json[1-20]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. React plugin not wired 🐞 Bug ⚙ Maintainability ⭐ New
Description
production-cookbook declares @vitejs/plugin-react but does not introduce a Vite config to register
react(), so the added dependency is effectively unused and React-specific dev features (notably Fast
Refresh) won’t be enabled for this app. This is configuration/dependency drift that will confuse
maintenance and inflate installs.
Code

production-cookbook/package.json[R16-18]

+  "devDependencies": {
+    "@vitejs/plugin-react": "^4.3.4",
+    "vite": "^6.0.5"
Relevance

●●● Strong

Team tends to accept wiring/“WIRED vs ORPHAN” drift fixes; missing Vite react() config is
actionable.

PR-#189

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new app declares the React Vite plugin dependency, but Vite only applies that plugin when it is
registered via a Vite config; this PR doesn’t add such a config for production-cookbook, while other
repo Vite apps do register it explicitly.

production-cookbook/package.json[6-19]
cockpit/vite.config.ts[1-7]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`production-cookbook/package.json` adds `@vitejs/plugin-react`, but this PR does not add a `vite.config.*` for the package to register `react()`.

## Issue Context
Other Vite apps in this repo explicitly register `@vitejs/plugin-react` in `vite.config.ts`, so this new app is inconsistent and likely missing expected React dev tooling.

## Fix Focus Areas
- production-cookbook/package.json[6-19]
- production-cookbook/vite.config.js[1-25]

## Suggested fix
Either:
1) Add `production-cookbook/vite.config.js` (or `.ts`) with:
```js
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
 plugins: [react()],
})
```

OR
2) If you intentionally don’t want the plugin, remove `@vitejs/plugin-react` from `devDependencies` (and update the lockfile accordingly).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Toast timeout race 🐞 Bug ≡ Correctness
Description
notify() schedules a new timeout on every call without canceling prior timeouts, so a later toast
can be cleared early by an earlier timer and multiple timers will keep firing redundant
setNotice("") updates.
Code

production-cookbook/src/main.jsx[R156-159]

+  const notify = (message) => {
+    setNotice(message);
+    window.setTimeout(() => setNotice(""), 2800);
+  };
Relevance

●●● Strong

Trivial local bugfix (track+clear timeout) likely accepted; no strong contrary precedent found.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The implementation of notify() shows a one-shot timeout is created per call and none are tracked
or cleared, which directly enables the overlapping-timer clearing behavior.

production-cookbook/src/main.jsx[150-159]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The toast notification logic schedules overlapping timers. If the user triggers notifications quickly, an older timer can clear a newer message early.

### Issue Context
`notify()` calls `window.setTimeout(() => setNotice(""), 2800)` but does not retain/clear the timeout id.

### Fix
- Store the timeout id in a `useRef`.
- On each `notify()`, `clearTimeout(ref.current)` before scheduling a new timeout.
- Add an effect cleanup to clear any pending timeout on unmount.

### Fix Focus Areas
- production-cookbook/src/main.jsx[150-160]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

4. Status class normalization 🐞 Bug ≡ Correctness ⭐ New
Description
Status() normalizes the status label with value.toLowerCase().replace(" ", "-"), which only replaces
the first space; any future multi-word status will yield extra whitespace-separated class tokens and
won’t match the intended status--* selector. This is latent today because the seeded statuses
contain at most one space.
Code

production-cookbook/src/main.jsx[R108-110]

+function Status({ value }) {
+  const variant = value.toLowerCase().replace(" ", "-");
+  return <span className={`status status--${variant}`}>{value === "Completed" ? <CheckCircle2 size={15} /> : value === "Planned" ? <Clock3 size={15} /> : <Circle size={15} />} {value}</span>;
Relevance

●●● Strong

Small deterministic correctness hardening (multi-word class normalization) is typically accepted.

PR-#224

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The JS generates a status--${variant} class from the raw status string, while the CSS expects
dash-delimited variants like status--in-progress; if the variant still contains spaces, the
browser splits it into multiple classes and the selector won’t match.

production-cookbook/src/main.jsx[108-111]
production-cookbook/src/styles.css[68-69]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`Status()` derives a CSS variant using `replace(" ", "-")`, which only replaces the first space, causing incorrect class tokenization for statuses with more than one whitespace.

## Issue Context
CSS styling depends on exact `status--<variant>` class names.

## Fix Focus Areas
- production-cookbook/src/main.jsx[108-111]

## Suggested fix
Use a safer normalizer, e.g.:
```js
const variant = value.toLowerCase().trim().replace(/\s+/g, "-");
```
Optionally, prefer an explicit mapping (e.g., `{ "In progress": "in-progress", ... }`) to decouple display text from CSS identifiers.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. dev:batchbook skips verify-hashes.mjs 📘 Rule violation ≡ Correctness
Description
New/modified npm scripts for the root and production-cookbook start dev/build/preview flows
without running verify-hashes.mjs first, so sessions or build steps can proceed without the
required verification gate. This violates the requirement that verification must gate session start
and fail closed on non-zero exit.
Code

package.json[R4-9]

  "scripts": {
    "dev-backend": "npm run dev --prefix backend",
-    "dev": "npm run dev-backend"
+    "dev": "npm run dev-backend",
+    "dev:batchbook": "npm run dev --prefix production-cookbook",
+    "build:batchbook": "npm run build --prefix production-cookbook",
+    "preview:batchbook": "npm run preview --prefix production-cookbook"
Relevance

● Weak

Very similar verify-hashes gating suggestions were rejected previously.

PR-#188
PR-#187

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 1073159 requires verify-hashes.mjs to succeed before starting interactive
sessions or running build steps. The cited script changes show the root package.json directly
invoking npm run dev/build/preview --prefix production-cookbook (and dev also runs backend dev)
and the production-cookbook/package.json scripts invoking vite / vite build / vite preview,
with no preceding node ...verify-hashes.mjs (or equivalent) command to gate execution and abort on
failure.

Rule 1073159: Require verify-hashes.mjs to succeed before starting sessions or applying code changes
package.json[4-9]
production-cookbook/package.json[6-9]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Root and `production-cookbook` `package.json` scripts (`dev`, `dev:batchbook`, `build:batchbook`, `preview:batchbook`, and the Vite `dev/build/preview` scripts) start dev servers and build/preview flows without first running `verify-hashes.mjs`, allowing sessions/build steps to run without mandatory hash verification.

## Issue Context
PR Compliance ID 1073159 requires `verify-hashes.mjs` (or an equivalent verification command) to run before starting interactive sessions or running build steps, and to abort/fail closed if verification exits non-zero. Update the relevant scripts so verification runs first and blocks subsequent commands when it fails.

## Fix Focus Areas
- package.json[4-9]
- production-cookbook/package.json[6-9]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Previous review results

Review updated until commit c3801ff ⚖️ Balanced

Results up to commit c3801ff ⚖️ Balanced


🐞 Bugs (2) 📘 Rule violations (1) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required
1. Batchbook scripts won't run 🐞 Bug ☼ Reliability
Description
The new root scripts (dev:batchbook/build:batchbook/preview:batchbook) run `npm ... --prefix
production-cookbook, but a standard repo-root npm ci/install` will not install
production-cookbook dependencies because it is not part of the root workspace set, so these
scripts can fail with missing vite/React modules on a clean checkout.
Code

package.json[R7-9]

+    "dev:batchbook": "npm run dev --prefix production-cookbook",
+    "build:batchbook": "npm run build --prefix production-cookbook",
+    "preview:batchbook": "npm run preview --prefix production-cookbook"
Relevance

●●● Strong

Reliability fixes ensuring needed npm binaries/deps exist are usually accepted.

PR-#213

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR adds scripts that run commands inside production-cookbook/, but the root workspace
configuration/install scope does not include that package, so its dependencies will not be present
unless installed separately (e.g., by running npm ci inside production-cookbook/).

package.json[1-10]
package-lock.json[6-15]
production-cookbook/package.json[1-20]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Root-level scripts invoke `production-cookbook` via `--prefix`, but the repo-root install does not install `production-cookbook/node_modules` because it is not part of the root workspace set. This makes `npm run dev:batchbook` / `build:batchbook` / `preview:batchbook` unreliable on a clean checkout.

### Issue Context
- Root `package.json` only lists `backend` in `workspaces`.
- The new scripts run in `production-cookbook/`, which has its own `package.json` and dependencies.

### Fix
Choose one:
1) **Recommended:** add `production-cookbook` to root `workspaces` and regenerate the **root** `package-lock.json` so `npm ci` at the repo root installs it.
2) Alternatively, make the root scripts install before running, e.g. `npm ci --prefix production-cookbook && npm run dev --prefix production-cookbook` (slower, but self-contained).

### Fix Focus Areas
- package.json[1-10]
- package-lock.json[6-15]
- production-cookbook/package.json[1-20]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended
2. Toast timeout race 🐞 Bug ≡ Correctness
Description
notify() schedules a new timeout on every call without canceling prior timeouts, so a later toast
can be cleared early by an earlier timer and multiple timers will keep firing redundant
setNotice("") updates.
Code

production-cookbook/src/main.jsx[R156-159]

+  const notify = (message) => {
+    setNotice(message);
+    window.setTimeout(() => setNotice(""), 2800);
+  };
Relevance

●●● Strong

Trivial local bugfix (track+clear timeout) likely accepted; no strong contrary precedent found.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The implementation of notify() shows a one-shot timeout is created per call and none are tracked
or cleared, which directly enables the overlapping-timer clearing behavior.

production-cookbook/src/main.jsx[150-159]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The toast notification logic schedules overlapping timers. If the user triggers notifications quickly, an older timer can clear a newer message early.

### Issue Context
`notify()` calls `window.setTimeout(() => setNotice(""), 2800)` but does not retain/clear the timeout id.

### Fix
- Store the timeout id in a `useRef`.
- On each `notify()`, `clearTimeout(ref.current)` before scheduling a new timeout.
- Add an effect cleanup to clear any pending timeout on unmount.

### Fix Focus Areas
- production-cookbook/src/main.jsx[150-160]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational
3. dev:batchbook skips verify-hashes.mjs 📘 Rule violation ≡ Correctness
Description
New/modified npm scripts for the root and production-cookbook start dev/build/preview flows
without running verify-hashes.mjs first, so sessions or build steps can proceed without the
required verification gate. This violates the requirement that verification must gate session start
and fail closed on non-zero exit.
Code

package.json[R4-9]

  "scripts": {
    "dev-backend": "npm run dev --prefix backend",
-    "dev": "npm run dev-backend"
+    "dev": "npm run dev-backend",
+    "dev:batchbook": "npm run dev --prefix production-cookbook",
+    "build:batchbook": "npm run build --prefix production-cookbook",
+    "preview:batchbook": "npm run preview --prefix production-cookbook"
Relevance

● Weak

Very similar verify-hashes gating suggestions were rejected previously.

PR-#188
PR-#187

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 1073159 requires verify-hashes.mjs to succeed before starting interactive
sessions or running build steps. The cited script changes show the root package.json directly
invoking npm run dev/build/preview --prefix production-cookbook (and dev also runs backend dev)
and the production-cookbook/package.json scripts invoking vite / vite build / vite preview,
with no preceding node ...verify-hashes.mjs (or equivalent) command to gate execution and abort on
failure.

Rule 1073159: Require verify-hashes.mjs to succeed before starting sessions or applying code changes
package.json[4-9]
production-cookbook/package.json[6-9]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Root and `production-cookbook` `package.json` scripts (`dev`, `dev:batchbook`, `build:batchbook`, `preview:batchbook`, and the Vite `dev/build/preview` scripts) start dev servers and build/preview flows without first running `verify-hashes.mjs`, allowing sessions/build steps to run without mandatory hash verification.

## Issue Context
PR Compliance ID 1073159 requires `verify-hashes.mjs` (or an equivalent verification command) to run before starting interactive sessions or running build steps, and to abort/fail closed if verification exits non-zero. Update the relevant scripts so verification runs first and blocks subsequent commands when it fails.

## Fix Focus Areas
- package.json[4-9]
- production-cookbook/package.json[6-9]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Qodo Logo

Comment thread package.json
Comment on lines +7 to +9
"dev:batchbook": "npm run dev --prefix production-cookbook",
"build:batchbook": "npm run build --prefix production-cookbook",
"preview:batchbook": "npm run preview --prefix production-cookbook"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

2. Batchbook scripts won't run 🐞 Bug ☼ Reliability

The new root scripts (dev:batchbook/build:batchbook/preview:batchbook) run `npm ... --prefix
production-cookbook, but a standard repo-root npm ci/install` will not install
production-cookbook dependencies because it is not part of the root workspace set, so these
scripts can fail with missing vite/React modules on a clean checkout.
Agent Prompt
### Issue description
Root-level scripts invoke `production-cookbook` via `--prefix`, but the repo-root install does not install `production-cookbook/node_modules` because it is not part of the root workspace set. This makes `npm run dev:batchbook` / `build:batchbook` / `preview:batchbook` unreliable on a clean checkout.

### Issue Context
- Root `package.json` only lists `backend` in `workspaces`.
- The new scripts run in `production-cookbook/`, which has its own `package.json` and dependencies.

### Fix
Choose one:
1) **Recommended:** add `production-cookbook` to root `workspaces` and regenerate the **root** `package-lock.json` so `npm ci` at the repo root installs it.
2) Alternatively, make the root scripts install before running, e.g. `npm ci --prefix production-cookbook && npm run dev --prefix production-cookbook` (slower, but self-contained).

### Fix Focus Areas
- package.json[1-10]
- package-lock.json[6-15]
- production-cookbook/package.json[1-20]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +156 to +159
const notify = (message) => {
setNotice(message);
window.setTimeout(() => setNotice(""), 2800);
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

3. Toast timeout race 🐞 Bug ≡ Correctness

notify() schedules a new timeout on every call without canceling prior timeouts, so a later toast
can be cleared early by an earlier timer and multiple timers will keep firing redundant
setNotice("") updates.
Agent Prompt
### Issue description
The toast notification logic schedules overlapping timers. If the user triggers notifications quickly, an older timer can clear a newer message early.

### Issue Context
`notify()` calls `window.setTimeout(() => setNotice(""), 2800)` but does not retain/clear the timeout id.

### Fix
- Store the timeout id in a `useRef`.
- On each `notify()`, `clearTimeout(ref.current)` before scheduling a new timeout.
- Add an effect cleanup to clear any pending timeout on unmount.

### Fix Focus Areas
- production-cookbook/src/main.jsx[150-160]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c3801ff141

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment thread package.json
Comment on lines +7 to +9
"dev:batchbook": "npm run dev --prefix production-cookbook",
"build:batchbook": "npm run build --prefix production-cookbook",
"preview:batchbook": "npm run preview --prefix production-cookbook"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Make Batchbook root scripts install their deps

In a fresh checkout where contributors run the normal root install, these new root entrypoints don't have Batchbook's dependencies available because production-cookbook is not included in the root workspaces (the workspace list is still only backend) and the root lockfile does not include it. I verified the root entrypoint exits with sh: 1: vite: not found when production-cookbook/node_modules is absent, so the advertised npm run build:batchbook/dev/preview commands require an undocumented second install inside the subdirectory. Please add this app to the root workspace/update the root lock, or make the scripts bootstrap/use the subproject dependencies explicitly.

Useful? React with 👍 / 👎.

return (
<>
{open && <button className="scrim" aria-label="Close navigation" onClick={onClose} />}
<aside className={`sidebar ${open ? "sidebar--open" : ""}`}>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Prevent hidden mobile sidebar from receiving focus

On mobile widths the CSS hides .sidebar only with transform: translateX(-100%) (production-cookbook/src/styles.css:89), but this aside stays mounted and its nav buttons remain focusable when open is false. Keyboard and screen-reader users can therefore tab into an invisible navigation panel before reaching the page content; make the closed sidebar inert/aria-hidden or unmount/disable its controls until it is opened.

Useful? React with 👍 / 👎.

@ghost
ghost marked this pull request as draft July 31, 2026 19:18
@tarikskalic33
Tarik Skalić (tarikskalic33) marked this pull request as ready for review July 31, 2026 21:32
Comment on lines +16 to +18
"devDependencies": {
"@vitejs/plugin-react": "^4.3.4",
"vite": "^6.0.5"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

1. React plugin not wired 🐞 Bug ⚙ Maintainability

production-cookbook declares @vitejs/plugin-react but does not introduce a Vite config to register
react(), so the added dependency is effectively unused and React-specific dev features (notably Fast
Refresh) won’t be enabled for this app. This is configuration/dependency drift that will confuse
maintenance and inflate installs.
Agent Prompt
## Issue description
`production-cookbook/package.json` adds `@vitejs/plugin-react`, but this PR does not add a `vite.config.*` for the package to register `react()`.

## Issue Context
Other Vite apps in this repo explicitly register `@vitejs/plugin-react` in `vite.config.ts`, so this new app is inconsistent and likely missing expected React dev tooling.

## Fix Focus Areas
- production-cookbook/package.json[6-19]
- production-cookbook/vite.config.js[1-25]

## Suggested fix
Either:
1) Add `production-cookbook/vite.config.js` (or `.ts`) with:
```js
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [react()],
})
```

OR
2) If you intentionally don’t want the plugin, remove `@vitejs/plugin-react` from `devDependencies` (and update the lockfile accordingly).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +108 to +110
function Status({ value }) {
const variant = value.toLowerCase().replace(" ", "-");
return <span className={`status status--${variant}`}>{value === "Completed" ? <CheckCircle2 size={15} /> : value === "Planned" ? <Clock3 size={15} /> : <Circle size={15} />} {value}</span>;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Informational

2. Status class normalization 🐞 Bug ≡ Correctness

Status() normalizes the status label with value.toLowerCase().replace(" ", "-"), which only replaces
the first space; any future multi-word status will yield extra whitespace-separated class tokens and
won’t match the intended status--* selector. This is latent today because the seeded statuses
contain at most one space.
Agent Prompt
## Issue description
`Status()` derives a CSS variant using `replace(" ", "-")`, which only replaces the first space, causing incorrect class tokenization for statuses with more than one whitespace.

## Issue Context
CSS styling depends on exact `status--<variant>` class names.

## Fix Focus Areas
- production-cookbook/src/main.jsx[108-111]

## Suggested fix
Use a safer normalizer, e.g.:
```js
const variant = value.toLowerCase().trim().replace(/\s+/g, "-");
```
Optionally, prefer an explicit mapping (e.g., `{ "In progress": "in-progress", ... }`) to decouple display text from CSS identifiers.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit c3801ff

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c3801ff141

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

<main>
<header className="topbar">
<div className="heading">
<button className="menu-button" onClick={() => setNavOpen(true)} aria-label="Open navigation"><Menu /></button>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Move focus into the mobile navigation drawer

On mobile widths, activating this button leaves focus on the opener while <Sidebar> is rendered before <main> in DOM order, so pressing Tab moves forward into the page controls behind the scrim instead of into the open navigation. Keyboard users can miss or be unable to operate the drawer unless they reverse-tab; move focus to the first drawer control when opening and keep background content out of the tab order while the drawer is open.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant