mirror of
https://github.com/m1ngsama/TUT.git
synced 2026-02-08 00:54:05 +00:00
Completed Phase 1 high priority task - comprehensive browsing history:
HistoryManager (New):
- JSON persistence to ~/.config/tut/history.json
- Auto-records every page visit
- Updates timestamp on revisit (moves to front)
- Limit to 1000 entries maximum
- Each entry stores: title, URL, timestamp
- Handles special characters with JSON escaping
- Auto-creates config directory if needed
UI Integration:
- History panel in bottom (center-left) of UI
- Shows up to 5 most recent visits
- Displays "[1] Title" format with cyan highlighting
- Shows "+N more..." indicator if >5 entries
- Real-time update on every navigation
Auto-Recording:
- Records on navigation via address bar
- Records on link click navigation
- Records on back/forward navigation
- Skips empty URLs and about:blank
- Updates existing entries instead of duplicating
Keyboard Shortcuts:
- F3: Toggle history panel visibility
* Refreshes history list when opened
Features:
- Persistent storage across browser sessions
- Smart duplicate handling (updates timestamp)
- Move-to-front on revisit
- Automatic trimming to max 1000 entries
- Sorted display (newest first)
- Empty state handling ("(empty)" message)
Technical Implementation:
- HistoryManager class with Pimpl idiom
- Simple JSON format for easy manual editing
- Event-driven architecture (WindowEvent::OpenHistory)
- Lambda callback for history updates
- Integrated with navigation callbacks
- Three-panel bottom layout (Bookmarks | History | Status)
Storage Format:
[
{"title": "Page Title", "url": "https://...", "timestamp": 1234567890},
...
]
Documentation:
- Updated KEYBOARD.md with F3 shortcut
- Updated STATUS.md to reflect completion
- Added history to interactive features list
All Phase 1 features now complete! 📚✅🎉
142 lines
4.1 KiB
Markdown
142 lines
4.1 KiB
Markdown
# TUT Browser - Development Status
|
|
|
|
## ✅ Working Features (v0.2.0-alpha) - INTERACTIVE!
|
|
|
|
### Core Functionality
|
|
- ✅ **HTTP/HTTPS Client** - Fully functional with cpp-httplib
|
|
- GET/POST/HEAD requests
|
|
- SSL/TLS support
|
|
- Cookie management
|
|
- Redirect following
|
|
- Timeout handling
|
|
|
|
- ✅ **HTML Parsing** - Working with gumbo-parser
|
|
- Full HTML5 parsing
|
|
- DOM tree construction
|
|
- Title extraction
|
|
- Link extraction with numbering
|
|
|
|
- ✅ **Content Rendering** - Basic text-based rendering
|
|
- Headings (H1-H6) with bold formatting
|
|
- Lists (UL/OL) with bullet points
|
|
- Links with [N] numbering and blue underline
|
|
- Paragraph and block element handling
|
|
- Skip script/style/head tags
|
|
|
|
- ✅ **Browser Engine** - Integrated pipeline
|
|
- Fetches URLs via HTTP client
|
|
- Parses HTML with renderer
|
|
- Resolves relative URLs
|
|
- Error handling for failed requests
|
|
- Back/forward navigation history
|
|
|
|
- ✅ **Interactive UI** - Fully keyboard-driven navigation
|
|
- **Content Scrolling** - j/k, g/G, Space/b for navigation
|
|
- **Link Navigation** - Tab, number keys (1-9), Enter to follow
|
|
- **Address Bar** - 'o' to open, type URL, Enter to navigate
|
|
- **Browser Controls** - Backspace to go back, 'f' to go forward, r/F5 to refresh
|
|
- **In-Page Search** - '/' to search, n/N to navigate results, highlighted matches
|
|
- **Bookmark System** - Ctrl+D to add/remove, F2 to toggle panel, JSON persistence
|
|
- **History System** - Auto-record visits, F3 to toggle panel, updates on revisit, JSON persistence
|
|
- **Real-time Status** - Load stats, scroll position, selected link, search results
|
|
- **Visual Feedback** - Navigation button states, link highlighting, search highlighting
|
|
|
|
### Build & Deployment
|
|
- ✅ Binary size: **827KB** (well under 1MB target!)
|
|
- ✅ Clean compilation with no warnings
|
|
- ✅ All tests build successfully
|
|
- ✅ CI/CD pipeline configured
|
|
- ✅ macOS and Linux support
|
|
|
|
## ⚠️ Known Limitations
|
|
|
|
### Feature Gaps
|
|
- ⚠️ No form support (input fields, buttons, etc.)
|
|
- ⚠️ No image rendering (even ASCII art)
|
|
- ⚠️ No CSS parsing (only basic tag-based formatting)
|
|
- ⚠️ No JavaScript support (by design)
|
|
|
|
## 🎯 Next Steps Priority
|
|
|
|
### Phase 2: Advanced Features (Medium Priority)
|
|
1. **Improve Rendering**
|
|
- Better word wrapping
|
|
- Table rendering
|
|
- Code block formatting
|
|
- Better list indentation
|
|
|
|
2. **Add Form Support**
|
|
- Input field rendering
|
|
- Button rendering
|
|
- Form submission
|
|
|
|
3. **Add Image Support**
|
|
- ASCII art rendering
|
|
- Image-to-text conversion
|
|
|
|
## 📊 Test Results
|
|
|
|
```bash
|
|
./test_browse.sh
|
|
|
|
Test 1: TLDP HOWTO index - ✅ PASSED
|
|
Test 2: example.com - ✅ PASSED
|
|
|
|
Interactive test:
|
|
./build_ftxui/tut https://tldp.org/HOWTO/HOWTO-INDEX/howtos.html
|
|
|
|
✅ Scrolling with j/k - WORKS
|
|
✅ Tab to cycle links - WORKS
|
|
✅ Press '1' to jump to link 1 - WORKS
|
|
✅ Enter to follow link - WORKS
|
|
✅ Backspace to go back - WORKS
|
|
✅ 'f' to go forward - WORKS
|
|
✅ '/' to search - WORKS
|
|
✅ 'n'/'N' to navigate search results - WORKS
|
|
✅ Ctrl+D to add/remove bookmark - WORKS
|
|
✅ F2 to toggle bookmark panel - WORKS
|
|
✅ F3 to toggle history panel - WORKS
|
|
✅ Auto-record page visits in history - WORKS
|
|
✅ 'r' to refresh - WORKS
|
|
✅ 'o' to open address bar - WORKS
|
|
```
|
|
|
|
Successfully browses:
|
|
- https://tldp.org/HOWTO/HOWTO-INDEX/howtos.html ⭐ FULLY INTERACTIVE
|
|
- https://example.com ⭐ FULLY INTERACTIVE
|
|
- Any static HTML page ⭐ FULLY INTERACTIVE
|
|
|
|
## 🚀 Quick Start
|
|
|
|
```bash
|
|
# Build
|
|
cmake -B build_ftxui -DCMAKE_PREFIX_PATH=/opt/homebrew
|
|
cmake --build build_ftxui -j$(nproc)
|
|
|
|
# Test
|
|
./test_browse.sh
|
|
|
|
# Try it
|
|
./build_ftxui/tut https://example.com
|
|
```
|
|
|
|
## 📝 Notes
|
|
|
|
**THE BROWSER IS NOW FULLY INTERACTIVE AND USABLE!** 🎉
|
|
|
|
You can actually browse the web with TUT:
|
|
- Load pages via HTTP/HTTPS
|
|
- Scroll content with vim-style keys
|
|
- Navigate between links with Tab or numbers
|
|
- Follow links by pressing Enter
|
|
- Go back in history with Backspace
|
|
- Enter new URLs with 'o' key
|
|
- See real-time load stats
|
|
|
|
The core experience is complete! Remaining work is mostly enhancements:
|
|
- Search within pages
|
|
- Persistent bookmarks and history
|
|
- Form support
|
|
- Better styling
|
|
|
|
See [KEYBOARD.md](KEYBOARD.md) for complete keyboard shortcuts reference.
|