-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Decouple iOS primary terminal scroll #6081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 18 commits
2c43d31
eee05fb
25eb92e
2438ab6
171d624
8e4636f
a8b2ead
a1697cc
c156503
f82bcbf
aff8198
b6e9f97
f73e2c3
415b28b
c617afa
d0797e3
ed18dda
6b54974
a7c2a20
e05ca47
c3b8822
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| public enum MobileTerminalScrollbackBudget { | ||
| /// Small fallback used when an older client asks for replay without an | ||
| /// explicit scrollback window. | ||
| public static let defaultReplayRows = 240 | ||
|
|
||
| /// Bounded repair window for host-coupled scroll responses. The decoupled | ||
| /// primary-screen path should not depend on this during normal iPhone | ||
| /// scrolling. | ||
| public static let scrollPrefetchRows = 600 | ||
| } | ||
|
|
||
| public enum MobileTerminalScrollbackReplayRequest { | ||
| public static let scopeParameter = "scrollback_scope" | ||
| public static let fullScope = "full" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,10 @@ struct GhosttySurfaceRepresentable: UIViewRepresentable { | |
| /// band and pins first responder so the keyboard hands over in place; when it | ||
| /// flips off, the field is unmounted and the band collapses to zero height. | ||
| var isComposerActive: Bool = false | ||
| /// Whether normal-screen scrollback should move on the phone without a Mac | ||
| /// round trip. Turning this off restores host-coupled scroll for dogfood | ||
| /// comparison. | ||
| var decouplePrimaryScreenScroll: Bool = true | ||
|
|
||
| func makeCoordinator() -> Coordinator { | ||
| Coordinator(surfaceID: surfaceID, store: store) | ||
|
|
@@ -59,6 +63,7 @@ struct GhosttySurfaceRepresentable: UIViewRepresentable { | |
| fontSize: fontSize | ||
| ) | ||
| view.autoFocusOnWindowAttach = autoFocusOnWindowAttach | ||
| view.decouplePrimaryScreenScroll = decouplePrimaryScreenScroll | ||
| #if DEBUG | ||
| // Hand the surface the structured diagnostic log so the composer-dock | ||
| // probes land in the blob the "Send to agent" feedback pane exports. | ||
|
|
@@ -88,6 +93,7 @@ struct GhosttySurfaceRepresentable: UIViewRepresentable { | |
| // state write, so it is safe in `updateUIView`. | ||
| guard let surfaceView = uiView as? GhosttySurfaceView else { return } | ||
| surfaceView.autoFocusOnWindowAttach = autoFocusOnWindowAttach | ||
| surfaceView.decouplePrimaryScreenScroll = decouplePrimaryScreenScroll | ||
| surfaceView.setComposerActive(isComposerActive) | ||
| context.coordinator.setComposerMounted(isComposerActive) | ||
| // A width change (rotation) is not a text change, so the field-content trigger | ||
|
|
@@ -137,6 +143,7 @@ struct GhosttySurfaceRepresentable: UIViewRepresentable { | |
| for await chunk in store.terminalOutputStream(surfaceID: surfaceID) { | ||
| guard !Task.isCancelled else { return } | ||
| guard let surfaceView else { return } | ||
| surfaceView.applyTerminalOutputMetadata(activeScreen: chunk.activeScreen) | ||
|
cursor[bot] marked this conversation as resolved.
Outdated
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a render-grid chunk switches screens, this updates Useful? React with 👍 / 👎. |
||
| await surfaceView.processOutputAndWait(chunk.data) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| store.terminalOutputDidProcess( | ||
| surfaceID: surfaceID, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.