From 5db4c1307bf40d0ef98fe4414f3336eccc4303b4 Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Fri, 12 Feb 2021 14:30:24 -0500 Subject: [PATCH 1/8] invites: redirect multiple member DMs to messages --- pkg/interface/src/views/components/Invite/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/interface/src/views/components/Invite/index.tsx b/pkg/interface/src/views/components/Invite/index.tsx index fc6e9b192..c39c1d5e8 100644 --- a/pkg/interface/src/views/components/Invite/index.tsx +++ b/pkg/interface/src/views/components/Invite/index.tsx @@ -61,7 +61,7 @@ export function InviteItem(props: InviteItemProps) { if (props.groups?.[resource]?.hidden) { const { metadata } = associations.graph[resource]; - if (name.startsWith("dm--")) { + if (metadata?.module === 'chat') { history.push(`/~landscape/messages/resource/${metadata.module}${resource}`); } else { history.push(`/~landscape/home/resource/${metadata.module}${resource}`); @@ -126,7 +126,7 @@ export function InviteItem(props: InviteItemProps) { You are joining a DM with - {cite("~hastuc-dibtux")} + {cite(`~${invite!.ship}`)} From 6c2d93591373c0afa52bb85cdbd84b9c1ddd8e5b Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Fri, 12 Feb 2021 14:39:23 -0500 Subject: [PATCH 2/8] NewChannel: redirect DM creation from DM routes We were redirecting based on our parent path, so if we were in a DM while making a DM, we used that DM as our parent path. Fixes urbit/landscape#421 --- pkg/interface/src/views/landscape/components/NewChannel.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/interface/src/views/landscape/components/NewChannel.tsx b/pkg/interface/src/views/landscape/components/NewChannel.tsx index deff84835..91d375042 100644 --- a/pkg/interface/src/views/landscape/components/NewChannel.tsx +++ b/pkg/interface/src/views/landscape/components/NewChannel.tsx @@ -100,7 +100,7 @@ export function NewChannel(props: NewChannelProps & RouteComponentProps) { await waiter(p => Boolean(p?.groups?.[`/ship/~${window.ship}/${resId}`])); } actions.setStatus({ success: null }); - const resourceUrl = parentPath(location.pathname); + const resourceUrl = (location.pathname.includes("/messages")) ? "/~landscape/messages" : parentPath(location.pathname); history.push( `${resourceUrl}/resource/${moduleType}/ship/~${window.ship}/${resId}` ); From 5b62417e49951b94e947067600ad704b932fc422 Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Fri, 12 Feb 2021 16:24:46 -0500 Subject: [PATCH 3/8] groups: pass new contacts obj, fix pending Also uncovers why pending array wasn't matching. Fixes urbit/landscape#422 Fixes urbit/landscape#312 --- .../views/landscape/components/GroupsPane.tsx | 4 +++- .../views/landscape/components/Participants.tsx | 16 +++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/pkg/interface/src/views/landscape/components/GroupsPane.tsx b/pkg/interface/src/views/landscape/components/GroupsPane.tsx index 7cddafc5c..6520fb4ac 100644 --- a/pkg/interface/src/views/landscape/components/GroupsPane.tsx +++ b/pkg/interface/src/views/landscape/components/GroupsPane.tsx @@ -40,7 +40,9 @@ export function GroupsPane(props: GroupsPaneProps) { const relativePath = (path: string) => baseUrl + path; const groupPath = getGroupFromWorkspace(workspace); - const groupContacts = (groupPath && contacts[groupPath]) || undefined; + const groupContacts = Object.assign({}, ...Array.from(groups?.[groupPath]?.members ?? []).filter(e => contacts[`~${e}`]).map(e => { + return {[e]: contacts[`~${e}`]}; + })) || {}; const rootIdentity = contacts?.["/~/default"]?.[window.ship]; const groupAssociation = (groupPath && associations.groups[groupPath]) || undefined; diff --git a/pkg/interface/src/views/landscape/components/Participants.tsx b/pkg/interface/src/views/landscape/components/Participants.tsx index dabea1845..6ae9275fb 100644 --- a/pkg/interface/src/views/landscape/components/Participants.tsx +++ b/pkg/interface/src/views/landscape/components/Participants.tsx @@ -33,10 +33,12 @@ import { StatelessAsyncAction } from '~/views/components/StatelessAsyncAction'; import styled from 'styled-components'; import useLocalState from '~/logic/state/local'; -const TruncText = styled(Box)` +const TruncText = styled(Text)` white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + display: inline-block; + min-width: 0; `; type Participant = Contact & { patp: string; pending: boolean }; @@ -57,8 +59,10 @@ function getParticipants(cs: Contacts, group: Group) { patp, pending: false })); - const members: Participant[] = _.map(Array.from(group.members), m => - emptyContact(m, false) + const members: Participant[] = _.map( + Array.from(group.members) + .filter(e => group?.policy?.invite?.pending ? !group.policy.invite.pending.has(e) : true), m => + emptyContact(m, false) ); const allMembers = _.unionBy(contacts, members, 'patp'); const pending: Participant[] = @@ -305,11 +309,13 @@ function Participant(props: { return ( <> {avatar} - + {hasNickname && ( - + + {contact.nickname} + )} {cite(contact.patp)} From ec702d43a0b113f62bd1e1762f914874d17b4e71 Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Fri, 12 Feb 2021 16:28:25 -0500 Subject: [PATCH 4/8] profile: force status to flush right on view --- pkg/interface/src/views/apps/profile/components/Profile.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/interface/src/views/apps/profile/components/Profile.tsx b/pkg/interface/src/views/apps/profile/components/Profile.tsx index 77b3bc0d1..a3fb4a954 100644 --- a/pkg/interface/src/views/apps/profile/components/Profile.tsx +++ b/pkg/interface/src/views/apps/profile/components/Profile.tsx @@ -65,8 +65,9 @@ export function Profile(props: any) { maxWidth="600px" width="100%"> + {ship === `~${window.ship}` ? ( - + <> - + ) : null} + {contact?.status ?? ""} From 8f0b8b21015a36c3892e5d665f64166f58124f6b Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Fri, 12 Feb 2021 16:42:34 -0500 Subject: [PATCH 5/8] profile: linkify statuses Also fixes an unfiled bug where disableRemoteContent was ignored Fixes urbit/landscape#418 --- .../src/views/apps/profile/components/Profile.tsx | 5 +++-- pkg/interface/src/views/components/ProfileOverlay.tsx | 10 +++++++--- pkg/interface/src/views/components/RichText.js | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/pkg/interface/src/views/apps/profile/components/Profile.tsx b/pkg/interface/src/views/apps/profile/components/Profile.tsx index a3fb4a954..bb1ab1f80 100644 --- a/pkg/interface/src/views/apps/profile/components/Profile.tsx +++ b/pkg/interface/src/views/apps/profile/components/Profile.tsx @@ -14,6 +14,7 @@ import { Button, Text } from "@tlon/indigo-react"; +import RichText from '~/views/components/RichText' import useLocalState from "~/logic/state/local"; import { useHistory } from "react-router-dom"; import {useTutorialModal} from "~/views/components/useTutorialModal"; @@ -84,9 +85,9 @@ export function Profile(props: any) { ) : null} - {contact?.status ?? ""} + overflow="hidden" display="inline-block" verticalAlign="middle">{contact?.status ?? ""} {cover} diff --git a/pkg/interface/src/views/components/ProfileOverlay.tsx b/pkg/interface/src/views/components/ProfileOverlay.tsx index 367d81186..a77f3737d 100644 --- a/pkg/interface/src/views/components/ProfileOverlay.tsx +++ b/pkg/interface/src/views/components/ProfileOverlay.tsx @@ -14,6 +14,7 @@ import { ColProps, Icon } from '@tlon/indigo-react'; +import RichText from './RichText'; import { withLocalState } from '~/logic/state/local'; import { ProfileStatus } from './ProfileStatus'; @@ -132,7 +133,7 @@ class ProfileOverlay extends PureComponent { onClick={() => history.push(`/~profile/~${ship}`)}> {img} - + { contact={contact} /> ) : ( - + {contact?.status ? contact.status : ''} - + ) } diff --git a/pkg/interface/src/views/components/RichText.js b/pkg/interface/src/views/components/RichText.js index 4b40655f3..1ca377ece 100644 --- a/pkg/interface/src/views/components/RichText.js +++ b/pkg/interface/src/views/components/RichText.js @@ -33,10 +33,10 @@ const RichText = React.memo(({ disableRemoteContent, ...props }) => ( videoShown: false, oembedShown: false } : null; - if (hasProvider(linkProps.href)) { + if (!disableRemoteContent && hasProvider(linkProps.href)) { return ; } - + return {linkProps.children}; }, linkReference: (linkProps) => { From 57f8963b368bfc776b5e9c6e03e8e3557ddb7c42 Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Fri, 12 Feb 2021 17:08:43 -0500 Subject: [PATCH 6/8] meta: revert ba839646c8221dcccac5f1b72c1783575cd769a0 --- pkg/interface/src/views/apps/chat/css/custom.css | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/pkg/interface/src/views/apps/chat/css/custom.css b/pkg/interface/src/views/apps/chat/css/custom.css index 85cb51c97..702106082 100644 --- a/pkg/interface/src/views/apps/chat/css/custom.css +++ b/pkg/interface/src/views/apps/chat/css/custom.css @@ -95,16 +95,8 @@ h2 { font-family: "Inter", sans-serif; } -.embed-container { - width: 100%; - height: 14rem; -} - .embed-container iframe { - max-width: 24rem; - width: 100%; - height: 100%; - max-height: 26rem; + max-width: 100%; } .mh-16 { From 5b636b7bef3ffb9098f2f4c7644f080f6f08c02f Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Fri, 12 Feb 2021 17:15:11 -0500 Subject: [PATCH 7/8] profile: pad foreign statuses Fixes urbit/landscape#413 --- pkg/interface/src/views/apps/profile/components/Profile.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/interface/src/views/apps/profile/components/Profile.tsx b/pkg/interface/src/views/apps/profile/components/Profile.tsx index bb1ab1f80..0072b591b 100644 --- a/pkg/interface/src/views/apps/profile/components/Profile.tsx +++ b/pkg/interface/src/views/apps/profile/components/Profile.tsx @@ -85,7 +85,7 @@ export function Profile(props: any) { ) : null} - {contact?.status ?? ""} From 115dacfeece12522a38505a5d51068063ca3e66e Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Fri, 12 Feb 2021 17:26:08 -0500 Subject: [PATCH 8/8] statusbar: fix flexing on dev stream mobile --- pkg/interface/src/views/components/StatusBar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/interface/src/views/components/StatusBar.js b/pkg/interface/src/views/components/StatusBar.js index b674354a8..16a2e2666 100644 --- a/pkg/interface/src/views/components/StatusBar.js +++ b/pkg/interface/src/views/components/StatusBar.js @@ -107,7 +107,7 @@ const StatusBar = (props) => { width="auto" alignY="top" alignX="right" - flexShrink={0} + flexShrink={'0'} options={