Commit graph

4 commits

Author SHA1 Message Date
03422136dd feat: Add complete persistent bookmark system
Completed Phase 1 high priority task - comprehensive bookmark management:

BookmarkManager (New):
- JSON persistence to ~/.config/tut/bookmarks.json
- Add, remove, contains, getAll operations
- Automatic sorting by timestamp (newest first)
- Each bookmark stores: title, URL, timestamp
- Handles special characters with JSON escaping
- Auto-creates config directory if needed

UI Integration:
- Bookmark panel in bottom-left of UI
- Shows up to 5 most recent bookmarks
- Displays "[1] Title" format with yellow highlighting
- Shows "+N more..." indicator if >5 bookmarks
- Real-time update when bookmarks change

Keyboard Shortcuts:
- Ctrl+D: Toggle bookmark for current page
  * Adds if not bookmarked
  * Removes if already bookmarked
  * Shows status message confirmation
- F2: Toggle bookmark panel visibility
  * Refreshes bookmark list when opened

Features:
- Persistent storage across browser sessions
- Duplicate detection (one bookmark per URL)
- Toggle behavior (add/remove with same key)
- Real-time panel updates
- Empty state handling ("(empty)" message)
- Sorted display (newest first)

Technical Implementation:
- BookmarkManager class with Pimpl idiom
- Simple JSON format for easy manual editing
- Event-driven architecture (WindowEvent::AddBookmark)
- Lambda callback for bookmark updates
- Integrated with main browser engine

Storage Format:
[
  {"title": "Page Title", "url": "https://...", "timestamp": 1234567890},
  ...
]

Documentation:
- Updated KEYBOARD.md with bookmark shortcuts
- Updated STATUS.md to reflect completion
- Added bookmark feature to interactive features list

Next Step: History system! 📚
2026-01-01 14:08:42 +08:00
be6cc4ca44 feat: Add full in-page search functionality
Completed Phase 1 high priority task - comprehensive search system:

Search Features:
- Press '/' to enter search mode with dedicated search input
- Case-insensitive search across all content
- Enter to execute search and find all matches
- Real-time match highlighting:
  * Yellow background = current match
  * Blue background = other matches
- Navigate results with 'n' (next) and 'N' (previous)
- Smart scrolling - auto-scroll to current match
- Match counter in status bar (e.g., "Match 3/10")
- Esc to cancel search input
- Search state clears when loading new pages

Implementation Details:
- Added search state to MainWindow::Impl
  * search_mode, search_query, search_matches, current_match
- Search input component (similar to address bar)
- executeSearch() - finds all matching lines
- nextMatch()/previousMatch() - cycle through results
- Content renderer highlights matches dynamically
- Status panel shows search results with emoji indicator

User Experience:
- Intuitive vim-style '/' to search
- Visual feedback with color highlighting
- Match position indicator in status
- Non-intrusive - doesn't interfere with navigation
- Seamless integration with existing UI

Keyboard shortcuts:
- /: Start search
- Enter: Execute search
- n: Next match
- N: Previous match
- Esc: Cancel search

Documentation:
- Updated KEYBOARD.md with search section and usage example
- Updated STATUS.md to reflect completion
- Added search to interactive features list

The browser now has powerful in-page search! 🔍
2026-01-01 00:51:05 +08:00
159e299e96 feat: Add forward navigation with 'f' key
Completed Phase 1 high priority task:

Interactive Features:
- Add 'f' keyboard shortcut for forward navigation
- Forward button in UI now fully functional
- Works in tandem with Backspace (back) navigation
- Only enabled when browser can go forward

Documentation:
- Updated KEYBOARD.md with 'f' key
- Updated README.md keyboard shortcuts
- Updated STATUS.md to reflect completion
- Updated help text in main.cpp

Keyboard shortcuts:
- Backspace: Go back
- f: Go forward
- Both check navigation state before allowing action

The browser now has complete bidirectional navigation! 
2026-01-01 00:41:07 +08:00
c965472ac5 feat: Add fully interactive browsing with scrolling and link navigation
Implemented complete interactive browser experience with keyboard-driven
navigation.

Interactive Features Added:
 Content Scrolling
  - j/k or arrow keys: Line-by-line scrolling
  - Space/b or PageUp/PageDown: Page scrolling
  - g/G: Jump to top/bottom
  - Real-time scroll position indicator

 Link Navigation
  - Tab/Shift+Tab: Cycle through links
  - 1-9 number keys: Jump directly to links
  - Enter: Follow selected link
  - Selected link highlighted in status bar

 Browser Navigation
  - Back/forward button state (dimmed when unavailable)
  - Backspace: Go back in history
  - r/F5: Refresh page
  - o: Open address bar to enter new URL

 Enhanced UI
  - Status panel shows load stats (KB, time, link count)
  - Selected link URL shown in status bar
  - Scroll position indicator
  - Navigation button states

Technical Implementation:
- Rewrote MainWindow with full FTXUI event handling
- Implemented content line splitting for scrolling
- Added link selection state management
- Wired up browser engine callbacks
- Added timing and statistics tracking
- Proper back/forward history support

Files Modified:
- src/ui/main_window.cpp - Complete rewrite with interactive features
- src/main.cpp - Wire up all callbacks and link handling
- KEYBOARD.md - Complete keyboard shortcuts reference

Tested with:
https://tldp.org/HOWTO/HOWTO-INDEX/howtos.html
https://example.com

The browser is now fully interactive and usable for real web browsing! 🎉
2025-12-31 17:50:15 +08:00