Initial virtual world project setup - #1
Conversation
|
Warning Review limit reached
Next review available in: 29 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository: alphaonelabs/coderabbit/.coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (11)
WalkthroughAdded a Vite and TypeScript virtual world with Alpha One Labs authentication, a Three.js first-person scene, activity portals, interactive overlays, and Cloudflare deployment configuration. ChangesVirtual experience
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Visitor
participant LoginPage
participant LearnAPI
participant BrowserStorage
participant VirtualApp
Visitor->>LoginPage: submit login or registration form
LoginPage->>LearnAPI: POST authentication request
LearnAPI-->>LoginPage: return token and user or registration result
LoginPage->>BrowserStorage: store authentication session
LoginPage->>VirtualApp: redirect to virtual experience
VirtualApp->>BrowserStorage: read authentication session
VirtualApp->>VirtualApp: initialize scene and controls
VirtualApp->>Visitor: show portal interaction overlay
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 14
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@index.html`:
- Around line 142-155: Update the HTML around `#blocker` to provide a native
keyboard-operable entry button and an always-available semantic activity list or
equivalent controls outside the canvas, with accessible labels and links for
screen-reader users. Review the surrounding template’s ARIA attributes and
semantic elements, and preserve the existing canvas interaction path for pointer
users.
- Around line 157-164: Update index.html at lines 157-164 so `#panel-card` has
dialog semantics using role="dialog", aria-modal="true",
aria-labelledby="panel-title", and aria-describedby="panel-description". Update
src/ui/overlay.ts at lines 59-81 in showPanel and hidePanel to save the invoking
element, focus a panel control after opening, trap Tab navigation within the
panel while open, and restore focus to the invoker after hiding.
In `@login.html`:
- Around line 233-235: Update the logo markup in the brand link by removing the
invalid closing </img> tag and adding an empty alt attribute to the logo image,
since the adjacent “Alpha One Labs” text provides the link label.
In `@package.json`:
- Around line 16-20: Add an engines.node declaration to the package manifest
requiring Node.js 20.19+ or 22.12+, and update README.md to document the same
supported Node.js range. Keep the requirement consistent between the manifest
and documentation.
- Line 19: Change the vite dependency declaration from the caret range to a
minor-line-constrained range such as ~8.2.0, then regenerate and commit the
corresponding lockfile so resolved dependency metadata matches the updated
constraint.
In `@README.md`:
- Around line 18-24: Update the README “Build & deploy” section to invoke the
locally installed Wrangler through npm or npx, remove the redundant npm run
build command because npm run deploy already performs the build, and document
VITE_LEARN_API_BASE setup or its fallback behavior alongside the deployment
command.
In `@src/config.ts`:
- Around line 1-2: Update the initialization of LEARN_API_BASE to parse the
configured or default URL and reject any non-HTTPS value before exporting it.
Preserve the existing HTTPS default, allow only an explicitly documented
loopback development exception if required, and verify production Wrangler
configuration cannot provide an HTTP API base.
In `@src/login.ts`:
- Around line 167-180: Update the registration-success UI flow around heading
and panel.replaceChildren so heading is programmatically focusable with tabIndex
= -1, then focus heading immediately after replacing the panel contents.
Preserve the existing success message and action-button behavior.
- Around line 63-74: Update callApi to bound fetch duration with an
AbortController and timeout, ensuring the timer is cleared in a finally block.
Detect abort timeouts and throw a clear retryable timeout error while preserving
existing API error handling for completed responses.
In `@src/main.ts`:
- Around line 31-38: Update the Escape branch in the keydown handler to restore
the world-entry state after overlay.hidePanel(), using the existing blocker
display or relock path used by the Close button so controls.lock() remains
available.
In `@src/world/controls.ts`:
- Around line 35-48: Normalize the combined forwardInput and rightInput vector
before applying movement in the control update. Adjust the values used by both
camera.position.addScaledVector calls so simultaneous forward/right input has
total speed MOVE_SPEED while preserving single-axis movement and zero-input
early return.
- Around line 18-21: Update the pointer-lock handling around onLockChange and
onKeyDown so movement key presses are ignored while the pointer is unlocked, and
reset all move state flags when pointer lock is lost. Register a window blur
handler to clear movement flags when focus leaves the document, preventing stale
move.<state> values when keyup events are missed.
In `@src/world/scene.ts`:
- Around line 22-24: Cap the value passed to renderer.setPixelRatio in the scene
initialization to a tested maximum device-pixel ratio, using the lower of
window.devicePixelRatio and that cap. Keep the existing renderer setup and
sizing behavior unchanged.
In `@tsconfig.json`:
- Line 15: Update the TypeScript project configuration’s include list to
type-check the root vite.config.ts alongside src. Ensure the widened project has
the required Node typings for node:path and import.meta.dirname, while
preserving the existing build type-check behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: alphaonelabs/coderabbit/.coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: a9d1cd56-7759-4afe-89ec-dcadb73ddc77
⛔ Files ignored due to path filters (2)
images/logo.pngis excluded by!**/*.pngpackage-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (20)
.env.example.gitignoreREADME.mdindex.htmllogin.htmlpackage.jsonsrc/auth.tssrc/config.tssrc/data/activities.tssrc/login.tssrc/main.tssrc/types.tssrc/ui/overlay.tssrc/vite-env.d.tssrc/world/controls.tssrc/world/portals.tssrc/world/scene.tstsconfig.jsonvite.config.tswrangler.toml
Project Setup
Virtual World
Authentication
Steps to actually deploy to Cloudflare:
Summary
The change provides the initial user experience for an interactive Alpha One Labs virtual world. Users can authenticate, enter the scene, move through the environment, and open activity links. Deployment requires dependency installation,
.envconfiguration, Wrangler authentication, andnpm run deploy.