feat: add profile message action and read-only status - #219
Conversation
4be3392 to
3a0c930
Compare
Open or reopen the one-to-one DM from the human profile through session.directMessages.open, navigate to the relay-confirmed channel in the captured viewer/community scope, and clear that DM's local sidebar hide. Show the self-declared NIP-05 identifier (unverified) and a one-time NIP-38 general status snapshot. Co-authored-by: Kalvin Chau <kalvin@block.xyz> Signed-off-by: Kalvin Chau <kalvin@block.xyz> Signed-off-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
3a0c930 to
1dcc1b0
Compare
wesbillman
left a comment
There was a problem hiding this comment.
Carl, an automated reviewer, commenting via Wes’s GitHub account.
Changes requested: one P2 recipient-policy bypass, detailed inline. Preserve the existing managed-agent restriction for this new entry point and add its eligibility/lifecycle regressions. No other material blocker found in the scoped Message, hidden-DM restore, status or NIP-05 review.
Reviewed head 1dcc1b015fe32c7854bb66dc9f2740720e1cdd54 against base/merge-base 8842b3ac05862e069ab0adf2f30e11a3af084042, with independent UI and status/trust lanes. A temporary mounted React probe used the real relay session, synthetic transport and signed profile/DM roster: the human control passed; the unowned-agent policy assertion failed after open and navigation succeeded. Production files were unchanged. Existing hosted required CI, Chromium/WebKit and DCO checks passed. No broad local rerun, live-relay write or native acceptance was performed.
Known agents get the profile Message action only while this community's ready native control manages them, matching New message. Availability and activation both check session.agentChoices; humans are unchanged. Co-authored-by: Kalvin Chau <kalvin@block.xyz> Signed-off-by: Kalvin Chau <kalvin@block.xyz> Signed-off-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
Summary
Human profile v2, built on the DM capabilities from #156.
session.directMessages.open([pubkey], signal), then navigates to the relay-confirmed channel as aconversationtarget, using the viewer/community scope captured at click time.directMessages.subscribeOpenedfires only afteropen()confirms the roster.useHiddenDmslistens to it and clears that DM's local hide.open()success, not to navigation, so back/forward and selection restore don't unhide DMs the user deliberately hid.open()succeeds, before the first send completes.Profile.nip05is parsed and shown as "NIP-05 (unverified)". It is not DNS-verified.[{kinds:[30315], authors:[pubkey], "#d":["general"], limit:1}]when the profile opens. The profile shows the newest self-signed event'semojitag plus its text. Blank, foreign-author and failed reads show nothing, and a late result after switching profile is ignored.:shortcode:emoji render as plain text.docs/profiles.mdis updated for all of the above.Tests
Unit (vitest):
ProfilePanel.message.test.tsx(6): availability gating, busy state, navigation target and scope, failure and retry, stale abort.ProfilePanel.status.test.tsx(5): newest status with emoji, cleared status, another author's status, failed read, late result after switching profiles.useHiddenDms.test.tsx: an opened DM is unhidden and other hidden DMs stay hidden.direct-messages.test.ts: the notification fires only after a valid roster.profile-details.test.ts: NIP-05 parsing.Browser (Playwright, Chromium + WebKit):
new-message.spec.mjs› "profile Message opens a fresh DM and restores a hidden one". It is browser-only because it drives the real panel → DM open → navigation → sidebar-hide flow across the app host.profiles.spec.mjs: the fixture gives Mic a kind 30315 status, and the test asserts it renders in the real panel.tests/browser/fixture.mjsaccepts this read, with the query shape pinned, so it doesn't trip the unexpected-query guard.Validation
All of the following ran at
df120cc, rebased one02fe33:bin/pnpm tsc --noEmit -p .: clean.bin/pnpm biome checkon the changed files: clean.git diff --checkagainst the base: clean.bin/pnpm vitest run: 2797 pass, 2 fail (read-state.test.ts,unread-startup.test.ts). This branch doesn't touch either file, and both passed 3/3 when rerun on their own.playwright test --config tests/browser/playwright.config.mjsfor profiles, profiles-appearance, profile-channel-focus and new-message: 14/14 pass (7 × Chromium and WebKit).Deferred: full browser suite and hosted CI.