Skip to content

Open-envoy Dashboard Demo - #19

Merged
yoen-velt merged 5 commits into
mainfrom
open-envoy
Dec 16, 2025
Merged

yoen-velt merged 5 commits into
mainfrom
open-envoy

Conversation

@yoen-velt

@yoen-velt yoen-velt commented Dec 16, 2025 •

Copy link
Copy Markdown
Contributor

Pull Request

Description

Type of Change

  • New demo application
  • Bug fix
  • Feature enhancement
  • Documentation update
  • Infrastructure/tooling change
  • Other (please describe):

Monorepo Structure Checklist

If adding a new demo, ensure you've followed the 5-level structure:

  • Placed in correct path: apps/<framework>/<document>/<type>/<implementation>/<library-or-solution>/<demo>/
  • Updated package.json with scoped name: @apps/<framework>-<document>-<library-or-solution>-<demo>
  • Created comprehensive README.md in the demo directory
  • Verified build passes: pnpm --filter <package-name> build
  • Verified dev server runs: pnpm --filter <package-name> dev

Deployment Checklist

If this demo should be deployed:

  • Added/updated Vercel project configuration
  • Updated GitHub Actions workflows (if applicable)
  • Verified deployment paths in CI/CD configs

Testing

  • Tested locally with pnpm -w install && pnpm -w build
  • Verified all affected apps still build
  • Tested dev servers for affected apps

Documentation

  • Updated relevant documentation (if needed)
  • Added demo to master-sample-app (if applicable)
  • Updated deployment docs (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

# Install dependencies
pnpm -w install

# Run the specific demo
pnpm --filter @apps/<package-name> dev

# Build the specific demo
pnpm --filter @apps/<package-name> build

Structure Verification

The demo follows the 5-level hierarchy:

  1. Framework:
  2. Document:
  3. Type:
  4. Implementation:
  5. Library/Solution:
  6. Demo:

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-demo showcasing inline comments with Velt, including backend token route, demo auth, and dashboard UI.

  • Demo App (React/Next.js): apps/react/comments/dashboard/inline-comments/open-envoy-demo
    • Dashboard UI: components/document/document-canvas.tsx with per-row comment tools/bubbles and a right-side inline comments sidebar (VeltInlineCommentsSection).
    • Job Details: components/document/JobDetailModal.tsx with job-level and line-item inline comments; actions via ActionModal.tsx that capture audit comments.
    • Velt Integration:
      • Provider/wiring: app/page.tsx, components/velt/VeltCollaboration.tsx, components/velt/ui-customization/*.
      • Document scoping: app/document/DocumentContext.tsx, components/velt/VeltInitializeDocument.tsx.
      • Demo user auth + token gen: app/userAuth/*, components/velt/VeltInitializeUser.tsx.
      • Backend token route: app/api/velt/token/route.ts (calls api.velt.dev using env vars).
    • Navigation: components/header/header.tsx (presence, sidebar button, notifications) and components/sidebar/sidebar.tsx (embedded VeltNotificationsPanel).
    • Configs/Assets: Tailwind v3 setup (styles/globals.css, tailwind.config.js, postcss.config.js), Next config, TS config, components.json, and package.json with dependencies.
    • Docs: README.md with setup, run, and structure instructions.

Written by Cursor Bugbot for commit 5545b4a. This will update automatically on new commits. Configure here.

@vercel

vercel Bot commented Dec 16, 2025 •

Copy link
Copy Markdown


// Line item row component with inline comments
function LineItemRow({ lineItem, jobId }: { lineItem: JobLineItem; jobId: string }) {
const [showComments, setShowComments] = useState(false)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)

Fix in Cursor Fix in Web

setTimeout(() => {
onSubmit()
}, 1500)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

window.history.pushState({}, '', newUrl);

setDocumentId(docId);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

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'
}`}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web


return (
<VeltProvider
apiKey={process.env.NEXT_PUBLIC_VELT_API_KEY || '6xTcUFtlYAlCdh11zrKB'}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

<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>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@yoen-velt
yoen-velt merged commit cca4a45 into main Dec 16, 2025
16 of 17 checks passed

This branch was successfully deployed

14 active deployments
Preview – sample-apps-tanstack-multiple-tools — 5545b4a3 Deployed Dec 16, 2025 by vercel[bot]
Preview – sample-apps-ag-grid-comment-aggregation — 5545b4a3 Deployed Dec 16, 2025 by vercel[bot]
Preview – sample-apps-ag-grid-single-tool — 5545b4a3 Deployed Dec 16, 2025 by vercel[bot]
Preview – sample-apps-reactflow-demo — 5545b4a3 Deployed Dec 16, 2025 by vercel[bot]
Preview – sample-apps-tiptap-comments-demo — 5545b4a3 Deployed Dec 16, 2025 by vercel[bot]
Preview – sample-apps-ag-grid-multiple-tools — 5545b4a3 Deployed Dec 16, 2025 by vercel[bot]
Preview – sample-apps-tanstack-single-tool — 5545b4a3 Deployed Dec 16, 2025 by vercel[bot]
Preview – sample-apps-tanstack-comment-aggregation — 5545b4a3 Deployed Dec 16, 2025 by vercel[bot]
Preview – sample-apps-tiptap-crdt-demo — 5545b4a3 Deployed Dec 16, 2025 by vercel[bot]
Preview – sample-apps-dashboard-demo — 5545b4a3 Deployed Dec 16, 2025 by vercel[bot]
Preview – sample-apps-slatejs-comments-demo — 5545b4a3 Deployed Dec 16, 2025 by vercel[bot]
Preview – sample-apps-lexical-comments-demo — 5545b4a3 Deployed Dec 16, 2025 by vercel[bot]
Preview – sample-apps-codemirror-crdt-demo — 5545b4a3 Deployed Dec 16, 2025 by vercel[bot]
Preview – master-sample-app — 5545b4a3 Deployed Dec 16, 2025 by vercel[bot]
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