feat(widgets): six new widgets + shared empty-state CTA (F-381) + typed queries everywhere#96
Merged
Merged
Conversation
…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>
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. |
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.
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)
today-journalcurrently-readingentities.read:*)recent-messagesMessage/v1substrate) can't leak inrecent-conversationsrecent-runsWorkflowRunStatus-enum tone chips + a failed-count toolbar chipinboxMailFlagenum) with unread countEach mirrors the Contacts reference pattern: manifest
registrations.widgets, widget-mode mount branch, purewidget-data.ts+ unit tests, tokens-only CSS, createT i18n with two-key plurals (no ICU). Chat + Mailbox manifests gainintents.dispatch:openfor row-click/CTA.F-381 — empty states now invite action
Shared
WidgetEmptyin@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 touseVaultEntities(stable module-level const) — no widget ships the entire vault across the bridge anymore. Nolimiton count-bearing widgets so total chips stay exact.Verification
bun run typecheck(packages + all 20 apps) greenbun run lintgreen (biome + css-tokens + app-reactivity + control-faces + app-i18n ratchets)bun --bun vitest run apps packages/sdk/src/widget: 647 files / 5943 tests passed🤖 Generated with Claude Code