Repository navigation
fix: read the macOS 27 Find My sidebar - #36
Conversation
- Tab switching addressed menu "View" of menu bar 1, which macOS 27 no longer resolves; prepareTab ignored the error, so people/items silently parsed the Devices tab. Click through the menu bar item instead and return the error. - Row text now starts at ~59pt, on top of the fixed 60pt text-column cutoff, so Vision's left-edge jitter dropped about half the lines and split names from locations. Detect the column from the OCR lines (clamped between 48pt and the old 60pt cutoff). - Treat the new "Nearby" distance label as a distance, count the new "Me" tab when finding the sidebar edge, and drop the trailing battery glyph segment after the staleness. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
| floorPx := fallbackPx * 4 / 5 | ||
| var xs []int | ||
| for _, l := range lines { | ||
| if strings.TrimSpace(l.Text) == "" || l.Y < rowStartY || l.X < floorPx { |
There was a problem hiding this comment.
The new cutoff still drops macOS 27 row text in watch. watchPixelLayout passes a 160px fallback at 2× scale, so DetectTextColumnMin sets its floor to 128px. The captured names and locations at 118–122px are excluded before detection, and the returned cutoff cannot fall below 128px. watch devices therefore returns no devices for the new fixture, even though the ordinary command reads it correctly.
Align the watch cutoff with the 60pt cutoff and test this fixture through the watch path.
Prompt To Fix With AI
This is a comment left during a code review.
Path: internal/findmy/findmy.go
Line: 412-415
Comment:
**Watch misses visible devices**
The new cutoff still drops macOS 27 row text in `watch`. `watchPixelLayout` passes a 160px fallback at 2× scale, so `DetectTextColumnMin` sets its floor to 128px. The captured names and locations at 118–122px are excluded before detection, and the returned cutoff cannot fall below 128px. `watch devices` therefore returns no devices for the new fixture, even though the ordinary command reads it correctly.
Align the watch cutoff with the 60pt cutoff and test this fixture through the watch path.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Valid, thanks. watch had its own 80pt cutoff, so it read no macOS 27 rows. Both paths now scale the shared SidebarRightPt / TextColumnMinPt constants (55dce50), and TestParseDevicesMacOS27SidebarAtSharedLayout runs the fixture at the shared layout.
| case "People", ls.PeopleTab: | ||
| return true, true | ||
| case "Devices", "Items", ls.DevicesTab, ls.ItemsTab: | ||
| case "Devices", "Items", "Me", ls.DevicesTab, ls.ItemsTab: |
There was a problem hiding this comment.
Translated labels lack coverage
The new Me and Nearby checks only cover English, while the existing tabs use GetAppStrings. If macOS shows translated labels, an unrecognized fourth tab can leave the detected sidebar ending at Items, dropping distances. A translated Nearby that survives the bounds check falls through as a name or location instead of a distance.
Add the new labels to AppStrings and cover a non-English sidebar to protect supported languages from missing distances or incorrectly grouped rows.
Knowledge Base Used: Localization and native helper bridge
Prompt To Fix With AI
This is a comment left during a code review.
Path: internal/findmy/findmy.go
Line: 511
Comment:
**Translated labels lack coverage**
The new `Me` and `Nearby` checks only cover English, while the existing tabs use `GetAppStrings`. If macOS shows translated labels, an unrecognized fourth tab can leave the detected sidebar ending at `Items`, dropping distances. A translated `Nearby` that survives the bounds check falls through as a name or location instead of a distance.
Add the new labels to `AppStrings` and cover a non-English sidebar to protect supported languages from missing distances or incorrectly grouped rows.
**Knowledge Base Used:** [Localization and native helper bridge](https://app.greptile.com/shahine/-/custom-context/knowledge-base/omarshahine/findmy-cli/-/docs/localization-and-helper-bridge.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Valid. Added MeTab and NearbyLabel to AppStrings for all 41 locales, pulled from the system bundles: ME_TAB in FindMy.app's Localizable.loctable and DISTANCE_FROM_USER_NEARBY in FindMyCore.framework's Models.loctable. TestLocaleTableHasMacOS27Labels checks that every locale has both, plus the French values. Distances are now also classified by column, so a translated or misread label in the right-hand column can't become a location.
…Nearby - watch used its own 80pt text cutoff, which drops every macOS 27 row. Both paths now scale the same SidebarRightPt / TextColumnMinPt. - Group OCR lines into rows by vertical gap instead of alternating name/location. Shared items add a third "Shared with X" line and a row scrolled under the header shows only its status line; either one shifted every following row. The distance is read by column, so an OCR slip like "2,317 ml" no longer becomes the location. - Add MeTab and NearbyLabel for all 41 locales, from FindMy's Localizable.loctable (ME_TAB) and FindMyCore's Models.loctable (DISTANCE_FROM_USER_NEARBY). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The list commands only read rows that fit in the Find My window. With Family Sharing the Devices list runs to dozens of rows (36 on the test Mac against 9-11 visible). ScrollPages scrolls to the top, reads page by page in third-of-a-list steps, backs up when a step jumped past rows (the helper's trackpad gesture is accelerated), stops after two pages add nothing, and scrolls back to the top. Without Accessibility it reads one page and says so on stderr. Rows now need a name line and a status line: a lone line is a row cut off at a page edge or one whose name Vision missed, and a group starting with a status line has lost its name the same way. Distances are taken by column, so an OCR slip like "2,317 ml" no longer becomes the location. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Merge proof for #35 (macOS 27.0.1, en-US, run live on this Mac): Root causes fixed
Tests: go vet and go test pass, with new fixtures from real macOS 27 captures (generic names) for devices, scrolled shared items, OCR "ml", and a missing name. CI is green on 69d8589. Live proof (real Find My, 1024x768 window):
Not in scope: |
Fixes the parsing half of #35 on macOS 27.0.1.
Root causes
SwitchTabclickedmenu item X of menu "View" of menu bar 1. On macOS 27 that errors withCan't get menu "View"(-1728), andprepareTabdiscarded the error (_ = SwitchTab(tab)), so the CLI parsed whatever tab was open. It now goes throughmenu 1 of menu bar item "View"(which also works on older releases) and returns the error.textColMinPx= 120px) cutoff. Lines at x≥120 survived and lines at 118-119 didn't, so names lost their location lines and the walk fused rows.DetectTextColumnMinfinds the shared left edge of the row text and cuts 12px left of it, clamped between 4/5 of the fixed cutoff (which keeps the ~48pt icon column out) and the fixed cutoff itself, so older layouts are unchanged. The three parsers now share onesidebarRowsfilter, andfindSidebarNameLine(--zoom / ring) uses the same detection.Nearbyin the distance column, a fourthMetab (needed for the sidebar right-edge detection, otherwise distances fall outside it), and a trailing battery-glyph segment (Home • Now • CD) that ended up in staleness.Tests
macos27_sidebar_test.go: geometry copied from a real macOS 27 capture (generic names) runs throughParseDevices, plusDetectTextColumnMincases for macOS 27, the older layout and a lone fragment.splitLocationStalenesscases for the trailing segments.Not in this PR
Sidebars longer than the window: the CLI has never scrolled the sidebar, so only on-screen rows are read. Tracked separately.
🤖 Generated with Claude Code