fix: size the account settings avatar to the window, not the device screen - #4285
Open
guillaume-flambard wants to merge 1 commit into
Open
Conversation
…creen NCAccountSettingsView is presented as a page sheet, so the width available to it is the sheet's, not the display's. Framing the avatar at UIScreen.main.bounds.width asks for a child wider than its container whenever the presentation is narrower than the screen: a page sheet on iPad, Split View, Slide Over or Stage Manager. Constrain the height and let the width fill what the parent offers, which keeps the avatar 65pt tall and centred at every window size. UIScreen.main is also deprecated in iOS 27, where layout is expected to follow the scene rather than the device. Signed-off-by: Guillaume Flambard <g.flambard@gmail.com> Assisted-by: claude-code:claude-opus-5
guillaume-flambard
marked this pull request as ready for review
September 6, 2026 17:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
NCAccountSettingsViewis presented as a page sheet fromNCFilesNavigationController:The width available to the view is therefore the sheet's, not the display's. The avatar is framed at the display's width:
So the row asks for a child wider than its container in every presentation narrower than the screen: a page sheet on iPad, where
UIScreen.main.bounds.widthis 1024pt or more against a sheet of roughly 700pt, and equally in Split View, Slide Over and Stage Manager..scaledToFit()keeps the picture 65pt tall, but the frame that participates in theFormandTabViewlayout is still display-wide.The change
Constrain the height, then let the width fill what the parent offers:
Same intent, one line longer, and correct at any window size.
UIScreen.mainis also deprecated in iOS 27, where layout is expected to follow the scene rather than the device, so this removes one of the reads that will need revisiting anyway.What I verified, and what I did not
I could not build the app: it needs Xcode 26.1 and a
GoogleService-Info.plist, and I have neither on this machine. So I have not photographed the symptom inside Nextcloud, and I am not claiming a specific visual defect.What I did check is the layout behaviour the change relies on, rendered offscreen with
ImageRendereroutside the project: a child frame fixed at 1024pt inside a 500pt container overflows it on both sides, whilemaxWidth: .infinityfits and stays centred. A reviewer can confirm the real thing in a second by opening account settings on an iPad or in Split View.I found no existing issue about this, and I did not open one, because their bug report template asks for a reproduction and environment data I would have had to invent.
🤖 AI (if applicable)
The commit carries an
Assisted-bytrailer as the organisation policy requires. The reasoning, the choice of fix and the sign-off are mine.