feat: home-screen widgets with matches waiting for a reply (WidgetKit + Glance)#83
Open
GSTJ wants to merge 8 commits into
Open
feat: home-screen widgets with matches waiting for a reply (WidgetKit + Glance)#83GSTJ wants to merge 8 commits into
GSTJ wants to merge 8 commits into
Conversation
Adds a widget on both platforms showing how many matches are waiting for a reply, with up to 3 dog avatars. Tapping it deep links into the messages tab (pegada://messages). - iOS: WidgetKit extension (small + medium) generated at prebuild by @bacons/apple-targets from targets/matches-widget; reads a JSON snapshot from App Group UserDefaults (group.app.pegada) and avatar files from the shared container. - Android: androidx.glance 1.1.1 widget inside a new local Expo module (modules/pegada-widget) with its own receiver + provider XML wired through the library manifest; reads the same snapshot from SharedPreferences. - One shared JS service (services/matchesWidget) builds the localized snapshot, downloads up to 3 avatars via the new expo-file-system API (App Group container on iOS, document dir on Android) and hands it to the native module, which reloads the OS timelines. Synced on (app) mount, foreground/background transitions, matches query updates, and cleared to a sign-in prompt on logout. - All user-facing copy is localized (en + pt-BR): snapshot strings via i18next, pre-snapshot placeholders via Android string resources and a minimal locale check in Swift. - Version bumped to 1.5.0 (native change).
…nsion target iOS allows one widget extension per app, so targets/matches-widget becomes the shared targets/pegada-widgets target (deploymentTarget 16.2, byte-identical config across feature branches). The widget keeps its iOS 17 floor via @available / #available gates in MatchesWidget.swift and PegadaWidgetsBundle.swift. Also drops the hardcoded appleTeamId; the team id comes from EAS credentials at release build time.
…nches The app-intents and live-status branches declare ^4.0.7; the exact 4.0.7 pin here made every cross-branch merge conflict on package.json + lockfile for no behavioral difference (both resolve to 4.0.7).
…anguage
The widget colorsets were silently EMPTY: expo-target.config.js used
{ color, darkColor } but @bacons/apple-targets expects { light, dark },
so every Color("...") in the widget resolved to nothing. Colors now
mirror packages/shared/themes exactly (same hsl strings, true black
dark theme, dark-variant brand pink).
iOS (WidgetKit):
- bundle Gilroy (Bold/SemiBold/Medium/ExtraBold) in the extension via
the synced target folder + UIAppFonts, with a CTFontManager runtime
registration fallback; map weights to the app's roles
- lowercase "pegada" wordmark (matches the logo), overflow +N as a
brand-pink coin inside the avatar stack instead of loose text,
medium family now shows the overflow instead of dropping it
- single paw motif per surface: pawprint watermark bleeding from the
bottom-trailing corner at 10% opacity, emoji hero removed from the
empty state
Android (Glance):
- same theme tokens via day/night ColorProvider, tinted paw glyph in
the header, background-colored ring around avatars, brand-tinted
initial badge when a photo is missing or fails to decode (slots no
longer collapse), Medium-weight message text
- Glance 1.1.1 ceiling documented in-code: no custom typeface, no
gradients, no negative spacing; sizes/weights compensate
Verified on iPhone 17 Pro Max sim + API 35 emulator, light and dark,
populated and empty states.
The MEDIUM home-screen widget (WidgetKit + Glance) rendered the match
count as a big pink numeral, then repeated it in the counted i18n
string right underneath ("5" followed by "5 matches waiting for your
reply"). Add a countless variant (widget.waitingForReplyCountless) and
thread it through the snapshot contract as `messageCountless` so
layouts that already show the numeral can drop the count from the
text instead of duplicating it. SMALL keeps the counted string since
it has no numeral.
…urated P3 @bacons/apple-targets always tags generated colorset Contents.json as "color-space": "display-p3", but it gets there by parsing the config's CSS color as plain sRGB and writing those components verbatim - it never actually gamut-converts. On a wide-gamut display that made the widget pink read visibly more saturated than the app's real brand pink (measured ~#FF55A3 vs #EF62A1). The plugin has no color-space option, and prebuild rewrites every colorset unconditionally, so a hand-fixed Contents.json would just get clobbered on the next run. Feed the plugin the sRGB->Display-P3 gamut-mapped equivalent of each theme color instead (as rgb() strings, computed by the new scripts/srgb-to-p3-widget-colors.js), so the P3-tagged colorset it writes renders back to the original sRGB appearance on a P3 display. Survives prebuild by construction since it's regenerated from the config every time.
oxfmt --check caught these on CI: a local expo prebuild run after the P3 color-space fix regenerated the colorsets without a trailing newline. No color values changed, formatting only.
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.
Summary
Home-screen widgets on iOS and Android showing how many matches are waiting for your reply, with up to three dog photos, tapping opens the messages tab.
Details
Testing steps