Skip to content

iPad: downloads ask, desktop sites, ⌘, Settings, All Tabs without phone chrome - #1107

Closed
advenimus wants to merge 16 commits into
yetanotherbrowser:mainfrom
advenimus:advenimus/ipad-bug-fixes
Closed

advenimus wants to merge 16 commits into
yetanotherbrowser:mainfrom
advenimus:advenimus/ipad-bug-fixes

Conversation

@advenimus

Copy link
Copy Markdown
Contributor

What changes

Five iPad bugs:

  • Downloads now ask, then save.
  • Sites send their desktop pages, as in Safari.
  • ⌘, opens Yab's Settings.
  • All Tabs closes without the phone's chrome flashing.
  • The Settings card's head sits clear of the top.

Part 2 of 4 replacing #1049. It shares no files with the sync PR, so it applies to main alone.

Why it happened

  • Downloads never started. The tablet tree never mounts ChromeLayer, where the phone keeps the download question. A site's first file asked a question nothing showed. The iPad gets a downloads button in the sidebar foot, and in the toolbar while the sidebar is away, that shows the question. The layout PR (4 of 4) gives it the Mac's ring and flight.
  • Sites sent their phone pages. Every navigation set preferredContentMode = .mobile. The iPad now leaves WebKit its recommended mode, and the site setting is one three-way choice (default, desktop, mobile), read in one place. An older saved value migrates. Choosing Request Desktop Site gets the desktop site even in a narrow split pane.
  • ⌘, opened the iOS Settings app. Yab's Settings command was disabled while Settings was up, so the key fell through to the system's own Settings item. It now stays Yab's.
  • The phone's plate, back button and stack circle flashed after All Tabs. The tablet tree mounted ChromeLayer under the gallery, and it faded in as chromeOpacity went back to 1. It is no longer mounted. The iPad draws no stack circle, and the closing plan takes a "has a stack" input so the cards that aren't chosen fade in place.
  • Settings' close button touched the top. The card's head now sits on the top inset, and a tap beside the card closes it.

Proof

  • Logic: tests that fail on main and pass here:
    • TabletWorkspaceTests: the tablet tree never mounts ChromeLayer; a downloads button is on screen.
    • PageMenuTests: iPad and iPhone defaults, and the three-way choice.
    • BrowserKeysTests: ⌘, stays Yab's while Settings is up.
    • TabStackTests: the flat closing plan.
  • Visible change: before and after, iPad Pro 13" simulator. New named states: -YabState for the desktop and mobile site switch.
Before After

Checked on

  • iPad Pro 13" and iPhone 18 Pro simulators, iOS 27.2. Yab Dev on an iPad Air and an iPhone 18 Pro.
  • Engine(s) tried: WebKit (the iOS app).

Checklist

  • The suites this touches: iPad 91 run, iPhone 75/75. Known failures that also happen on main:
    • TabletLayoutTests.testNativeTabletKeepsBothWebViewsAndDraftsWhileResizingAndRotating
    • one Duo layout test on iPad
  • iPad UI tests for the download question, the list and All Tabs pass (run with TEST_RUNNER_YAB_MODEL=ipad).
  • ./design-check --base origin/main and scripts/swift-parse-check --base origin/main are clean.
  • These restore how the iPad is meant to look and work, or match Safari. The downloads button is the smallest place for the question; its Mac look is in iPad: lay out and behave like the Mac app #1105 and the layout PR.

…ing the account

Root cause: SyncBridge.receive took the account on the first catch-up
page that carried any space. The server sends a catch-up oldest change
first, 500 records a page, so another space (ECI) can come pages before
the account's first space. The rebuild then found no first space to merge
the starting Personal into, imported it, and flushLocal pushed it as a new
space. An iPhone that joined this way gave the account a second Personal,
which every device, the iPad's sidebar foot included, shows.

Taking the account from a batch now needs the line live; the catch-up's
end already takes it in changed(.live), as a rejoin does.
…irst and deletes it

Root cause: before the join waited for the whole catch-up, an iPhone could
take the account on a catch-up page that had Work but not yet the first
space. Its used starting Personal then had no first space to merge into,
so flushLocal sent it up under a fresh id (browser-ids.json maps
local.personal to it). The existing prune never removes it: it holds
pages, and its maker is a living device.

Only the device that made the copy repairs it, on each live line, beside
pruneEmptyPersonals: its own mapping names the copy, the first space is
in, the copy is still Personal with the house, has no sign-ins or folders,
and holds no other device's tab of today. Its tabs go into the first space
with the existing merge (pins pinned, kept kept), the moves are written,
and the copy is deleted only once the journal holds nothing of it but
blanks. One device only, because a tab's removal wins and two devices
moving and deleting at once could lose a tab. The merge also no longer
doubles a pin the first space already has at that address.
Three places decided whether a space is still the starting Personal:
the join's merge (name only), the empty-Personal prune and the
broken-join repair (name and house, trimmed). They now share
isStartingPersonal(name:icon:), so the merge, too, treats a starting
space given another icon as the person's own, as the repair already did.

The merge's pin dedupe built its set from every pin of the first space,
a pin with no address as "". Blank pins never reach the compare (isBlank
drops them first), so no pin was lost, but the set now holds only real
addresses and a test pins that two address-less pins are no duplicates.
SyncBridge.swift is over 3,000 lines, and the broken-join repair is a
self-contained rule with its own tests. joinDuplicate,
repairJoinDuplicate and isStartingPersonal move as they are into
SyncBridge+JoinRepair.swift; the bridge's app, mirror and ids become
readable (private(set)) and its log internal so the extension can reach
them. No behavior change; SyncBridgeTests pass as before.
A first catch-up cut after a page (Work in, the first space not yet)
left a journal with spaces. The next launch took the account from it
before the line was up, and the starting Personal went up as a second
Personal. The in-session path already waited for live; the launch path
read "the journal holds spaces" as "caught up".

The phone's own association file (browser-ids.json) now keeps a mark
set when the line first reaches live, and a launch takes the account
from the journal only with it. Fixture worlds and seeds keep today's
rule: they have no saved association.

Migration: a file saved before the mark existed is read as caught up.
It is written only after the iPhone took the account, so an install
that joined on an older build keeps taking it offline at launch.
Every navigation was asked for with preferredContentMode .mobile, so an
iPad got Google's and other sites' phone pages. An iPad now leaves WebKit
its recommended mode (desktop at full width, mobile in a narrow window),
and a site's switch in Site Controls asks for its mobile site instead,
kept as Site.mobile. The iPhone keeps mobile unless a site asks desktop.
SiteSettings kept two flags, desktop and mobile, and every reader had to
know which one counted on which device. Two booleans also allow a state
nobody can pick (both set). The site now keeps one Version (automatic,
desktop, mobile), read in contentMode alone: automatic is WebKit's
recommended mode on an iPad and mobile on an iPhone. The device default
lives in SiteSettings, so WebPool no longer repeats it.

Settings saved with the old fields load as the new choice and are saved
again in the new shape.
On iPad, turning desktop on for a site forgot the choice, back to the
default, WebKit's recommended mode. That mode loads the mobile site in
a narrow pane, while the switch said Desktop.

An explicit desktop choice is now kept as desktop on every device. A
site never touched stays recommended, mobile stays mobile, and an
iPhone turned back to mobile still forgets the choice.
The tablet tree mounted ChromeLayer while All Tabs was up, so the phone's
plate, back button and the stack's circle faded in over the page as the
gallery closed (chromeOpacity returning to 1) and vanished only when it
was gone. The iPad's All Tabs lives in the sidebar: the phone chrome is no
longer mounted there, the circle is not drawn, and the other cards fade in
place rather than flying into a circle the iPad doesn't have.
Metrics.Tablet sat in TabletLayoutPreferences.swift, beside the layout
choices. Every other size is in Design/Metrics.swift, and the fixes that
follow add the iPad's downloads sizes there. Nothing changes on screen.
Yab had no ⌘, of its own, so the key went to the system's Settings item,
which left Yab for the iOS Settings app. Settings… now sits in the app's
menu with ⌘, as on the Mac. The key stays Yab's while Settings, Join or a
chat is up: turned down there, it went to the system's item again. It
does nothing then.
The iPad's workspace never mounts ChromeLayer, where the phone keeps the
download question, the Now line and the Downloads page. A site's first
download asked a question nothing showed, so it never started.

- A downloads button in the sidebar's foot, and in the toolbar while the
  sidebar is away and there is a file: its popover asks a site's first
  file, then lists every file.
- Site Controls gains Downloaded Here and shows the Downloads page; its
  Downloads permission had the microphone's mark.
- Share sheets point under the toolbar on iPad, and topController skips a
  popover on its way out, so Share from Site Controls presents.
…eside it closes it

On iPad Settings is a card, but its head started at the card's very top,
so the close button sat against the edge. It now stands 12 points in, as
from the sides. The dimmed ground beside the card took no taps; a tap
there now closes it, as a form sheet does.
The phone's chrome on iPad was behind both the download question missing
and the plate flashing after All Tabs. A test hosts the real
RootController at an iPad's size and checks no ChromeHostController is
mounted with All Tabs shut, opening, closing into a card and gone; the
same window at an iPhone's width mounts it, so the probe is shown to see
it. A UI test taps an All Tabs card and checks the workspace returns.
tablet.site.desktop and tablet.site.mobile open Site Controls with the
iPad's default and with the site asked for as a mobile one, for the
before and after pictures.
@greptile-apps

greptile-apps Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[High impact] The PR reaches iPad browsing and account sync across devices.

The PR appears safe to merge, with a non-blocking desktop-switch issue worth fixing.

Findings

  1. P2 Desktop switch misreads automatic mode ▶

Summary

This PR adds iPad download prompts and lists, changes desktop-site defaults, keeps ⌘, inside Yab, and adjusts All Tabs and Settings. It also changes sync startup and repairs duplicate Personal spaces.

  • The iPad shows download questions and files in a Downloads popover.
  • Sites use the page version chosen for that site and device.
  • ⌘, opens Yab's Settings and stays with Yab.
  • All Tabs closes into the iPad page without phone chrome.
  • The iPad Settings card sits below the top edge and closes from outside.
  • Sync waits for a full account catch-up and repairs eligible duplicate Personal spaces.

The iOS tests were not run during this review.

Reviews (1) · Last reviewed commit: "test: named states for the iPad's deskto..." · Reviewed by Greptile

Comment on lines +179 to +182
/// The switch in the menus: on unless the site is asked for as a mobile one.
func desktop(_ host: String?, isPrivate: Bool) -> Bool {
contentMode(host, isPrivate: isPrivate) != .mobile
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Desktop switch misreads automatic mode. On an iPad, .automatic returns .recommended, which can load a mobile page in a narrow pane. This comparison still reports desktop as on. Since pageMenuDesktop() flips that value, the first tap forces .mobile instead of requesting desktop; users must turn the switch off and back on to get .desktop.

Keep the automatic choice distinct in the control, or use the page's effective mode when choosing the next action.

@advenimus

Copy link
Copy Markdown
Contributor Author

Split smaller, as asked on #1049: #1129 (All Tabs and the Settings card), #1130 (desktop pages) and #1132 (downloads button). Greptile's finding here is fixed in #1130.

@advenimus advenimus closed this Nov 25, 2026
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