Repository navigation
Conversation
…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.
[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
SummaryThis 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 iOS tests were not run during this review. Reviews (1) · Last reviewed commit: "test: named states for the iPad's deskto..." · Reviewed by Greptile |
| /// 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 | ||
| } |
There was a problem hiding this comment.
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.
What changes
Five iPad bugs:
Part 2 of 4 replacing #1049. It shares no files with the sync PR, so it applies to
mainalone.Why it happened
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.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.ChromeLayerunder the gallery, and it faded in aschromeOpacitywent 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.Proof
mainand pass here:TabletWorkspaceTests: the tablet tree never mountsChromeLayer; 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.-YabStatefor the desktop and mobile site switch.Checked on
Checklist
main:TabletLayoutTests.testNativeTabletKeepsBothWebViewsAndDraftsWhileResizingAndRotatingTEST_RUNNER_YAB_MODEL=ipad)../design-check --base origin/mainandscripts/swift-parse-check --base origin/mainare clean.