Skip to content

ui-sdk: push notifications show a generic Android status-bar icon instead of the brand badge #2570

Open

Description

@schlessera

Context

The push listener shows a notification with only body, tag and data (packages/ui-sdk/src/client/push-handlers.ts:83-89). Without badge, Android draws a generic bell in the status bar; without icon, the shade shows the browser's or WebAPK's default rather than the brand mark.

The brand package has no file suitable as a badge. Android uses only the alpha channel of a badge, so it needs a single-colour mark on transparency. BRAND_RASTERS (packages/ui-kit/src/brand.ts:51-59) holds the favicon, touch and manifest icons, all on opaque or coloured grounds. The single-colour master mark-mono-dark.svg (fill #f8f5ee only, no ground) is in BRAND_MASTERS (brand.ts:22-36). The rasters are rendered by renderBrandRasters (packages/ui-kit/tools/brand/generate.ts:78, bun run brand:generate) from a table of master and widths (generate.ts:35-38) and checked by packages/ui-kit/tests/brand-rasters.test.ts.

The brand exports are part of the documented package API (package-api.md "Logo assets"), so a new raster name is an additive contract change.

Guide: (no guide). Support (MDN BCD 8.1.6): the badge option is in Chrome for Android 53 and Samsung Internet 6, and not in Firefox for Android, which ignores it. icon is in all three.

Binding: Action notifications (copy and payload unchanged). The brand files' "name and presence are the promise; its bytes change only with a newly accepted design" (package-api.md): this adds a rendering of an accepted master and changes no existing file. docs/decisions/http-api-boundary.md:67 cites push-handlers.ts:72; a PR that moves that line updates the citation.

Scope

  • ui-kit: add badge-96.png to BRAND_RASTERS, rendered by generate.ts from mark-mono-dark.svg at 96px on a transparent ground, and commit the generated file.
  • ui-sdk: add icon?: string | null and badge?: string | null to PushHandlerOptions. The defaults are "/icon-192.png" and "/badge-96.png", root-relative because WEB_APP_MANIFEST_ICONS assumes a host serving brand files from its root. null omits the option. Pass both to showNotification.
  • Document the two options in the registerPushHandlers doc comment and the "Service-worker handlers" section of packages/ui-sdk/README.md, and document the new raster in package-api.md's "Logo assets".

Out of scope

  • A timestamp: the payload carries no event time, and adding one is a wire change ({ title, body, tag, url } in wire.md).
  • New artwork, or changing an existing brand file.
  • The Badging API (navigator.setAppBadge).
  • Notification actions, image, renotify or vibrate.
  • Serving the files: the host decides where brand files live and overrides the paths.

Acceptance criteria

  • BRAND_RASTERS includes badge-96.png; the file is 96x96, every opaque pixel has one colour, and the corners are fully transparent. brand-rasters.test.ts asserts all three and that the file matches a fresh renderBrandRasters() output.
  • packages/ui-kit/tests/brand-assets.test.ts proves the new name is in the packed tarball and resolves through @schlessera/brain-ui-kit/brand/badge-96.png.
  • showNotification receives icon: "/icon-192.png" and badge: "/badge-96.png" by default, the host's values when given, and neither key when given null. Covered in packages/ui-sdk/tests/push-handlers.test.ts and failing before the change.
  • Firefox for Android shows the notification unchanged (badge is ignored, icon honoured); no feature detection is needed because unknown options are ignored.
  • package-api.md, the api-report and a changeset for ui-kit and ui-sdk land in the same commit, prefixed CONTRACT:.

Verification

bun run --cwd packages/ui-kit brand:generate
bun run test packages/ui-kit/tests/brand-rasters.test.ts packages/ui-kit/tests/brand-assets.test.ts packages/ui-sdk/tests/push-handlers.test.ts
bun run api-report
bun run typecheck
bun run lint

Contract impact

  • This touches the integration contract, so it needs the contract label, a CONTRACT: commit prefix, and the doc updated in the same commit.
  • This changes a published package's behaviour, so it needs a changeset.

Activity

  1. added
    type: feat
    area: ui-sdk
    area: ui-kit
    priority: p3
    agent-ready
    contract
    on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyarea: ui-kitarea: ui-sdkcontractpriority: p3type: feat

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions