mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-06 03:38:23 +00:00
An audit of what the cordn chat still defines for itself turned up three
components it was reimplementing rather than reusing. One of them I had
written two commits earlier, which is the more embarrassing half.
**The upload dialog.** ChatFileUploadDialog has zero Note/LocalCache
references and is used by the DMs, Marmot, Concord, minichat, the public
channels and Nests — every upload surface except cordn, which had
CordnAttachmentDialog instead. Mine was also worse: a caption and
nothing else, against the shared one's caption, media-quality slider,
metadata stripping and server picker. Marmot already proved the pattern
works for a surface with its own encrypted pipeline — it passes
`upload = { MarmotFileUploader(...).uploadMip04(viewState = state, …) }`
— and cordn now does the same with CordnMediaService behind it. The
duplicate is deleted.
cordn cannot go through UploadOrchestrator like the nostr surfaces: its
`imeta` tag carries the hash of the *plaintext* and a per-file key, which
the orchestrator neither produces nor surfaces. So the dialog's two
byte-level choices are applied in sendAttachment against the same
helpers the orchestrator uses — compressIfNeeded for the quality slider,
MetadataStripper for the strip switch — and the encryption and upload
stay where they were.
The sensitive-content switch is the one control with nowhere to go:
cordn tells its blob host a fixed set of constants on purpose, and its
`imeta` tag has no field for a warning. Rather than leave a switch that
does nothing, the dialog takes `showContentWarning`, defaulting true, in
the same shape as the `isNip17` gate already beside it.
CordnMediaService.upload gains a server parameter, defaulted to the
account's, so the dialog's spinner actually selects a host.
**ChatDivisor.** The day separator and the unread line were hand-rolled
Row + HorizontalDivider + Text at a different type scale from every
other chat's date divisor — the exact mismatch this branch set out to
remove, reintroduced. Both now call the shared one, which takes an
optional tint (Unspecified = today's behaviour) so the unread line can
carry the accent without a second component.
**VoiceMessagePreview.** Recording sent the moment you released the
button: no playback, no re-record, nothing to undo — hard to get right
first time and impossible to take back. The shared preview the post and
voice-reply screens use now sits above the field, and the text beside it
rides along as the note's caption.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012BfD4txdnsaPRXmNXbup9n