Repository navigation
Velt/improvements - #23
Conversation
…nts-demo - Updated @veltdev/react and @veltdev/types to version 4.6.5 in package.json. - Refactored layout to include AppProviders for user authentication. - Integrated VeltProvider for collaboration features in the main page. - Adjusted document ID handling in DocumentContext for better shareability. - Removed unused Velt comment tools and streamlined comments section in JobDetailModal and ActionModal. - Enhanced sidebar and header components for improved layout and functionality. - Added new UI customization components for notifications and sidebar buttons. - Updated API key handling in token route for consistency. These changes improve the overall structure and functionality of the demo application.
| const NEXT_PUBLIC_VELT_API_KEY = process.env.NEXT_PUBLIC_VELT_API_KEY || process.env.VELT_API_KEY || ''; | ||
| const VELT_AUTH_TOKEN = process.env.VELT_AUTH_TOKEN; | ||
| const NEXT_PUBLIC_VELT_API_KEY = "6xTcUFtlYAlCdh11zrKB"; | ||
| const VELT_AUTH_TOKEN = "bd4d5226050470b6c658054fcdf1092a"; |
There was a problem hiding this comment.
Bug: Hardcoded API credentials exposed in source code
The API key and auth token were changed from reading environment variables to hardcoded string values. The VELT_AUTH_TOKEN (bd4d5226050470b6c658054fcdf1092a) is particularly sensitive as it's used to generate authentication tokens via the Velt API. Committing secrets to source control exposes them to anyone with repository access and makes credential rotation difficult.
Additional Locations (1)
| // 3. Generate new document ID | ||
| docId = `doc-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`; | ||
| localStorage.setItem('velt-demo-document-id', docId); | ||
| localStorage.setItem('velt-inline-comments-demo-doc-id', docId); |
There was a problem hiding this comment.
Bug: localStorage key mismatch causes document ID loss
When a document ID comes from a URL parameter, it's stored using the old key 'velt-demo-document-id' (line 48), but when reading from localStorage, the code checks the new key 'velt-inline-comments-demo-doc-id' (line 51). This mismatch means document IDs saved from URL parameters are never retrieved on subsequent visits without the URL parameter, causing a new document ID to be generated instead of using the previously stored one.
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
Upgrades the inline-comments demo to a simplified Velt setup with context-aware threads, new UI customizations, layout tweaks, and updated Velt packages.
contextandcomposerPosition="bottom"toVeltInlineCommentsSectionandVeltCommentToolfor job-scoped threads (job-<id>).VeltInitializeDocumentwithout user dependency; setmetadata.documentNamedirectly.VeltCollaborationto includeVeltCustomization; keepVeltComments/VeltCommentsSidebarwithshadowDom={false}.h-screen, calculated content height).AppProvidersinapp/layout.tsx; simplifyapp/page.tsxto a singleVeltProviderwrappingVeltCollaborationandDocumentCanvas.CommentsSidebarcontainer/ids and padding; tweak table/modal structures accordingly.<VeltNotificationsTool shadowDom={false} />.VeltCustomizationand components) with new styles inui-customization/styles.css.velt-inline-comments-demo-doc-id; keep URLdocumentIdhandling.NEXT_PUBLIC_VELT_API_KEYandVELT_AUTH_TOKENconstants.@veltdev/reactto^4.6.5and@veltdev/typesto^4.6.5; update lockfile accordingly.Written by Cursor Bugbot for commit 1f3dc31. This will update automatically on new commits. Configure here.