-
Notifications
You must be signed in to change notification settings - Fork 35
Polish profile hover cards #1346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c78e2c1
Polish profile hover avatars
klopez4212 01290d3
Add profile hover wave action
klopez4212 cbeeced
Render wave messages as attachments
klopez4212 1e9ed79
Animate wave affordances
klopez4212 18951b9
Show wave messages optimistically
klopez4212 47fa7ce
Soften wave attachment animation
klopez4212 cdcb3a3
Align wave huddle action accessory
klopez4212 30e8fd3
Slow wave hover animation
klopez4212 59f8b2d
Show wave huddle action by default
klopez4212 d1f6b36
Address profile hover review feedback
klopez4212 f69ecb7
Pass agent role into inbox profile hovers
klopez4212 d31f3c3
Pass bot hints through mention popovers
klopez4212 89052d4
Disable wave huddles while bot members resolve
klopez4212 81e110d
Pass bot hints from system message profiles
klopez4212 7f1a47d
Keep huddle actions pending for bot hints
klopez4212 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| import type { Channel } from "@/shared/api/types"; | ||
| import { normalizePubkey } from "@/shared/lib/pubkey"; | ||
|
|
||
| export function getDmHuddleMemberPubkeys( | ||
| channel: Channel | null, | ||
| agentPubkeys: ReadonlySet<string> | undefined, | ||
| currentPubkey: string | undefined, | ||
| ) { | ||
| if (channel?.channelType !== "dm" || !agentPubkeys) { | ||
| return []; | ||
| } | ||
|
|
||
| const normalizedCurrentPubkey = currentPubkey | ||
| ? normalizePubkey(currentPubkey) | ||
| : null; | ||
| const seen = new Set<string>(); | ||
|
|
||
| return channel.participantPubkeys.filter((pubkey) => { | ||
| const normalizedPubkey = normalizePubkey(pubkey); | ||
| if ( | ||
| normalizedCurrentPubkey && | ||
| normalizedPubkey === normalizedCurrentPubkey | ||
| ) { | ||
| return false; | ||
| } | ||
|
|
||
| if (!agentPubkeys.has(normalizedPubkey) || seen.has(normalizedPubkey)) { | ||
| return false; | ||
| } | ||
|
|
||
| seen.add(normalizedPubkey); | ||
| return true; | ||
| }); | ||
| } | ||
|
|
||
| export function hasOtherDmParticipant( | ||
| channel: Channel | null, | ||
| currentPubkey: string | undefined, | ||
| ) { | ||
| if (channel?.channelType !== "dm") { | ||
| return false; | ||
| } | ||
|
|
||
| const normalizedCurrentPubkey = currentPubkey | ||
| ? normalizePubkey(currentPubkey) | ||
| : null; | ||
|
|
||
| return channel.participantPubkeys.some((pubkey) => { | ||
| const normalizedPubkey = normalizePubkey(pubkey); | ||
| return ( | ||
| !normalizedCurrentPubkey || normalizedPubkey !== normalizedCurrentPubkey | ||
| ); | ||
| }); | ||
| } |
22 changes: 1 addition & 21 deletions
22
desktop/src/features/channels/ui/ChannelHeaderStatusBadge.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,38 +1,18 @@ | ||
| import type { EphemeralChannelDisplay } from "@/features/channels/lib/ephemeralChannel"; | ||
| import { EphemeralChannelBadge } from "@/features/channels/ui/EphemeralChannelBadge"; | ||
| import { PresenceBadge } from "@/features/presence/ui/PresenceBadge"; | ||
| import type { Channel, PresenceStatus } from "@/shared/api/types"; | ||
|
|
||
| type ChannelHeaderStatusBadgeProps = { | ||
| channelType?: Channel["channelType"]; | ||
| ephemeralDisplay: EphemeralChannelDisplay | null; | ||
| presenceStatus: PresenceStatus | null; | ||
| }; | ||
|
|
||
| export function ChannelHeaderStatusBadge({ | ||
| channelType, | ||
| ephemeralDisplay, | ||
| presenceStatus, | ||
| }: ChannelHeaderStatusBadgeProps) { | ||
| const ephemeralBadge = ephemeralDisplay ? ( | ||
| return ephemeralDisplay ? ( | ||
| <EphemeralChannelBadge | ||
| display={ephemeralDisplay} | ||
| testId="chat-ephemeral-badge" | ||
| variant="header" | ||
| /> | ||
| ) : null; | ||
|
|
||
| if (channelType === "dm" && presenceStatus) { | ||
| return ( | ||
| <> | ||
| <PresenceBadge | ||
| data-testid="chat-presence-badge" | ||
| status={presenceStatus} | ||
| /> | ||
| {ephemeralBadge} | ||
| </> | ||
| ); | ||
| } | ||
|
|
||
| return ephemeralBadge; | ||
| } |
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.