Skip to content

v5: "Report a problem" nav button that opens the chat pre-seeded#25

Merged
philosophercode merged 1 commit into
mainfrom
philosophercode/v5-report-button
Jun 2, 2026
Merged

v5: "Report a problem" nav button that opens the chat pre-seeded#25
philosophercode merged 1 commit into
mainfrom
philosophercode/v5-report-button

Conversation

@philosophercode

Copy link
Copy Markdown
Owner

What

Adds a maintenance-reporting entry point to the v5 app: a Report button in the top nav. Clicking it opens the chat assistant and auto-sends an opening message ("I'd like to report a problem."). The assistant then runs its existing diagnose-then-file flow — report_issue + photo upload to Notion + unit lookup — all of which already work.

This closes the biggest UX gap noted when comparing v4 → v5: v5 could only file tickets if a student happened to start a chat, with no visible "report an issue" affordance.

Approach

The chosen design (option A from brainstorming): a nav button that launches the chat, rather than a standalone v4-style form. It's the smallest change, reuses the entire working ticketing pipeline, and fits v5's "first-line helper" conversational design.

  • ChatLauncherProvider (new) owns only the launcher's open state + a one-shot seed message (with a nonce so repeat clicks re-trigger). Entry points outside ChatFab can now open and seed the chat; all conversation/message state stays inside ChatFab.
  • ChatFab consumes the context for open/close and auto-sends the seed via a nonce-guarded effect — idempotent (no resend on re-render) and waits for any in-flight turn before sending.
  • PrimaryNav gains an accent-styled Report button (mono/uppercase to match the nav).
  • Tool scoping is automatic: ChatFab already derives toolId from the URL, so reporting from a tool page is auto-scoped to that tool — no extra plumbing.
  • i18n: nav.report / nav.reportAria / nav.reportSeed added to all 12 locales with real translations (matching the existing translated message files).

Files

  • v5/src/components/ChatLauncherContext.tsx (new)
  • v5/src/app/layout.tsx — wrap chrome + ChatFab in the provider
  • v5/src/components/ChatFab.tsx — context-driven open/close + auto-send effect
  • v5/src/components/PrimaryNav.tsx — the Report button
  • v5/src/styles/globals.css.primary-nav-report
  • v5/messages/*.json — 12 locales

Verification

  • npm run build ✅ and npm run lint ✅ (in v5/)
  • Browser check: clicking Report opens the chat dialog and the seeded user message appears in the thread; the >_ FAB still opens the chat normally. (The assistant's reply needs ANTHROPIC_API_KEY, absent in local dev — not part of this change.)

Notes / not in scope

  • v5 has no test suite (no vitest), so verification is build + lint + manual browser check.
  • Future option discussed but deferred: a standalone /report form for a no-conversation "just log it" path.

🤖 Generated with Claude Code

Adds a maintenance-reporting entry point to the v5 nav. Clicking "Report"
opens the chat assistant and auto-sends an opening message, then the
assistant runs its existing diagnose-then-file flow (report_issue +
photo upload). When clicked on a tool page, the report is automatically
scoped to that tool via ChatFab's existing toolId-from-pathname context.

- New ChatLauncherProvider owns just the launcher's open state + a one-shot
  seed message, so entry points outside ChatFab can open and seed the chat.
  All conversation state stays inside ChatFab.
- ChatFab consumes the context for open/close and auto-sends the seed via a
  nonce-guarded effect (idempotent; waits for any in-flight turn).
- PrimaryNav gains an accent-styled Report button.
- i18n: nav.report / reportAria / reportSeed added to all 12 locales.

Verified: v5 build + lint pass; browser check confirms the button opens the
chat and the seeded message is sent (assistant reply requires ANTHROPIC_API_KEY).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 29, 2026 19:34
@vercel

vercel Bot commented May 29, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
makerlab-tools Ready Ready Preview, Comment May 29, 2026 7:35pm
makerlab-tools-g4gb Ready Ready Preview, Comment May 29, 2026 7:35pm

@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: 9517ec4d44

ℹ️ 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 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 address that feedback".

if (seedText) {
setPendingSeed((prev) => ({
text: seedText,
nonce: (prev?.nonce ?? 0) + 1,

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 Preserve seed nonce across consumed seeds

After ChatFab consumes a seed, pendingSeed is set back to null, so the next open(t("reportSeed")) call recomputes the nonce as 1 again. Since ChatFab keeps lastSeedNonce.current at 1, a user who clicks REPORT a second time after the first seeded turn has been sent will only open the sheet; the seed is skipped and no report prompt is sent. Keep a monotonic counter outside the consumed seed state (or otherwise make each seed unique after consumption).

Useful? React with 👍 / 👎.

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@philosophercode philosophercode merged commit f0b8643 into main Jun 2, 2026
3 of 4 checks passed
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.

2 participants