Skip to content

feat(widgets): six new widgets + shared empty-state CTA (F-381) + typed queries everywhere#96

Merged
th3-br41n merged 2 commits into
mainfrom
feat/widgets-round-2
Jul 3, 2026
Merged

feat(widgets): six new widgets + shared empty-state CTA (F-381) + typed queries everywhere#96
th3-br41n merged 2 commits into
mainfrom
feat/widgets-round-2

Conversation

@th3-br41n

Copy link
Copy Markdown
Contributor

Builds on #94 (the F-380/382/383/384 fixes — its commit is included here and will drop out of the diff once #94 merges; merge #94 first).

Six new widgets (13 total now)

App Widget What it shows
Journal today-journal today's entry snippet + writing streak (reuses the app's streak/date-key logic)
Books currently-reading in-progress books with progress bars — also proves the scoped-cap typed-query path from #94 (Books holds no entities.read:*)
Chat recent-messages latest messages, cross-filtered to real channels so Agent transcripts (same Message/v1 substrate) can't leak in
Agent recent-conversations conversations by recency
Automations recent-runs runs with WorkflowRunStatus-enum tone chips + a failed-count toolbar chip
Mailbox inbox unread-first (via MailFlag enum) with unread count

Each mirrors the Contacts reference pattern: manifest registrations.widgets, widget-mode mount branch, pure widget-data.ts + unit tests, tokens-only CSS, createT i18n with two-key plurals (no ICU). Chat + Mailbox manifests gain intents.dispatch:open for row-click/CTA.

F-381 — empty states now invite action

Shared WidgetEmpty in @brainstorm/sdk/widget: dim message + link-styled CTA dispatching an entityType-only open intent (routes to the type's registered opener → launches the owning app). Retrofitted into all five existing widgets (both calendar tiles, both tasks tiles) and used by all six new ones.

F-384 consumer side

Every widget now passes its typed {types} query to useVaultEntities (stable module-level const) — no widget ships the entire vault across the bridge anymore. No limit on count-bearing widgets so total chips stay exact.

Verification

  • bun run typecheck (packages + all 20 apps) green
  • bun run lint green (biome + css-tokens + app-reactivity + control-faces + app-i18n ratchets)
  • bun --bun vitest run apps packages/sdk/src/widget: 647 files / 5943 tests passed
  • Real-Electron verification runs next as dogfood session 375c (harness); results land on the PR

🤖 Generated with Claude Code

th3-br41n and others added 2 commits July 3, 2026 23:15
…presets, keyboard move/resize, typed bridge queries (F-380/382/383/384)

F-380: app (re)installs now push a payload-free apps:changed signal to the
dashboard (installer chokepoint -> preload subscription). The widgets layer
re-fetches titles and re-resolves iframe entries (a reinstall's new bundle
sha reloads the iframe live), and the icon cache re-lists — the one-shot
reads no longer race the installer and stick broken until restart.

F-382: the widget ... menu grows Size presets (Small/Medium/Large via
widgetFootprint, current one checked) and Open app; Remove stays last.

F-383: the move grip and resize grip are focusable (role=button, accent
focus ring) and nudge on the 8px grid with arrow keys (Shift = 4 cells),
persisting through the same optimistic-pending path as pointer gestures.

F-384: vaultEntities.list() accepts an optional {types, limit} query,
threaded shim -> parent proxy -> preload -> handler; filtering is pure
(widget-list-query.ts) and limit implies live-only newest-first. A
scoped-read app (Books) is admitted through a typed query covering its
grants — previously the bridge demanded entities.read:* outright.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…es in every widget (F-381)

New dashboard widgets, each mirroring the Contacts reference pattern
(manifest registration, widget-mode mount branch, pure widget-data + tests,
tokens-only CSS, createT i18n with two-key plurals):
- journal today-journal — today's entry snippet + writing streak (reuses
  the app's journal-keys/streaks/projection logic)
- books currently-reading — in-progress books with progress bars; proves
  the scoped-cap typed-query path (books holds no entities.read:*)
- chat recent-messages — cross-filtered to real channels so agent
  transcripts (same Message/v1 substrate) never leak into the tile
- agent recent-conversations — updatedAt-desc conversation glance
- automations recent-runs — workflow-name join + WorkflowRunStatus-enum
  tone chips, failed-count toolbar chip
- mailbox inbox — unread-first via the MailFlag enum, unread-count chip

F-381: shared WidgetEmpty (sdk/widget) — message + link-styled CTA that
dispatches an entityType-only open intent (routes to the app's registered
opener). Retrofitted into all five existing widgets, which also now pass
their typed {types} query to useVaultEntities (F-384 consumer side), so
no widget ships the whole vault across the bridge anymore.

Chat + Mailbox manifests gain intents.dispatch:open for row-click/CTA.

Verified: bun run typecheck + lint green; 647 test files / 5943 tests pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@th3-br41n

Copy link
Copy Markdown
Contributor Author

Real-Electron verification complete — dogfood session 375c (harness PR #26) ran against a build with #94 + this PR applied: all checks green in one pass. Catalog lists 13 widgets; every new widget renders rows or the shared empty CTA; the scoped-cap Books widget passes the typed-query gate; the empty-Contacts CTA launches the Contacts app; F-380 husk / F-382 menu / F-383 keyboard all verified with exact assertions (8px nudges, 160×160 Small snap). One residue filed as F-385: the Journal widget's snippets clip leading characters — app-side, will fix separately.

@th3-br41n th3-br41n merged commit bd3c404 into main Jul 3, 2026
3 checks passed
@th3-br41n th3-br41n deleted the feat/widgets-round-2 branch July 3, 2026 22:20
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