Skip to content

feat(system): add the Needs You home screen widget - #348

Open
Tarquinen wants to merge 2 commits into
widgets-redesignfrom
widgets-needs-you
Open

Tarquinen wants to merge 2 commits into
widgets-redesignfrom
widgets-needs-you

Conversation

@Tarquinen

@Tarquinen Tarquinen commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Adds the Needs You widget: the oldest permission or question waiting for you, with the same buttons its notification offers (from PushShown), sent through PushActionReceiver. A tap shows "Sending…" until the reply is sent or fails, and a failure keeps the request on the widget and shows the existing "Couldn't send" notification. The 2x2 shows the count and the waiting projects. With nothing waiting it shows All Caught Up and how many sessions are working.

Every image is light | dark from the widget lab, except the last one, which is from the Pixel launcher.

Permission at 2x2, 4x2 and taller
Question, and a question with more than three options
Edge cases: a long command wrapped at spaces (at 250 wide it only fits with Open), no Always Allow, a truncated request (Open only), Sending…
All Caught Up and not paired
Font size 1.3: the three buttons wrap to two rows, and commands wrap at spaces
Pinned on the launcher at 4x2, resized to 4x3 and 2x3

  • PushNotifications now builds the permission and answer intents in one place for both the notification and the widget.
  • Commands are wrapped by the widget with the rule PushShown counts by (fill each line, break at spaces, break a longer word at the line's end), so what is drawn is what is counted.
  • When the whole command or question doesn't fit, the widget offers only Open, so nothing is allowed unseen.

Verified: check :feature:system passes on the VM. Every size and state was checked in light and dark and at font 1.3. The widget was pinned and resized on the launcher, and tapping Allow Once there sent the broadcast. The fixture has no real server, so the reply failed, the request stayed, and the failure notification appeared. A successful reply removing the request wasn't checked end to end, because pushes can't reach the emulator.

Not included: "Reply by voice" (no existing action does it), and typed replies inside the widget (widgets can't take text input; "Type a reply…" opens the session).

Part of #287

Shows the oldest permission or question waiting for the person, with the
buttons its notification offers (from PushShown), sent through
PushActionReceiver. A tap shows "Sending…" until the reply is sent or fails;
a failure keeps the request and shows the existing couldn't-send
notification. The small size shows the count and the waiting projects, and
nothing waiting shows All Caught Up with the working sessions.
PushNotifications now builds the permission and answer intents in one place
for the notification and the widget.

Verified: scripts/check.sh :feature:system on the VM; every size and state
in light and dark and at font 1.3 in the widget lab; pinned on the Pixel
launcher, resized to 4x3 and 2x3, and tapped Allow Once (the lab ref has no
server, so it showed the failure notification and kept the request).
The widget let the TextView pick its own break points, so a long command
broke after "/" and before "." ("$ ./" alone on the first line), and the
lines it drew could differ from the lines it counted when deciding whether
the whole command is in view.

PushShown.wrapped now returns the lines the existing count was based on
(fill each line, break at spaces, break a longer word at the line's end),
and wrappedLines is its size, so the notification is unchanged. The widget
draws those lines with non-breaking spaces and counts the same list.
CODE_CHARACTER goes from 6.8 to 7.6 dp: a 12sp monospace advance is 7.2 dp,
so a wrapped line never wraps again.

Verified on the emulator with the long-command fixture at 360x220, 360x360,
250x220 and 250x300, at font 1.0 and 1.3, light and dark;
check :feature:system passes.

This branch has not been deployed

No deployments
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