Commit Graph

644 Commits

Author SHA1 Message Date
Claude
62d6c70c3d Add message interactions to ChatView
Implement reply, like, and repost buttons for chat messages:

Features:
- Action buttons appear on hover for each message bubble
- Reply button - opens thread view or reply composer
- Like button - sends reaction (+) with filled state tracking
- Repost button - opens repost decision sheet

The buttons integrate with the existing NoteAction system:
- Uses existing app_images for icons
- Integrates with reaction tracking via reaction_sent_id
- Properly routes to reply, react, and repost handlers
- Follows Slack-like UX pattern with hover-based interactions

This completes the chat message interaction layer, making
messages fully interactive while maintaining a clean interface.
2025-11-13 05:35:19 +00:00
Claude
5c4ecb5a4a Add Cmd+K quick channel switcher
Implement a Slack-style quick switcher for navigating between channels:

Features:
- Press Cmd+K (or Ctrl+K) to open the channel switcher modal
- Search/filter channels by name
- Navigate with arrow keys (↑/↓)
- Select with Enter or click
- Shows unread count badges
- Highlights currently selected channel
- Dark overlay background for focus
- Keyboard shortcuts shown at bottom

The switcher provides fast keyboard-driven navigation between channels,
matching the Slack UX pattern that users expect.
2025-11-12 19:30:48 +00:00
Claude
d70f3d2801 Add keyboard shortcuts for channel management
Implement basic keyboard shortcuts:
- Escape: Close the channel creation dialog
- Cmd+N / Ctrl+N: Open the channel creation dialog

These shortcuts provide quick access to channel management without
requiring mouse interaction, improving the Slack-like UX.
2025-11-12 19:08:39 +00:00
Claude
829cca9864 Add channel creation dialog
Implement a channel creation dialog that allows users to:
- Enter a channel name
- Specify comma-separated hashtags to track
- Create and subscribe to new channels

When a channel is created:
1. It's added to the active channels list
2. Saved to disk for persistence
3. Automatically subscribed to start fetching messages

The dialog uses egui::Window for a modal-like experience and
includes validation to ensure both name and hashtags are provided.
2025-11-12 19:07:16 +00:00
Claude
352293b64b Fix StripBuilder cell count for channel selection
When a channel is selected, adjust the StripBuilder to expect only 1
content cell (for ChatView) instead of num_cols cells. This prevents
layout issues when switching between channel chat view and normal
column view.
2025-11-12 19:01:58 +00:00
Claude
a1983917f4 Wire ChatView to display selected channel's timeline
When a channel is selected in the sidebar, the main content area now
displays ChatView with Slack-like message bubbles instead of the
traditional column timeline view. When no channel is selected, the
app falls back to the normal column view.

This completes the core integration of the Slack-like chat interface.
2025-11-12 18:58:46 +00:00
Claude
d2dbe3d0f2 Complete Phase 1 & 2: Full Slack-like interface integration
This commit integrates all components to create a functional Slack-like interface:

**Phase 1: API Fixes**
- Fixed ChatView compilation errors (APIs match current codebase)
- Proper BodyResponse, ProfilePic, and timeline access patterns

**Phase 2: Integration**
-  ChannelSidebar integrated into main layout (240px sidebar)
-  Channel subscription logic implemented and working
-  RelayConfig applied to RelayPool on startup
-  Save triggers for channel modifications
- Layout: [ChannelSidebar | DesktopSidePanel | Columns]

**Key Features Now Working:**
1. Channel sidebar displays and is clickable
2. Channels subscribe to hashtag filters on app start
3. Relay configuration properly applied
4. Channel selection persists to disk
5. ChatView component compiles (ready for Phase 3 wiring)

**Changes:**
- app.rs: Added ChannelSidebar rendering, action handling, relay application
- channels.rs: Added `subscribed` field, proper subscribe_all() logic
- chat_view.rs: Fixed all API mismatches (compiles cleanly)

**Next Steps (Phase 3):**
- Wire ChatView to display selected channel's timeline
- Add channel creation/edit dialog
- Build thread side panel for Slack-style threading

All code compiles successfully with zero errors!
2025-11-12 16:14:46 +00:00
Claude
da38e13d8e WIP: Add ChatView component with Slack-like message bubbles
- Create ChatView component for chat-style message display
- Implement message grouping (same author + 5min window)
- Add message bubbles with rounded corners
- Include avatar, author name, and timestamp
- Support click-to-thread functionality
- Relative timestamp formatting (5m ago, 2h ago, etc.)

Note: Needs API fixes to compile - several API mismatches with current
nostrdb/notedeck APIs that need adjustment.
2025-11-12 15:46:48 +00:00
Claude
6a265be4a5 Add Channel Sidebar UI component
- Create ChannelSidebar component with channel list display
- Implement channel selection with visual highlighting
- Add unread badge support for channels
- Include "Add Channel" button at bottom
- Support both light and dark modes
- Use # icon prefix for channels (Slack-like style)
2025-11-12 15:33:38 +00:00
Claude
e4fcf15fcb Add Channel and RelayConfig data structures for Slack-like interface
This commit lays the foundation for the Slack-like interface redesign:

- Add Channel data structure: represents a channel that filters notes by hashtags
- Add ChannelList: manages multiple channels per user
- Add ChannelsCache: maps users to their channel lists (stored per-account)
- Add RelayConfig: global relay configuration (not tied to user profiles)
- Add persistence: save/load channels and relay config to disk
- Update Damus app state to include channels_cache and relay_config

Next steps:
- Create sidebar UI with channel list
- Build main chat view with message bubbles
- Add thread side panel
- Update main layout to use new components
2025-11-12 15:31:20 +00:00
Claude
a02e98a64b Remove migration logic for corrupted relay URLs
Since users can delete the corrupted decks_cache.json file, the
migration logic is no longer necessary. The URL encoding/decoding
ensures all new cache files will be saved correctly going forward.
2025-11-12 15:02:16 +00:00
Claude
9e2331fa3d Add migration logic to fix corrupted relay URLs from old format
When decks_cache.json was saved with the old format, relay URLs like
"wss://wot.nostr.net" were split by the ":" delimiter into separate
tokens: ["wss", "//wot.nostr.net"]. This commit adds migration logic
to detect and reconstruct these corrupted URLs during parsing.

Detection heuristic:
- If the relay_url token is just "wss" or "ws" (without "://")
- AND the next token (hashtags_str) starts with "//"
- Then reconstruct the full URL as "wss://..." or "ws://..."
- And pull the next token as the actual hashtags

This allows existing users with corrupted decks_cache.json files to
automatically have their relay URLs fixed on next app restart, without
needing to manually delete the cache file.
2025-11-12 14:50:55 +00:00
Claude
e2129344bc Fix relay URL parsing by URL-encoding relay URLs
The relay URL "wss://wot.nostr.net" was being incorrectly parsed as
Relay("wss", Some(["//wot.nostr.net"])) when the app restarted and
loaded from the decks cache.

Root cause:
The TokenWriter uses ":" as the default delimiter. When relay URLs
containing ":" (like "wss://wot.nostr.net") were serialized, the
colons were not escaped, causing the URL to be split into multiple
tokens during parsing:
- Token 1: "relay" (type)
- Token 2: "wss" (mistakenly read as relay_url)
- Token 3: "//wot.nostr.net" (mistakenly read as hashtags)

Solution:
- URL-encode relay URLs when serializing (using urlencoding crate)
- URL-decode relay URLs when parsing
- Added backward compatibility: if decoding fails (old format),
  fall back to using the token as-is

This ensures relay URLs with colons are correctly preserved across
app restarts.
2025-11-12 14:43:37 +00:00
Claude
46dd99be03 Fix unknown EOSE subscription ID warnings
This fix addresses the "got unknown eose subid" warnings that were appearing
in the logs when EOSE (End Of Stored Events) messages arrived from relays.

The issue was that when `TimelineSub::try_add_remote()` and
`TimelineSub::try_add_remote_with_relay()` created new subscription IDs,
they were not being tracked in the `Subscriptions.subs` HashMap. When EOSE
messages arrived for these subscription IDs, the `handle_eose()` function
couldn't find them in the HashMap, causing the "unknown eose subid" warnings.

Changes:
- Modified `try_add_remote()` and `try_add_remote_with_relay()` to accept
  `&mut Subscriptions` and `&TimelineKind` parameters
- Added subscription tracking by inserting subscription IDs with
  `SubKind::Timeline(timeline_kind)` into the Subscriptions HashMap
- Updated all call sites throughout the codebase to pass the required
  parameters, including:
  - TimelineCache::open()
  - DecksCache::add_deck_default()
  - DecksCache::new_with_demo_config()
  - is_timeline_ready()
  - execute_note_action()
  - execute_and_process_note_action()
  - add_demo_columns()
  - demo_decks()

This ensures all subscription IDs are properly tracked, eliminating the
unknown EOSE warnings and allowing proper handling of EOSE messages.
2025-11-12 14:27:13 +00:00
Claude
79a633d684 Add relay-specific column with hashtag filtering
This commit adds the ability to create columns that display content from
a specific relay, with optional hashtag filtering.

Features:
- New TimelineKind::Relay variant storing relay URL and optional hashtags
- Relay-specific subscription support in RelayPool (subscribe_to method)
- UI for configuring relay URL and hashtag filters
- Filter generation for relay-specific queries
- Column header with relay icon
- Serialization/deserialization support for deck persistence

Implementation details:
- Extended RelayPool with subscribe_to() for relay-specific subscriptions
- Added TimelineSub::try_add_remote_with_relay() to handle targeted subscriptions
- Timeline cache automatically routes relay columns to specific relays
- UI validates relay URLs before creating columns
- Hashtag filtering is optional and space-separated

Usage:
Users can now add a "Relay" column from the column picker, enter a relay
URL (e.g., wss://relay.example.com), and optionally filter by hashtags.
2025-11-12 13:11:36 +00:00
William Casarin
155278dd3f Merge perf updates and fixes from kerenl
from remote-tracking branches:
  * kernel/fix-soft-keyboard
  * kernel/composite-profiles-perf
  * kernel/fix-nav-flicker

kernelkind (8):
      Revert "fix: nav drawer shadow extends all the way vertically"
      chore(profiling): markup composite render path
      chore(tracy): repaint every frame
      feat(composite-cluster): do culling for pfps
      feat(mime-cache): upgrade UrlMimes
      feat(reactions): use ProfileKey when possible for performance
      fix(nav-drawer): shadow extends all the way vertically
      fix(thread): remove flicker on opening thread
2025-10-27 10:27:07 -07:00
William Casarin
25b19f7636 refactor: rename process to process_selection
grepping these are a pain

Signed-off-by: William Casarin <jb55@jb55.com>
2025-10-27 10:25:01 -07:00
kernelkind
1244be4481 feat(composite-cluster): do culling for pfps
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-24 13:12:18 -04:00
kernelkind
fdde0244e2 feat(reactions): use ProfileKey when possible for performance
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-24 13:00:39 -04:00
kernelkind
892d77d4e3 chore(profiling): markup composite render path
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-24 11:42:03 -04:00
William Casarin
8bfe8916ea Merge send reactions by kernel #1170 2025-10-20 11:22:54 -07:00
William Casarin
2929bfaf0c Merge seen note perf improvements by kernel #1174
kernelkind (2):
      fix(notif-indicator): more performant impl
      refactor(NoteFreshness): remove now unnecessary `NoteFreshness`
2025-10-20 11:21:53 -07:00
kernelkind
fc248ac389 refactor(NoteFreshness): remove now unnecessary NoteFreshness
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-19 19:51:03 -04:00
kernelkind
0344ea866f fix(notif-indicator): more performant impl
the previous unseen notification indicator only ran once a few
seconds, but when it did it often took > 5ms because of ndb::query,
which is unacceptable.

This commit removes the ndb::query entirely and relies on the
ndb::poll_for_notes which is already being used every time there is
a new event from a relay

Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-19 19:50:53 -04:00
kernelkind
3f5264b4ab feat(action): add NoteAction::React
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-17 15:35:35 -04:00
kernelkind
c66c5725ce feat(event): add send_reaction_event
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-17 15:35:29 -04:00
kernelkind
d3326d2e33 refactor(assets): rename like icon -> filled version
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-17 15:35:15 -04:00
kernelkind
ba83976166 refactor: rename assets
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-17 01:04:48 -04:00
kernelkind
9b1f7680aa refactor: move galley_centered_pos to notedeck_ui
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-17 01:04:45 -04:00
William Casarin
34c5153618 Merge quote reposts, share links by kernel
kernelkind (17):
      add `ProfileContext`
      add `RenderNavAction::RepostAction` & render `RepostDecisionView`
      add `after_action` to `SingletonRouter`
      add repost fns
      feat: copy damus.io link to clipboard
      fix: custom zap wrapping
      fix: profile wrapping
      process popup after action
      refactor: move profile.rs -> url.rs to new module
      refactor: move shared context stuff up in scope
      refactor: rename `NoteAction::Quote` -> `Repost`
      render profile context button
      route: add CloseSheetThenRoute `RouterAction`
      route: add `RepostDecision`
      split popup correctly for repost & update egui-nav
      ui: add `ProfileContextWidget`
      ui: add `RepostDecisionView`
2025-10-06 08:56:02 -07:00
kernelkind
f54d3b1596 feat: copy damus.io link to clipboard
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-06 11:52:11 -04:00
kernelkind
14b35c45c2 render profile context button
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-05 15:37:14 -04:00
kernelkind
2cf6679418 fix: custom zap wrapping
text was flowing off screen for this npub:
npub1uqxkqdq3xngndgwlck03hje0u25uu7ql9nakh63yjk2m63thczkszeffca

Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-05 13:28:20 -04:00
kernelkind
bd6b819118 fix: profile wrapping
zap url for this npub was long, causing it to flow off screen &
causing the content below it to flow off screen as well
npub1pm5z0gmw3wcvl3yreuv8y7q3stz2zmzc4jar4ckhk927qdcwjwuq3txe07

Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-05 13:16:26 -04:00
kernelkind
dc23f8fe1e split popup correctly for repost & update egui-nav
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-04 18:09:27 -04:00
kernelkind
6e50e7ee5b process popup after action
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-04 18:09:24 -04:00
kernelkind
181e508f70 add RenderNavAction::RepostAction & render RepostDecisionView
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-04 18:09:21 -04:00
kernelkind
4bb60c6240 refactor: rename NoteAction::Quote -> Repost
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-04 18:09:18 -04:00
kernelkind
36845c6305 route: add RepostDecision
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-04 18:09:15 -04:00
kernelkind
3b735d0ef9 ui: add RepostDecisionView
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-04 18:09:12 -04:00
kernelkind
f2857a9d58 add repost fns
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-04 17:44:51 -04:00
kernelkind
872bd35142 route: add CloseSheetThenRoute RouterAction
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-04 17:44:48 -04:00
kernelkind
3c5bab24ba add after_action to SingletonRouter
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-04 17:44:38 -04:00
William Casarin
e20861f8d6 Merges notification filters, perf & crash fixes by kernel
kernelkind (6):
      feat: "All" & "Mentions" notifications tabs like Damus iOS
      fix: WalletView don't request keyboard focus if narrow
      fix: crash on startup
      add `load_texture_checked`
      use `load_texture_checked` over `load_texture`
      add clippy rule to disallow the usage of `load_texture`
2025-10-03 13:32:24 -07:00
kernelkind
55b59c982a fix: WalletView don't request keyboard focus if narrow
on android it kept popping up the keyboard even when i close it

Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-02 16:38:30 -04:00
kernelkind
af53dd4852 perf: improve filter generation performance
for some reason the filter here was taking ~6ms to create...

Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-02 16:19:39 -04:00
kernelkind
810b4c1990 profiling: add more profile markup
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-02 16:19:04 -04:00
kernelkind
62ffe9b219 feat: "All" & "Mentions" notifications tabs like Damus iOS
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-02 16:13:46 -04:00
William Casarin
3a8d06cb82 Merge tracy profiling by kernel
kernelkind (1):
      add tracy support
2025-10-02 12:33:36 -07:00
kernelkind
3540290f0a make update return AppResponse instead of Option<AppAction>
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-01 21:47:31 -04:00