Conversation
…ally populated and focused.
Greptile SummaryThis PR overhauls URL handling and display across the browser, replacing the simple inline
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User taps URL bar] --> B{URLBar: startEditing}
B --> C[Set appState.isURLBarEditing = true]
C --> D[setupInlineLauncher]
D --> E[Configure LauncherViewModel\nnavigateInCurrentTab: true]
D --> F[Pre-fill launcherInput with current URL]
D --> G[Suppress initial search for 150ms]
D --> H[Focus LauncherTextField]
H --> I{User types}
I --> J[LauncherViewModel.searchHandler]
J --> K[Show suggestions overlay]
I --> L{User presses Enter}
L --> M[executeCommand → run focused suggestion action]
M --> N[Load URL in current tab]
M --> O[onDismiss → dismissEditing]
I --> P{User presses Escape}
P --> O
Q[User taps sidebar URL display] --> R[Set appState.launcherSearchText]
R --> S[Set appState.showLauncher = true]
S --> T[LauncherView opens with pre-filled URL]
U[User taps dimmed web content] --> V[Set appState.isURLBarEditing = false]
V --> W[cleanupInlineLauncher]
|
| private func triggerCopy(_ text: String) { | ||
| ClipboardUtils.triggerCopy( | ||
| text, | ||
| showCopiedAnimation: $showCopiedAnimation, | ||
| startWheelAnimation: $startWheelAnimation | ||
| ) | ||
| toastManager.show("Link copied", icon: .ora(.copy)) | ||
| } |
There was a problem hiding this comment.
Missing toast on sidebar copy action
The toastManager.show("Link copied", ...) call was removed from triggerCopy in this file, but it's still present in URLBar.swift:54. This creates an inconsistent user experience: copying a URL from the URL bar shows a toast, but copying from the sidebar does not.
Additionally, toastManager (line 9) is now unused in this view since the toast call was the only place it was used — the @EnvironmentObject declaration can be cleaned up if the toast removal was intentional, or the toast should be restored for consistency.
| private func triggerCopy(_ text: String) { | |
| ClipboardUtils.triggerCopy( | |
| text, | |
| showCopiedAnimation: $showCopiedAnimation, | |
| startWheelAnimation: $startWheelAnimation | |
| ) | |
| toastManager.show("Link copied", icon: .ora(.copy)) | |
| } | |
| private func triggerCopy(_ text: String) { | |
| ClipboardUtils.triggerCopy( | |
| text, | |
| showCopiedAnimation: $showCopiedAnimation, | |
| startWheelAnimation: $startWheelAnimation | |
| ) | |
| toastManager.show("Link copied", icon: .ora(.copy)) | |
| } |
| var body: some View { | ||
| HStack { | ||
| Image(systemName: "link") | ||
| // Image(systemName: "link") |
There was a problem hiding this comment.
Commented-out code left behind
This line should be deleted rather than commented out. If the icon is no longer desired, remove it entirely to keep the code clean.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| private func displayURL(for tab: Tab) -> String { | ||
| URLDisplayUtils.displayString(url: tab.url, title: tab.title, showFull: toolbarManager.showFullURL) | ||
| } |
There was a problem hiding this comment.
Dead code — displayURL(for:) is never called
This function is defined but never referenced. Only displayParts(for:) (line 120) is used in the view body. This should be removed.
| private func displayURL(for tab: Tab) -> String { | |
| URLDisplayUtils.displayString(url: tab.url, title: tab.title, showFull: toolbarManager.showFullURL) | |
| } |
| .overlay(clipShape | ||
| .stroke(theme.invertedSolidWindowBackgroundColor.opacity(0.3), lineWidth: 1) | ||
| ) | ||
| .padding(.top, 0) |
There was a problem hiding this comment.
No-op padding
.padding(.top, 0) has no visual effect and appears to be a leftover from iterating on spacing values. Consider removing it to reduce noise.
| .padding(.top, 0) |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary:
Testing: