-
Notifications
You must be signed in to change notification settings - Fork 25
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
native: integrate new contacts into UI #4127
base: develop
Are you sure you want to change the base?
Conversation
…te contact metadata
…eader button for getting to contacts page
41b2250
to
e93d884
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm! Pretty much exclusively nits.
@@ -23,5 +23,5 @@ export function formatUserId( | |||
} | |||
|
|||
export function getDisplayName(contact: db.Contact) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can contact be empty? Either the param should be optional/nullable, or we shouldn't need this check here.
@@ -186,6 +206,37 @@ export const activityEvents = sqliteTable( | |||
} | |||
); | |||
|
|||
export const activityEventContactGroups = sqliteTable( | |||
'activyt_event_contact_group_pins', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
|
||
peerNickname: text('peerNickname'), | ||
customNickname: text('customNickname'), | ||
nickname: text('nickname').generatedAlwaysAs( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oooo interesting
@@ -72,53 +161,192 @@ export const removePinnedGroup = async (groupId: string) => { | |||
}); | |||
}; | |||
|
|||
export const setPinnedGroups = async (groupIds: string[]) => { | |||
console.log(`api set pinned`, groupIds); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stray logs in this function
return Object.entries(contacts).flatMap(([ship, contact]) => | ||
contact === null ? [] : [toClientContact(ship, contact)] | ||
); | ||
export const v0PeersToClientProfiles = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A comment about what a v0Peer is would be nice
@@ -19,11 +19,20 @@ function SummaryMessageRaw({ | |||
const plural = summary.all.length > 1; | |||
const authors = useActivitySummaryAuthors(summary); | |||
|
|||
console.log(`summary message debug`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stray log
const [pinnedGroups, setPinnedGroups] = useState<db.Group[]>( | ||
(userContact?.pinnedGroups | ||
?.map((pin) => pin.group) | ||
.filter(Boolean) as db.Group[]) ?? [] | ||
); | ||
|
||
const currentNickname = useMemo(() => { | ||
return props.userId === currentUserId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lotsa reps of props.userId === currentUserId
, would be nice to just have an isCurrentUser local var
imageUrl={overrideUrl ?? contact?.avatarImage ?? undefined} | ||
imageUrl={ | ||
overrideUrl ?? | ||
contact?.customAvatarImage ?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't the calculated column for contact.avatarImage
already handle coalescing these values?
} | ||
|
||
return ( | ||
<View paddingLeft="$xl" paddingVertical="$xl"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use SectionListHeader
, ensure contentContainerStyle
matches ChatList
@@ -2705,6 +2707,67 @@ export const updateContact = createWriteQuery( | |||
['contacts'] | |||
); | |||
|
|||
export const upsertContact = createWriteQuery( | |||
'upsertContact', | |||
async (contact: Contact, ctx: QueryCtx) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the insert/onConflict pattern we're using most other places not work here?
Adds support for using the new contacts agent including:
You'll need to have contact activity enabled
%landscape
and%groups
to work with it (should now be on wannec)I still want to execute a rename on contacts table as discussed, but I don't think it needs to block.
Fixes TLON-3136
Fixes TLON-3192
Fixes TLON-2743
Fixes TLON-3218