mirror of
https://github.com/m1ngsama/TUT.git
synced 2026-02-08 00:54:05 +00:00
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! ✅
This commit is contained in:
parent
4aae1fa7dc
commit
159e299e96
5 changed files with 12 additions and 13 deletions
|
|
@ -7,6 +7,7 @@
|
|||
|-----|--------|
|
||||
| `o` | Open address bar (type URL and press Enter) |
|
||||
| `Backspace` | Go back |
|
||||
| `f` | Go forward |
|
||||
| `r` or `F5` | Refresh current page |
|
||||
| `q` or `Esc` or `F10` | Quit browser |
|
||||
|
||||
|
|
@ -95,7 +96,6 @@
|
|||
## 🐛 Known Limitations
|
||||
|
||||
- Ctrl+L not yet working for address bar (use 'o' instead)
|
||||
- Forward navigation not yet implemented
|
||||
- No search functionality yet (/ key)
|
||||
- No bookmarks yet (Ctrl+D)
|
||||
- No history panel yet (F3)
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ cmake --build build -j$(nproc)
|
|||
| `g` | Go to top |
|
||||
| `G` | Go to bottom |
|
||||
| `Backspace` | Go back |
|
||||
| `f` | Go forward |
|
||||
|
||||
### Links
|
||||
| Key | Action |
|
||||
|
|
|
|||
15
STATUS.md
15
STATUS.md
|
|
@ -34,7 +34,7 @@
|
|||
- **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, r/F5 to refresh
|
||||
- **Browser Controls** - Backspace to go back, 'f' to go forward, r/F5 to refresh
|
||||
- **Real-time Status** - Load stats, scroll position, selected link
|
||||
- **Visual Feedback** - Navigation button states, link highlighting
|
||||
|
||||
|
|
@ -63,10 +63,6 @@
|
|||
- n/N navigation not working
|
||||
- No highlight of matches
|
||||
|
||||
- ⚠️ **Forward Navigation** - Not yet wired up
|
||||
- Forward button shows but doesn't work
|
||||
- Engine supports it, just needs UI connection
|
||||
|
||||
### Feature Gaps
|
||||
- ⚠️ No form support (input fields, buttons, etc.)
|
||||
- ⚠️ No image rendering (even ASCII art)
|
||||
|
|
@ -75,13 +71,7 @@
|
|||
|
||||
## 🎯 Next Steps Priority
|
||||
|
||||
### Phase 1: Polish Interactive Features (High Priority)
|
||||
|
||||
1. **Wire Up Forward Navigation** (src/main.cpp)
|
||||
- Connect forward button click to engine.goForward()
|
||||
- Add keyboard shortcut (maybe Shift+Backspace or Alt+→)
|
||||
|
||||
### Phase 2: Enhanced UX (Medium Priority)
|
||||
### Phase 1: Enhanced UX (High Priority)
|
||||
4. **Implement Search** (src/ui/content_view.cpp)
|
||||
- Add / to start search
|
||||
- Highlight matches
|
||||
|
|
@ -131,6 +121,7 @@ Interactive test:
|
|||
✅ Press '1' to jump to link 1 - WORKS
|
||||
✅ Enter to follow link - WORKS
|
||||
✅ Backspace to go back - WORKS
|
||||
✅ 'f' to go forward - WORKS
|
||||
✅ 'r' to refresh - WORKS
|
||||
✅ 'o' to open address bar - WORKS
|
||||
```
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ void printHelp(const char* prog_name) {
|
|||
<< " Shift+Tab Previous link\n"
|
||||
<< " Enter Follow link\n"
|
||||
<< " Backspace Go back\n"
|
||||
<< " f Go forward\n"
|
||||
<< " / Search in page\n"
|
||||
<< " n/N Next/previous search result\n"
|
||||
<< " Ctrl+L Focus address bar\n"
|
||||
|
|
|
|||
|
|
@ -309,6 +309,12 @@ int MainWindow::run() {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
if (event == Event::Character('f') && impl_->can_go_forward_) {
|
||||
if (impl_->on_event_) {
|
||||
impl_->on_event_(WindowEvent::Forward);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Refresh
|
||||
if (event == Event::Character('r') || event == Event::F5) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue