docs(webview): fix misleading navigation comments and interface docs
- commit
- 928cfae8dc57abcf31791efed58492db29b9b3a4
- author
- bnema · · 2026-01-08 17:24 UTC
- parent
- f105e30
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +4 -4
M internal/application/port/webview.go +2 -2
| @@ -143,11 +143,11 @@ type WebView interface { | |||
| 143 | 143 | Stop(ctx context.Context) error | |
| 144 | 144 | ||
| 145 | 145 | // GoBack navigates back in history. | |
| 146 | - | // Returns error if back navigation is not possible. | |
| 146 | + | // Uses WebKit native navigation if available, falls back to JavaScript history.back() for SPA compatibility. | |
| 147 | 147 | GoBack(ctx context.Context) error | |
| 148 | 148 | ||
| 149 | 149 | // GoForward navigates forward in history. | |
| 150 | - | // Returns error if forward navigation is not possible. | |
| 150 | + | // Uses WebKit native navigation if available, falls back to JavaScript history.forward() for SPA compatibility. | |
| 151 | 151 | GoForward(ctx context.Context) error | |
| 152 | 152 | ||
| 153 | 153 | // --- State Queries --- | |
| @@ -143,11 +143,11 @@ type WebView interface { | |||||
| 143 | Stop(ctx context.Context) error | 143 | Stop(ctx context.Context) error | ||
| 144 | 144 | ||||
| 145 | // GoBack navigates back in history. | 145 | // GoBack navigates back in history. | ||
| 146 | - | // Returns error if back navigation is not possible. | 146 | + | // Uses WebKit native navigation if available, falls back to JavaScript history.back() for SPA compatibility. |
| 147 | GoBack(ctx context.Context) error | 147 | GoBack(ctx context.Context) error | ||
| 148 | 148 | ||||
| 149 | // GoForward navigates forward in history. | 149 | // GoForward navigates forward in history. | ||
| 150 | - | // Returns error if forward navigation is not possible. | 150 | + | // Uses WebKit native navigation if available, falls back to JavaScript history.forward() for SPA compatibility. |
| 151 | GoForward(ctx context.Context) error | 151 | GoForward(ctx context.Context) error | ||
| 152 | 152 | ||||
| 153 | // --- State Queries --- | 153 | // --- State Queries --- | ||
M internal/infrastructure/webkit/webview.go +2 -2
| @@ -761,7 +761,7 @@ func (wv *WebView) Stop(ctx context.Context) error { | |||
| 761 | 761 | } | |
| 762 | 762 | ||
| 763 | 763 | // GoBack navigates back in history. | |
| 764 | - | // Uses JavaScript history.back() first for SPA compatibility, falls back to WebKit native. | |
| 764 | + | // Uses WebKit native navigation first, falls back to JavaScript history.back() for SPA compatibility. | |
| 765 | 765 | func (wv *WebView) GoBack(ctx context.Context) error { | |
| 766 | 766 | if wv.destroyed.Load() { | |
| 767 | 767 | return fmt.Errorf("webview %d is destroyed", wv.id) | |
| @@ -783,7 +783,7 @@ func (wv *WebView) GoBack(ctx context.Context) error { | |||
| 783 | 783 | } | |
| 784 | 784 | ||
| 785 | 785 | // GoForward navigates forward in history. | |
| 786 | - | // Uses JavaScript history.forward() first for SPA compatibility, falls back to WebKit native. | |
| 786 | + | // Uses WebKit native navigation first, falls back to JavaScript history.forward() for SPA compatibility. | |
| 787 | 787 | func (wv *WebView) GoForward(ctx context.Context) error { | |
| 788 | 788 | if wv.destroyed.Load() { | |
| 789 | 789 | return fmt.Errorf("webview %d is destroyed", wv.id) | |
| @@ -761,7 +761,7 @@ func (wv *WebView) Stop(ctx context.Context) error { | |||||
| 761 | } | 761 | } | ||
| 762 | 762 | ||||
| 763 | // GoBack navigates back in history. | 763 | // GoBack navigates back in history. | ||
| 764 | - | // Uses JavaScript history.back() first for SPA compatibility, falls back to WebKit native. | 764 | + | // Uses WebKit native navigation first, falls back to JavaScript history.back() for SPA compatibility. |
| 765 | func (wv *WebView) GoBack(ctx context.Context) error { | 765 | func (wv *WebView) GoBack(ctx context.Context) error { | ||
| 766 | if wv.destroyed.Load() { | 766 | if wv.destroyed.Load() { | ||
| 767 | return fmt.Errorf("webview %d is destroyed", wv.id) | 767 | return fmt.Errorf("webview %d is destroyed", wv.id) | ||
| @@ -783,7 +783,7 @@ func (wv *WebView) GoBack(ctx context.Context) error { | |||||
| 783 | } | 783 | } | ||
| 784 | 784 | ||||
| 785 | // GoForward navigates forward in history. | 785 | // GoForward navigates forward in history. | ||
| 786 | - | // Uses JavaScript history.forward() first for SPA compatibility, falls back to WebKit native. | 786 | + | // Uses WebKit native navigation first, falls back to JavaScript history.forward() for SPA compatibility. |
| 787 | func (wv *WebView) GoForward(ctx context.Context) error { | 787 | func (wv *WebView) GoForward(ctx context.Context) error { | ||
| 788 | if wv.destroyed.Load() { | 788 | if wv.destroyed.Load() { | ||
| 789 | return fmt.Errorf("webview %d is destroyed", wv.id) | 789 | return fmt.Errorf("webview %d is destroyed", wv.id) | ||