Skip to content

Keep the bar's buttons in place under a long name - #205

Merged
andiwand merged 1 commit into
mainfrom
title-keeps-buttons
Sep 24, 2026
Merged

andiwand merged 1 commit into
mainfrom
title-keeps-buttons

Conversation

@andiwand

@andiwand andiwand commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

A tester reported that a long document name pushes the buttons off the bar.

Cause

The name was an item in the bar, with a width cap. When the pencil and the magnifier join the bar after the document opens, the iOS 26 bar keeps the old, wider size of the name. So the name pushes the buttons out.

Fix

The name now sits on top of the bar, not in it. The name cannot move a button. The name gets the room that the buttons leave, and it is shortened in the middle.

The room is calculated from the number of buttons, as before. I tried two ways to measure the real positions of the buttons, but neither works on iOS 26:

  • UIBarButtonItem.frame(in:) gives an empty frame for a button that comes back into the bar.
  • Empty marker items get a minimum size, and Auto Layout does not follow them when the bar moves them.

Checks

  • The unit tests pass on iOS 17.5 (iPhone 15 Pro) and iOS 26.5 (iPhone 17).
  • On iOS 26.5 the test that checks for overlap between the name and each button is skipped. In a test window, that bar does not draw a button that comes back into it.
  • I checked the app by hand on an iPhone 17e with iOS 26.5, with a long name and all four buttons. The buttons stay in place, the name reads "Quart…word", and there is space on each side of the name.

🤖 Generated with Claude Code

A long document name pushed the buttons off the bar. The name now sits on
top of the bar instead of in it, so the buttons stay in place. The name
gets the room that the buttons leave, and it is shortened in the middle.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QrcvRrDSBpLGfUCv9pfDS5
@andiwand
andiwand merged commit 223be5f into main Sep 24, 2026
4 checks passed
@andiwand
andiwand deleted the title-keeps-buttons branch September 24, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant