Skip to content

Comments

feat(terminal): Sprint 2.3 URL recognition with hover state#21

Merged
randlee merged 5 commits intodevelopfrom
feature/sprint-2-3-url-recognition
Jan 28, 2026
Merged

feat(terminal): Sprint 2.3 URL recognition with hover state#21
randlee merged 5 commits intodevelopfrom
feature/sprint-2-3-url-recognition

Conversation

@randlee
Copy link
Owner

@randlee randlee commented Jan 28, 2026

Summary

Implements Sprint 2.3 URL Recognition & Clicking feature:

  • Add URL/path hyperlink patterns for detecting clickable links in terminal output
  • Wire mouse event handlers for hover detection and click-to-open
  • Add Phase 4 hover state with visual feedback (pointer cursor + URL footer)
  • Address ARCH-CODEX review findings for robustness

Key Changes

Hover State (Phase 4)

  • Cache hovered URL from navigation target events
  • Show pointer cursor when hovering clickable URLs
  • Display URL footer bar at bottom of terminal content

Safety & UX Fixes

  • Guard mouse handlers against empty terminal content (prevents index panics)
  • Scope mouse handlers to terminal content only (tab bar no longer triggers)
  • Focus terminal on click for proper modifier key handling
  • Clear hover state when Cmd/Ctrl modifier is released

Test plan

  • cargo check passes
  • cargo build passes
  • cargo test - 73/73 tests pass
  • cargo clippy - clean
  • Manual test: Hover over URLs with Cmd/Ctrl held shows footer and pointer
  • Manual test: Click URL with Cmd/Ctrl opens in browser
  • Manual test: Fresh terminal without content doesn't panic on hover/click
  • Manual test: Tab bar clicks don't trigger URL detection

🤖 Generated with Claude Code

randlee and others added 5 commits January 27, 2026 17:05
- Add hovered_url field to TerminalPane to cache navigation target state
- Update handle_navigation_target to store URL on hover events
- Show pointer cursor when hovering over clickable URLs
- Display URL footer bar at bottom of terminal when hovering
- Add regex pattern tests for path/URL recognition

This completes Sprint 2.3 Phase 4 (Visual Hover Effects) by providing
visual feedback when users hover over clickable URLs in the terminal.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
High severity fixes:
- Add empty content guard to mouse handlers to prevent index panics
- Move mouse handlers from pane root to terminal content element only
  (prevents tab bar interactions from triggering terminal mouse events)

Medium severity fixes:
- Focus terminal on mouse down to ensure modifier keys work correctly
- Clear hover state when secondary modifier (Cmd/Ctrl) is released
  (uses modifiers.secondary() for cross-platform compatibility)

Also refactored render_terminal_content to render_terminal_content_inner
returning Stateful<Div> to allow chaining mouse handlers on the element.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
QA gate passed: 73/73 tests, clippy clean, all builds pass.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Resolve conflicts by integrating Sprint 2.3 hover state features
with develop's TerminalElement improvements:
- Keep hovered_url field and caching logic
- Use TerminalElement for rendering (from develop)
- Add hover footer overlay on TerminalElement container
- Maintain modifier clearing in handle_mouse_move
- Add regex pattern tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@randlee randlee merged commit 771a03b into develop Jan 28, 2026
5 checks passed
randlee added a commit that referenced this pull request Jan 28, 2026
Sprint 2.3 (URL Recognition & Clicking) completed:
- Hover state with visual feedback (pointer cursor + URL footer)
- Mouse event handling with empty content guards
- ARCH-CODEX review findings addressed
- PR #21 merged

Phase 2 now 100% complete. Ready for Phase 3 (File Browser).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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