Commit Graph

12408 Commits

Author SHA1 Message Date
Claude 138ee12a6a fix(nests): align kind-4312 + kind-30312 wire format with nostrnests/EGG-07
After verifying the nostrnests reference (NestsUI-v2 @ main):
- ProfileCard.tsx writes kicks as ['action','kick'] tags with empty content
- useAdminCommands.ts reads action via tags.find(t => t==='action') and
  applies a 60-s relay since plus a processedRef Set to dedup re-deliveries
- p-tag role marker for moderators is 'admin', not 'moderator'

Amethyst was diverging on every one of those, which means our outbound
admin commands were invisible to nostrnests, theirs to us, and any
nostrnests admin (role='admin') failed our isModerator() / canSpeak()
gates entirely — kicks and force-mutes signed by them were silently
dropped.

Changes:

quartz/AdminCommandEvent.kt
  - Emit ['action', '<verb>'] tag with empty content
  - Reader prefers the tag, falls back to content for any in-flight
    Amethyst-built kick from before this commit
  - kick() and forceMute() share a common build() helper

quartz/ParticipantTag.kt
  - ROLE.MODERATOR.code = 'admin' (matches nostrnests + EGG-07)
  - Adds legacyCodes = ['moderator'] so older Amethyst-emitted
    kind-30312 events still parse as MODERATOR
  - effectiveRole() walks both code + legacyCodes

amethyst/AdminCommandsCollector
  - Filter carries since = now - 60 (EGG-07 #7)
  - Defensive per-event freshness re-check for cached events / clock skew
  - mutableSetOf<String>() processed-id dedup for the lifetime of the
    collector, mirroring useAdminCommands.ts's processedRef

EGG-07.md
  - Documents the Amethyst-only ['action','mute'] extension under a new
    'Implemented extensions' section. nostrnests doesn't emit or honour
    it today; cross-client force-mutes only work between Amethyst peers
  - 'warn' stays in the future-actions list — nostrnests has no plans
    for it either

Tests:
  - ParticipantTagTest: new asserts that 'admin' / 'Admin' / 'ADMIN'
    parse as ROLE.MODERATOR; pins the wire string to 'admin' and the
    legacy alias to 'moderator'
  - AdminCommandEventTest: kick/forceMute templates carry ['action', _]
    tag with empty content; legacy content-form still parses; tag wins
    over content when both are present
2026-04-28 12:59:48 +00:00
Claude d41a24f945 feat(nests): empty-stage hint, local hush, moderator/force-mute moderation
Three improvements stacked into one commit since they share files:

#3 Empty-stage hint: StageGrid no longer disappears when nobody is on
   stage. The "Stage" label stays and a quiet "Waiting for speakers…"
   line keeps the strip visible so the room doesn't look broken before
   the first speaker arrives.

#5 Local per-speaker hush: AudioPlayer gains a setVolume(Float)
   default-no-op method; AudioTrackPlayer composes mute and volume
   multiplicatively into AudioTrack.setVolume so a hushed stream stays
   silent regardless of mute state. NestViewModel exposes
   locallyHushed: ImmutableSet<String> in NestUiState plus
   setLocalHushed(pubkey, hushed) — applied at attach time so a
   re-subscribe of an already-hushed speaker stays silent. New "Hush
   this speaker" / "Restore this speaker" row in
   ParticipantHostActionsSheet, available to anyone (it affects only
   our own playback, nothing on the wire).

#4 Host moderation gaps: wires Promote-to-Moderator using the existing
   RoomParticipantActions.setRole(ROLE.MODERATOR) builder — UI gap
   only, no protocol change. Adds a new AdminCommandEvent.Action.MUTE
   variant + AdminCommandEvent.forceMute(room, target) builder; the
   sheet emits it on "Force-mute speaker" and the
   AdminCommandsCollector dispatches incoming MUTE actions to a new
   NestViewModel.onForceMuted() that routes through the existing
   setMicMuted(true) path. Honor-based, same trust model as KICK —
   relays don't enforce signer authority, the client checks the
   signer is host or moderator on the active kind-30312.
2026-04-28 12:41:23 +00:00
Claude bed1b328ce fix(nests): self-terminate the audio-level emitter when no one is talking
The previous emitter ran a permanent while(true){delay} loop on the
viewModelScope from connect-time onward. Cheap in production but
catastrophic for any test that calls runTest's advanceUntilIdle()
after vm.connect() — virtual time never reached idle, hanging
NestViewModelTest's existing connection-state cases for ~15 minutes
before the worker timeout killed them.

Now the emitter is started lazily by onAudioLevel() and exits the
loop the first tick after rawAudioLevels empties, so an idle room
schedules nothing. The next decoded frame restarts it. Idempotent,
so the launch path doesn't need to call it any more — removed the
boot from launchConnect().
2026-04-28 12:08:15 +00:00
Claude 04ee2c3106 feat(nests): pulse the speaker ring with live audio level
Adds an end-to-end audio-amplitude pipeline so on-stage speakers'
green ring throbs in time with their voice (closer to Spaces /
Clubhouse than the previous binary "is in speakingNow" indicator).

NestPlayer.play() now takes an onLevel callback and computes the
normalized peak of each decoded 16-bit PCM frame. NestViewModel
exposes audioLevels: StateFlow<Map<String, Float>>; raw 50 Hz
updates from the decode loop are coalesced into a 10 Hz publish
tick (LEVEL_TICK_MS) so the StateFlow doesn't spam recompositions
across a busy stage. The map is cleared on speaker close, on the
speaking-timeout sweep, and on teardown.

In MemberCell the speaking ring's width animates between
AVATAR_RING_WIDTH (3 dp) and MAX_RING_WIDTH (7 dp) via
animateDpAsState, smoothing the tick into a continuous halo.
Muted-publisher and idle states are unchanged.

Adds NestPlayerTest coverage for the new callback (level math +
empty-PCM short-circuit).
2026-04-28 12:03:13 +00:00
Claude 154b3393a5 feat(nests): role + activity badges, sort speakers / hands to top
- Cap mic, hand-raise, and role badges at 28.dp so they no longer
  dominate the new 100.dp avatars.
- Surface HOST and MODERATOR with a small badge anchored top-left
  (purple medal / sky shield), mirroring nostrnests at-a-glance.
- TalkBack: MicStateBadge announces "Speaking now" / "Microphone
  muted" / "Microphone open" instead of going silent.
- StageGrid floats currently-speaking members to the top so the
  listener doesn't scroll to find who they're hearing; AudienceGrid
  floats raised hands so moderators can approve the queue without
  hunting. Both use stable sorts and Modifier.animateItem() for a
  smooth shuffle.
2026-04-28 11:43:48 +00:00
Claude e027e2ebe8 feat(nests): tighten participant cell min so 4 avatars fit per row
Drops STAGE_CELL_MIN and AUDIENCE_CELL_MIN from 112.dp to 96.dp, which
lets a Pixel-class 411.dp phone fit 4 cells per row instead of 3 (and
unlocks 5/6 columns earlier on tablets). The 100.dp avatars overflow
~2.dp into the 6.dp horizontal arrangement on each side, so neighbors
still show a ~2.dp visible gap. Names ellipsize to the cell width as
before.
2026-04-28 03:13:12 +00:00
Claude 666a93f549 feat(nests): bigger avatars + clearer mute/speaking state in participant grid
100dp avatars across stage and audience tabs, names centered under each
cell, and the avatar border now distinguishes actively speaking (green)
from publishing-but-muted (red) at a glance — the existing mic-pill
keeps its semantics underneath.

UsernameDisplay gains an optional textAlign so the grid can opt in to
centered labels without disturbing other call sites.
2026-04-28 02:44:48 +00:00
Vitor Pamplona 2027f6ad37 Merge pull request #2619 from vitorpamplona/claude/fix-input-event-exception-1NKnN
Move NestActivity to activity subdirectory
2026-04-27 22:17:38 -04:00
Vitor Pamplona eab3a541c2 Softer position 2026-04-27 22:17:00 -04:00
Claude 379334156c fix: correct NestActivity package path in AndroidManifest
The activity class lives in `…nests.room.activity.NestActivity` but the
manifest entry was missing the `.activity` segment, so tapping a Nests
feed card crashed with ActivityNotFoundException.
2026-04-28 02:14:03 +00:00
Vitor Pamplona dbeec35257 Merge pull request #2618 from vitorpamplona/claude/fix-fab-positioning-Ec1pl
Fix FAB positioning when AppBottomBar hides on nested navigation
2026-04-27 22:12:42 -04:00
Claude addd1418f6 Reserve nav-bar inset when DisappearingScaffold's bar renders empty
AppBottomBar hides itself on canPop entries by emitting nothing into the
bar slot. DisappearingScaffold previously read the slot's measured
height as 0 and skipped applying navigationBarsPadding (its
`bottomBar == null` branch only fires when the lambda itself is null),
which let the FAB and feed content slide under the system navigation
bar. Fall back to the system-nav-bar inset when the slot measures zero
so the FAB lines up with the bar-visible position and content stays
clear of the gesture/3-button nav.

https://claude.ai/code/session_01QSk7CnjNtbcgS3XBD5WEZy
2026-04-28 02:08:20 +00:00
Vitor Pamplona 7d2741bd68 Merge branch 'main' of https://github.com/vitorpamplona/amethyst 2026-04-27 22:07:46 -04:00
Vitor Pamplona c59e60117d Merge pull request #2617 from vitorpamplona/claude/check-live-audio-status-ZEp60
Add presence-based liveness detection for meeting rooms
2026-04-27 22:06:50 -04:00
Claude f3471be70f Merge remote-tracking branch 'origin/main' into claude/check-live-audio-status-ZEp60
# Conflicts:
#	amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/NestsFeedLoaded.kt
2026-04-28 02:03:57 +00:00
Claude a6d7b4f4a3 refactor: reuse NestRoomFilterAssembler for thumb liveness probe
Drop the dedicated NestThumbStatusFilterAssembler and have the
thumb's liveness gate piggyback on NestRoomFilterAssembler, which
already subscribes to kinds=[1311, 10312, 7] + admin (4312) per
room a-tag. observeRoomLatestPresence is now a private composable
in NestsFeedLoaded.kt that opens NestRoomFilterAssemblerSubscription
and reads the latest cached MeetingRoomPresenceEvent createdAt off
the room's LiveActivitiesChannel.

Trade-off: the thumb pays for the room's full chat + reaction
history, not just presence. Bounded by LazyColumn — only currently-
composed thumbs hold subscriptions — and the cache it warms is
exactly what NestActivity needs when the user opens the room. If
wire load becomes a concern, swap to a limit:1 lite mode on the
existing assembler.

Net: -159 / +51 lines, one less filter assembler in the coordinator.
2026-04-28 02:00:48 +00:00
Claude 98dcaf4155 Apply FabBottomBarPadded to remaining FAB screens
Extends the canPop FAB-position fix to every screen that hosts a
floating action button: Pictures, Videos, Articles, Longs, Shorts,
Polls, Products, Communities, Nests, Badges, Discover, WebBookmarks,
Messages, Home, GeoHash, Hashtag, Relay, Community, OldBookmarks,
EmojiPack, ChessLobby, MarmotGroups, the bookmark management screens
and the migration FAB. Adds a small FabBottomBarPadded helper so call
sites that use named FAB composables stay tidy.

https://claude.ai/code/session_01QSk7CnjNtbcgS3XBD5WEZy
2026-04-28 01:58:45 +00:00
Claude b3da1e87b9 feat: gate nests thumb LiveFlag on kind-10312 presence freshness
The kind-30312 status tag goes stale silently when a host crashes
without publishing a CLOSED replacement, so checkStatus()'s 8-hour
fallback was the only liveness signal — abandoned rooms still
showed LiveFlag for up to 8h after the audio stopped.

Adds a per-thumb relay probe: kinds=[10312], #a=[roomATag], limit=1.
The relay returns the single most-recent presence event among all
speakers in the room, then keeps streaming so fresh heartbeats land
in real time. Speakers re-emit kind-10312 every ~60 s while
publishing, so a presence newer than 180 s means at least one
speaker is still in the room; older flips the badge to EndedFlag
even though the 30312 event still says OPEN.

UX: optimistic on first paint (LiveFlag while we have no presence
data), self-corrects within one round-trip once the relay replies.

Files:
- NestThumbStatusFilterAssembler.kt: per-room limit:1 REQ +
  observeNestRoomLatestPresence composable that scans the
  LiveActivitiesChannel's notes for max(createdAt) of cached
  presence events.
- RelaySubscriptionsCoordinator.kt: register nestThumbStatus.
- NestsFeedLoaded.kt: thread card.id into a private
  RenderLiveOrEndedFromPresence helper that gates the OPEN badge
  on freshness.
2026-04-28 01:53:37 +00:00
Vitor Pamplona b70a5ee31c Fixes weird transparency in the Chat Screen 2026-04-27 21:49:22 -04:00
Vitor Pamplona 833dcf1048 Fixes size of Send icons 2026-04-27 21:49:07 -04:00
Vitor Pamplona b0a2234ae1 Merge pull request #2615 from vitorpamplona/claude/refactor-room-package-YQ22H
refactor(nests): split nests/room flat package into named subpackages
2026-04-27 21:43:21 -04:00
Claude ea4da13110 Merge remote-tracking branch 'origin/main' into claude/refactor-room-package-YQ22H
# Conflicts:
#	amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/create/CreateNestViewModel.kt
2026-04-28 01:42:12 +00:00
Vitor Pamplona 15ae0b9032 Merge pull request #2616 from vitorpamplona/claude/nest-image-upload-We3jR
Add image upload functionality to CreateNestSheet
2026-04-27 21:41:17 -04:00
Claude 618ebabd30 Keep FAB position stable when AppBottomBar is hidden
AppBottomBar returns nothing on canPop entries (drawer pushes, in-app
navigations), so the floating action button drops by the bar's height
when navigating into a screen and rises again on a tab root. Reserve the
50dp gap at the FAB site via a fabBottomBarPadding(nav) modifier so the
button stays at a consistent vertical position regardless of the bar's
visibility on EmojiPacks, BookmarkGroups, and InterestSets.

https://claude.ai/code/session_01QSk7CnjNtbcgS3XBD5WEZy
2026-04-28 01:39:30 +00:00
Claude 731d01bf7e Merge remote-tracking branch 'origin/main' into claude/refactor-room-package-YQ22H 2026-04-28 01:37:25 +00:00
Claude d92db861a9 fix: use MeetingSpaceEvent.checkStatus() for nests feed thumb
NestsFeedLoaded.RenderLiveSpacesThumb gates LiveFlag/EndedFlag on
the kind-30312 status tag verbatim, so a host that crashed without
publishing a CLOSED replacement leaves the room flagged "live"
indefinitely. checkStatus() applies the same 8-hour age-out the
event's own helper uses, so abandoned OPEN rooms surface as
EndedFlag instead.

Also drop a stray println debug ("AABBCC …") in the same map block.
2026-04-28 01:36:58 +00:00
Claude cefda4b1f2 Allow uploading the Nest cover image from the gallery
Mirrors the Profile Edit banner upload: a SelectSingleFromGallery
leadingIcon on the Cover Image field picks media, strips metadata,
compresses, and uploads to the user's configured Blossom (or NIP-96)
server. The returned URL fills the field so the existing publish path
tags it on the kind-30312 MeetingSpaceEvent.
2026-04-28 01:36:29 +00:00
Claude c7fba2821a fix(nests): align relocated test packages with their subpackage paths
The previous refactor renamed EditNestViewModelTest and
RoomParticipantActionsTest into edit/ and participants/ subdirs but
the package declarations stayed at the old flat path, so the tests
no longer compiled against the relocated production code.
2026-04-28 01:30:49 +00:00
Claude a0fa2de87d refactor(nests): split nests/room flat package into named subpackages
The nests/room/ package had grown to 23+ files in one flat directory,
making it hard to find related composables and lifecycle helpers. Each
file is now grouped by responsibility:

  activity/     Android Activity entry + AccountViewModel bridge
  lobby/        Pre-join lobby card (NestJoinCard, JoinNestButton)
  lifecycle/    Side-effect composables wiring VM <-> system / cache
  screen/       Top-level layouts (FullScreen, PipScreen, ActionBar)
  stage/        Speaker / audience grids and overlays
  participants/ Per-participant host actions + role mutations
  reactions/    Reaction picker
  chat/         Chat panel and composer (also absorbs the old send/)
  edit/         Edit-room sheet + ViewModel
  theme/        Themed scope + URL font loader

Also drops the unused StagePeopleRow composable from NestCommon and
inlines its remaining one-liner connectingLabel helper into
NestActionBar (the only caller), removing NestCommon entirely.

External imports in 7 sibling files were updated to point at the new
subpackage paths.
2026-04-28 01:28:47 +00:00
Vitor Pamplona 68e405c684 Merge branch 'main' of https://github.com/vitorpamplona/amethyst 2026-04-27 21:06:24 -04:00
Vitor Pamplona 9fcf7bc1e5 Merge pull request #2614 from vitorpamplona/claude/fix-nest-activity-layout-zziPP
Refactor NestFullScreen layout: tabs, action bar, and stage grid
2026-04-27 21:04:35 -04:00
Claude 4f391ed74f Merge branch 'main' into claude/fix-nest-activity-layout-zziPP
Resolves NestFullScreen.kt by keeping the redesigned layout (header
strip, stage grid, tabs, sticky NestActionBar) while dropping the
NestThemedScope wrapper that main removed in ff00dcf3 ("screens get
too dark"). The RoomTheme import goes with it; the stale doc-comment
reference to NestThemedScope is updated accordingly.
2026-04-28 01:01:08 +00:00
Vitor Pamplona 6f38c5ec82 Merge pull request #2613 from vitorpamplona/l10n_crowdin_translations
New Crowdin Translations
2026-04-27 20:55:25 -04:00
Vitor Pamplona 637174ef12 Add relays to the broadcast for Nests 2026-04-27 20:54:58 -04:00
Vitor Pamplona 6c284a31bf Removes the rest of the theming 2026-04-27 20:50:13 -04:00
Crowdin Bot d7c6e9b169 New Crowdin translations by GitHub Action 2026-04-28 00:40:23 +00:00
Vitor Pamplona ff00dcf3c6 Removes the implementation of custom designs because our screens get too dark 2026-04-27 20:38:18 -04:00
Claude 9381a7731d feat(nests): redesign room layout with stage grid, tabs, sticky action bar
Replaces the single scrolling Column (title → speakers row → audience
row → host queue → connection chip → talk row → buttons → chat) with
a Scaffold-bounded layout that scales to large rooms:

  - Header strip with LIVE chip + listener count (uses the existing
    nest_listener_count plural for the first time) and a 1-line
    ellipsised summary. Topbar stays slim.
  - StageGrid: vertical adaptive LazyVerticalGrid capped at 220dp,
    so a 30-speaker room scrolls inside the strip without pushing
    the chat below the fold.
  - Tab bar (Chat / Audience · N / Hands · N) with badge counts.
    Hands tab is host-only and only shown while the queue is non-empty.
  - AudienceGrid: vertical adaptive LazyVerticalGrid that fills the
    selected tab — handles 1,000+ listeners without performance issues
    (the old single-row LazyHorizontalGrid only let you see ~5 at a time).
  - NestActionBar: sticky bottom bar consolidating the old ConnectionRow,
    TalkRow, and hand/react/leave row. Layout adapts to connection /
    broadcast / on-stage state; failure messages get a thin status
    strip above the bar instead of stealing button slots.
  - Hand-raise control hides when the user is on stage (the action it
    represents — "I want to speak" — no longer applies).

The PIP screen and chat panel internals are untouched.
2026-04-28 00:37:32 +00:00
Vitor Pamplona 9d0c224c9e New Private FLAG for Nests 2026-04-27 20:36:45 -04:00
Vitor Pamplona 89176048f1 Merge branch 'main' of https://github.com/vitorpamplona/amethyst 2026-04-27 20:36:26 -04:00
Vitor Pamplona 078c5f04a8 Solving the issue of a BackArrow on the Home Screen after a back press 2026-04-27 20:35:40 -04:00
Vitor Pamplona eb305a61f2 Merge pull request #2610 from vitorpamplona/l10n_crowdin_translations
New Crowdin Translations
2026-04-27 19:26:35 -04:00
Vitor Pamplona 96f976449e Merge pull request #2611 from vitorpamplona/claude/add-topbar-profile-screen-yw8IQ
Extract profile top bar into separate composable component
2026-04-27 19:26:25 -04:00
Vitor Pamplona a9f428526b Merge branch 'main' of https://github.com/vitorpamplona/amethyst 2026-04-27 19:25:21 -04:00
Vitor Pamplona a50a360964 Correctly downloads Nest events 2026-04-27 19:23:52 -04:00
Claude 152900688d Move profile back/more buttons into Scaffold topBar
The back button and the more-options menu used to float as
absolute-positioned overlays inside ProfileHeader. They are now
hosted in a transparent ShorterTopAppBar wired into the Scaffold's
topBar slot, so the banner can still render edge-to-edge as the
background by setting contentWindowInsets to zero and only applying
the bottom padding from Scaffold to the body.
2026-04-27 23:09:57 +00:00
Crowdin Bot afde1c8499 New Crowdin translations by GitHub Action 2026-04-27 22:58:19 +00:00
Vitor Pamplona b786b056bb Merge pull request #2609 from vitorpamplona/claude/add-chat-options-nest-PIyCp
Add full-featured composer to nest room chat
2026-04-27 18:56:50 -04:00
Claude 995f8384df feat(nests): wire nest chat composer to NestNewMessageViewModel
Completes the copy approach started in 57ebded6:

  - NestEditFieldRow.kt: copy of EditFieldRow, drops the BackHandler
    (the activity owns back; draft auto-save runs on every keystroke
    so there is nothing to flush) and points every callback at
    NestNewMessageViewModel.
  - NestFileUploadDialog.kt: copy of ChannelFileUploadDialog, header
    shows the room host's avatar + room name from the loaded
    MeetingSpaceEvent.
  - NestChatPanel.kt: replaces the slim inline composer with
    NestEditFieldRow + NestNewMessageViewModel. Chat message list is
    still rendered from NestViewModel.chat — the new VM is scoped to
    *editing and sending* messages only, per the brief.
  - NestNewMessageViewModel.sendPostSync: switched from
    signAndSendPrivately(template, emptySet()) to
    signAndComputeBroadcast(template) so messages actually reach the
    user's default relays (matches the original slim composer's
    behaviour).
2026-04-27 22:37:18 +00:00
Claude 57ebded68b wip(nests): start copying ChannelNewMessageViewModel into nest package
Pivot from sharing ChannelNewMessageViewModel (previous commit) to a
literal per-nest copy as requested.

State of this commit (incomplete — DO NOT MERGE):
  - EditFieldRow.kt: reverted to original (no interceptBackPress flag)
  - NestNewMessageViewModel.kt: new file, copy of ChannelNewMessageViewModel
    narrowed to MeetingSpaceEvent + LiveActivitiesChatMessageEvent only

Still TODO before this branch is usable:
  - Copy EditFieldRow into nests/room/send/NestEditFieldRow.kt
  - Copy ChannelFileUploadDialog into nests/room/send/NestFileUploadDialog.kt
  - Rewire NestChatPanel to use these copies (it currently still calls
    ChannelNewMessageViewModel + EditFieldRow from the previous commit's
    approach, which won't compile against the reverted EditFieldRow
    signature once NestChatPanel is also reverted)

User asked to stop mid-work — committing as WIP so the tree is clean.
2026-04-27 22:31:46 +00:00