Repository navigation
Open-envoy Dashboard Demo - #19
Conversation
|
|
||
| // Line item row component with inline comments | ||
| function LineItemRow({ lineItem, jobId }: { lineItem: JobLineItem; jobId: string }) { | ||
| const [showComments, setShowComments] = useState(false) |
There was a problem hiding this comment.
Bug: Unused state makes line item comments unreachable
The showComments state in LineItemRow is initialized to false but setShowComments is never called anywhere in the component. This means the conditional rendering block for VeltInlineCommentsSection (lines 51-60) will never be visible. The inline comments feature for individual line items is effectively dead code since users have no way to toggle this state.
Additional Locations (1)
| setTimeout(() => { | ||
| onSubmit() | ||
| }, 1500) | ||
| } |
There was a problem hiding this comment.
Bug: User comment input is never persisted or saved
The handleSubmit function never actually saves or persists the comment value. It only simulates a delay with setTimeout, then shows a success message claiming "Your comment has been added to this job." The VeltCommentTool is hidden and never programmatically triggered, and the comment content is not passed to onSubmit or any API. Users will lose their input while being told it was saved, and the UI note about "audit purposes" is misleading since nothing is recorded.
| window.history.pushState({}, '', newUrl); | ||
|
|
||
| setDocumentId(docId); | ||
| } |
There was a problem hiding this comment.
Bug: Missing try-catch around localStorage operations
The useCurrentDocument hook calls localStorage.setItem and localStorage.getItem without try-catch protection on lines 48, 51, and 57. This is inconsistent with AppUserContext.tsx which wraps all storage operations in try-catch blocks. If localStorage is unavailable (private browsing, quota exceeded, security restrictions), the component will throw an unhandled exception and crash the application.
| rows={4} | ||
| className={`w-full px-3 py-2 border rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none ${ | ||
| config.required && !comment.trim() ? 'border-gray-300' : 'border-gray-300' | ||
| }`} |
There was a problem hiding this comment.
Bug: Dead conditional returns same value for both branches
The ternary expression config.required && !comment.trim() ? 'border-gray-300' : 'border-gray-300' returns 'border-gray-300' for both true and false conditions, making the conditional pointless. This appears to be a copy-paste error where a different border color (likely red for validation feedback) was intended when a required comment is missing.
|
|
||
| return ( | ||
| <VeltProvider | ||
| apiKey={process.env.NEXT_PUBLIC_VELT_API_KEY || '6xTcUFtlYAlCdh11zrKB'} |
There was a problem hiding this comment.
Bug: Hardcoded API key committed to repository
A Velt API key '6xTcUFtlYAlCdh11zrKB' is hardcoded as a fallback value in the VeltProvider configuration. API keys should not be committed to the repository, even as fallbacks. If this is intentional for demo purposes, consider documenting it clearly; otherwise, the fallback should be removed so the app fails gracefully when the environment variable is missing.
| <span className="flex-1 text-sm font-medium text-red-900">Dispute</span> | ||
| <span className="text-2xl font-semibold text-red-700">6</span> | ||
| </div> | ||
| </div> |
There was a problem hiding this comment.
Bug: Summary card counts don't match actual job data
The summary cards display hardcoded counts that don't match the actual jobsData. The "Review & approve" card shows 2 but there are 4 jobs with statusType: 'review' (OE0002, OE0004, OE0005, OE0013). The "Dispute" card shows 6 but there's only 1 job with statusType: 'dispute' (OE0009). These counts appear to be placeholder values that were never updated to reflect the actual data, creating a misleading dashboard summary.
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Pull Request
Description
Type of Change
Monorepo Structure Checklist
If adding a new demo, ensure you've followed the 5-level structure:
apps/<framework>/<document>/<type>/<implementation>/<library-or-solution>/<demo>/package.jsonwith scoped name:@apps/<framework>-<document>-<library-or-solution>-<demo>pnpm --filter <package-name> buildpnpm --filter <package-name> devDeployment Checklist
If this demo should be deployed:
Testing
pnpm -w install && pnpm -w buildDocumentation
master-sample-app(if applicable)Related Issues
Screenshots/Videos
Additional Context
For Reviewers
Demo Location
Path:
apps/<framework>/<document>/<type>/<implementation>/<library-or-solution>/<demo>/Package name:
@apps/<...>How to Test
Structure Verification
The demo follows the 5-level hierarchy:
Documentation: See README_MONOREPO.md and docs/structure.md for more details on the monorepo structure.
Note
Adds a Next.js React demo at
apps/react/comments/dashboard/inline-comments/open-envoy-demoshowcasing inline comments with Velt, including backend token route, demo auth, and dashboard UI.apps/react/comments/dashboard/inline-comments/open-envoy-democomponents/document/document-canvas.tsxwith per-row comment tools/bubbles and a right-side inline comments sidebar (VeltInlineCommentsSection).components/document/JobDetailModal.tsxwith job-level and line-item inline comments; actions viaActionModal.tsxthat capture audit comments.app/page.tsx,components/velt/VeltCollaboration.tsx,components/velt/ui-customization/*.app/document/DocumentContext.tsx,components/velt/VeltInitializeDocument.tsx.app/userAuth/*,components/velt/VeltInitializeUser.tsx.app/api/velt/token/route.ts(callsapi.velt.devusing env vars).components/header/header.tsx(presence, sidebar button, notifications) andcomponents/sidebar/sidebar.tsx(embeddedVeltNotificationsPanel).styles/globals.css,tailwind.config.js,postcss.config.js), Next config, TS config,components.json, andpackage.jsonwith dependencies.README.mdwith setup, run, and structure instructions.Written by Cursor Bugbot for commit 5545b4a. This will update automatically on new commits. Configure here.