Skip to content

fix(frontend): make the dashboard build pass again (26 type errors since April) - #319

Merged
MervinPraison merged 1 commit into
mainfrom
fix/frontend-typecheck
Oct 27, 2026
Merged

MervinPraison merged 1 commit into
mainfrom
fix/frontend-typecheck

Conversation

@MervinPraison

Copy link
Copy Markdown
Owner

Root cause of the red frontend check on main, on every run since 2026-09-23.

That day 166091b added a frontend build gate (npm run build, i.e. tsc -b && vite build). Five PRs from April (#33, #34, #35 and two smaller ones) had left code that had never been compiled in CI, so the new gate failed on every run. The last green CI on main is b151143, from 23 Sep. Every open PR inherits the red check, including #318.

The 26 errors and their fixes:

Problem Fix
components/ui/alert and ui/textarea imported but never added add the standard shadcn components (same cva / @/lib/utils style as the others)
CustomElementHost lazy-imports 7 example widgets that never existed empty registry, with a comment showing how to register real components
useWindowMessage calls useSSE(url, {onMessage...}), but this package's useSSE is the chat streaming store small local EventSource hook for the existing /sse/window-message endpoint
SharedThread uses react-router-dom, which is not a dependency, and the wrong ChatMessages props read the token from /shared/{token} (the route server.py serves), pass the props ChatMessages takes, type messages as ChatMessage[]
unused imports and locals under noUnusedLocals removed

None of these files are imported by the app today, so nothing users see changes. The point is that the gate builds again, so it can catch real breakage.

Verified locally:

  • npm ci && npm run build now exits 0; on main it exits 2.
  • npm test: 8/8 pass.

🤖 Generated with Claude Code

…nce April)

The frontend build gate added on 2026-09-23 (166091b) has failed on every
main run since: five April PRs left code that never compiled — imports of
shadcn components that were never added (ui/alert, ui/textarea), seven
example widgets that never existed (CustomElementHost), react-router-dom
(not a dependency), a useSSE call written for a different hook, a wrong
ChatMessages prop set, and unused locals under noUnusedLocals.

- add the standard shadcn alert and textarea components
- CustomElementHost: empty registry instead of imports of missing widgets
- useWindowMessage: small local EventSource hook for /sse/window-message
- SharedThread: read the token from /shared/{token}; pass the props
  ChatMessages takes; type messages as ChatMessage[]
- drop unused imports/locals

None of these files are imported by the app today, so nothing users see
changes; the gate now builds and catches real breakage again.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 27, 2026 10:08

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 was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@MervinPraison
MervinPraison merged commit 4ab1eee into main Oct 27, 2026
17 checks passed
@MervinPraison

Copy link
Copy Markdown
Owner Author

@claude You are the FINAL architecture reviewer. If the branch is under MervinPraison/PraisonAIUI (not a fork), you are able to make modifications to this branch and push directly. SCOPE: Focus ONLY on PraisonAIUI (src/praisonaiui, src/frontend, tests, docs). Do NOT expand into praisonaiagents or the monorepo unless the PR explicitly requires it. Read ALL comments above from Gemini, Qodo, CodeRabbit, and Copilot carefully before responding.

Phase 1: Review per AGENTS.md

  1. Protocol-driven: check heavy implementations vs core SDK
  2. Backward compatible: ensure zero feature regressions
  3. Performance: no hot-path regressions (lazy imports, import-time <200ms)
  4. Product value: review in depth whether the change genuinely adds PraisonAIUI UX value — never add features for the sake of adding them. It must strengthen the UI (simpler, more user-friendly, robust). If it does not clearly add value, request changes or recommend rejecting/closing rather than merging scope creep.
  5. Layering: UI/frontend/server features here; core agent runtime belongs in praisonaiagents (PraisonAI monorepo). Agent-callable tools → PraisonAI-Tools. Do not pull monorepo or SDK scope into this repo unless the PR explicitly requires it.
  6. Do not bloat server.py or create_app() with new params — prefer existing YAML config, plugins, and feature modules; only add params if absolutely required. Reject knobs/exports with no live consumer.

Phase 2: FIX Valid Issues
5. For any VALID bugs or architectural flaws found by Gemini, CodeRabbit, Qodo, Copilot, or any other reviewer: implement the fix
6. Push all code fixes directly to THIS branch (do NOT create a new PR)
7. Comment a summary of exact files modified and what you skipped

Phase 3: Final Verdict
8. If all issues are resolved, approve the PR / close the Issue
9. If blocking issues remain, request changes / leave clear action items

@praisonai-triage-agent

Copy link
Copy Markdown
Contributor

Final architecture review: approve, no changes pushed

Reviewer feedback: none to act on. Copilot did not run because of a quota limit, and Gemini, Qodo and CodeRabbit left no comments. I reviewed the diff myself.

Checks against AGENTS.md

  1. Protocol and layering: frontend-only. The PR adds no SDK, server or monorepo scope, no new dependency, and nothing new in server.py or create_app().
  2. Backward compatibility: none of the changed files is imported by App.tsx today, so nothing users see changes. The parts that are wired to something stay consistent:
    • SharedThread reads the token from /shared/{token}. That matches Route("/shared/{token}") in server.py, and the JSON branch (keyed on Accept: application/json) returns thread_id, session, messages and read_only, which is what the page expects.
    • useWindowMessage uses a small local EventSource instead of the chat-store useSSE. It closes the connection on unmount and keeps handlers in a ref, so changing a callback does not reconnect.
  3. Performance: no hot-path or import-time impact.
  4. Product value: it brings back the frontend build check on main, which has failed on every run since 2026-09-23, so it can catch real breakage again. The new alert and textarea files are the standard shadcn ones, and modules already import them. No new knobs or exports without a consumer.

Verified locally (on 1dad99b)

  • npm ci && npm run build: exits 0.
  • npm test: 8/8 pass.
  • Merges cleanly onto current origin/main (ebbb5f8, v0.3.149).
  • CI on this PR: frontend, python (3.10), python (3.11) and python (3.12) all pass.

Files modified by this review: none.

Skipped, not blocking

  • In ActionButtons, hiddenActions can no longer be updated, because the setter was removed. That only states what was already true: the setter was never called. Wiring "hide on click" would be a feature, so it is out of scope here.
  • SharedThread passes the decoded token into fetch without encoding it again. Share tokens are URL-safe, so this has no effect in practice.

Verdict: ready to merge.

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