feat(preview): add localhost link preview popup with toggle settings#801
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughTerminal links to localhost URLs can now optionally open in an in-app preview pane. A new preference controls this behavior, preference state is persisted and synced across windows, the terminal link system is now pluggable via actions, and a hover popup offers quick preview access. ChangesLocalhost Link Preview
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@src/app/App.tsx`:
- Around line 1322-1331: The popup wrapper currently doesn't participate in
cancelling/restarting the hide timer, so moving the cursor into the wrapper
padding/border can still trigger a hide; update the wrapper div to also use the
same onMouseEnter and onMouseLeave handlers (i.e., attach
onMouseEnter={onMouseEnter} and onMouseLeave={onMouseLeave} to the outer div) or
ensure both the outer wrapper and the inner button call the timer cancel/restart
logic inside the existing onMouseEnter/onMouseLeave functions so the hide timer
is cancelled as soon as the cursor enters any part of the popup and restarted
only when it leaves.
🪄 Autofix (Beta)
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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 551497bf-60b4-4197-8daa-4f7ce5ef512d
📒 Files selected for processing (8)
src/app/App.tsxsrc/lib/localUrl.test.tssrc/lib/localUrl.tssrc/modules/preview/PreviewPane.tsxsrc/modules/settings/store.tssrc/modules/terminal/index.tssrc/modules/terminal/lib/rendererPool.tssrc/settings/sections/GeneralSection.tsx
What
Adds an in-terminal hover action for localhost and loopback links that opens
them in Terax's web preview. Also adds a new setting to always open localhost
terminal links in preview instead of the system browser.
Why
Terax already has an internal web preview, but localhost links printed in the
terminal required opening an external browser or manually copying the URL
into preview. This makes local dev server links faster to inspect inside the
workspace.
How
Terminal web link handling now routes through app level link actions.
Localhost links show an
Open in Previewpopup anchored to the detected linkwidth, and the new persisted setting controls whether direct clicks open
preview automatically.
Testing
pnpm exec tsc --noEmitcleansrc-tauri/)cargo test --lockedandcargo clippy --all-targets --locked -- -D warningsclean#[tauri::command]signature) called out below sothe FE caller can be updated in lockstep
pnpm tauri devAdditional checks:
pnpm testpnpm buildgit diff --checkScreenshots / GIFs
Notes for reviewer
Summary by CodeRabbit
New Features
Tests