Repository navigation
fix(macOS): keep legacy Home visible when toggled #11933
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
Changes from all commits
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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| import AppKit | ||
|
Check warning on line 1 in desktop/macos/Desktop/Sources/MainWindow/Pages/DashboardPage.swift
|
||
| import Combine | ||
| import OmiTheme | ||
| import SwiftUI | ||
|
|
@@ -256,6 +256,7 @@ | |
| @AppStorage(AssistantSettings.audioRecordingModeDefaultsKey) private var audioRecordingModeRaw = | ||
| AssistantSettings.AudioRecordingMode.onlyMeetings.rawValue | ||
| @AppStorage("useLegacyHomeDesign") private var useLegacyHomeDesign = false | ||
| @AppStorage("useOldestHomeDesign") private var useOldestHomeDesign = false | ||
| @State private var homeMode: HomeStageMode = .hub | ||
| @State private var didReportChatFirstTranscriptPage = false | ||
| @FocusState private var homeAskFieldFocused: Bool | ||
|
|
@@ -379,14 +380,15 @@ | |
|
|
||
| private var homeSurface: some View { | ||
| Group { | ||
| if useLegacyHomeDesign && !routesChatToPrimaryShell { | ||
| if useLegacyHomeDesign && useOldestHomeDesign && !routesChatToPrimaryShell { | ||
| legacyHome | ||
| } else { | ||
| redesignedHome | ||
|
Comment on lines
+383
to
386
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 “Use old Home design” is enabled and the new “oldest” toggle remains at its default AGENTS.md reference: desktop/macos/AGENTS.md:L350-L352 Useful? React with 👍 / 👎.
Comment on lines
+383
to
386
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 “Use old Home design” is enabled but “Use oldest Home theme” is not, this branch renders AGENTS.md reference: AGENTS.md:L46-L46 Useful? React with 👍 / 👎. |
||
| } | ||
| } | ||
| .frame(maxWidth: .infinity, maxHeight: .infinity) | ||
| .background(useLegacyHomeDesign ? Color.clear : HomePalette.paper) | ||
| // `PageGlassLane.panel` supplies the ground for older Home surfaces; keep this clear to match it. | ||
| .background(Color.clear) | ||
| } | ||
|
|
||
| private func applyHomeSheets<Content: View>(to content: Content) -> some View { | ||
|
|
@@ -456,7 +458,7 @@ | |
| .overlay { | ||
| if isLoadingCitation { | ||
| ZStack { | ||
| // Home fills the content area, so this dim was window-wide too — the sweep missed it. | ||
| // The lane publishes the modal bounds for this legacy Home surface. | ||
| ShellModalScrim() | ||
| VStack(spacing: OmiSpacing.md) { | ||
| ProgressView() | ||
|
|
@@ -1442,9 +1444,7 @@ | |
| ) -> some View { | ||
| ZStack { | ||
| if isShowingAppsPopup { | ||
| // Home owns its panels, so this page is handed the whole content area — a full-bleed dim | ||
| // here reaches the window's edges, and the window is transparent. `ShellModalScrim` reads | ||
| // that from `PageGlassLane` and puts the dim on the lane Home's own panels take. | ||
| // `PageGlassLane` supplies legacy Home ground and bounds this scrim; do not re-derive the preference. | ||
| ShellModalScrim(onTap: dismissAppsPopup) | ||
| .transition(.opacity) | ||
| .zIndex(2) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,7 +54,7 @@ enum ShellSummonPlacement { | |
| /// It stays above `DesktopWindowLayoutPolicy.minimumContentSize`, which is the floor the | ||
| /// destinations lay out to. | ||
| static let defaultSize = NSSize( | ||
| width: DesktopWindowLayoutPolicy.maximumContentWidth, height: 700) | ||
| width: ChatComposerLayout.contentLaneMaxWidth, height: 700) | ||
|
|
||
| /// Where the shell lands on a given display. | ||
| /// | ||
|
|
@@ -123,7 +123,7 @@ enum ShellSummonPlacement { | |
| static func fitted( | ||
| _ size: NSSize, | ||
| in visibleFrame: NSRect, | ||
| maxWidth: CGFloat = DesktopWindowLayoutPolicy.maximumContentWidth | ||
| maxWidth: CGFloat = ChatComposerLayout.contentLaneMaxWidth | ||
| ) -> NSSize { | ||
| NSSize( | ||
| width: min(size.width, visibleFrame.width, maxWidth), | ||
|
Comment on lines
+126
to
129
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.
After this change permits resizing the shell up to the display width, any user-selected width above the 900-point chat lane is still reduced to 900 here when the remembered frame is used. Thus widening the redesigned or oldest Home is lost after dismissing and summoning the shell, moving it through a summon to another display, or recreating the window, despite Useful? React with 👍 / 👎. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The maximum is now derived from
window.screen, but it is only sampled during initial enforcement, activation/navigation, anddidResize; moving an already-wide window from a large monitor to a smaller one emitsdidMove/screen-change notifications without necessarily resizing it. The window therefore retains the larger display'smaxSizeand can remain wider or taller than the new visible frame, while the existing stranded-frame recovery accepts it as long as 320×240 points overlap a screen. Re-pin and clamp on window-screen/display-parameter changes as well as resize.Useful? React with 👍 / 👎.