mirror of
https://github.com/urbit/shrub.git
synced 2024-12-25 04:52:06 +03:00
Merge branch 'release/next-userspace' into lf/hark-caching
This commit is contained in:
commit
65e4a06a64
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:eb4508c64074807d1b9d4d5f37c0a20e5e8dd26b8b3029da77650ff1ebfb257a
|
||||
size 6272789
|
||||
oid sha256:0e36dad1e42bee8e2ad2d4ee338a553bc66f7605d301f93c3ced0ec1b2958571
|
||||
size 6300470
|
||||
|
@ -5,7 +5,7 @@
|
||||
/- glob
|
||||
/+ default-agent, verb, dbug
|
||||
|%
|
||||
++ hash 0v3.h5gg6.t76qc.9on82.im1ti.i4vuu
|
||||
++ hash 0vvse4p.hsbcu.1hjo3.dhct1.t7jqn
|
||||
+$ state-0 [%0 hash=@uv glob=(unit (each glob:glob tid=@ta))]
|
||||
+$ all-states
|
||||
$% state-0
|
||||
|
@ -658,7 +658,7 @@
|
||||
:+ %add-nodes
|
||||
[ship term]
|
||||
%- ~(gas by *(map index:store node:store))
|
||||
%+ turn (tap:orm `graph:store`(subset:orm p.children.u.node start end))
|
||||
%+ turn (tap:orm `graph:store`(subset:orm p.children.u.node end start))
|
||||
|= [=atom =node:store]
|
||||
^- [index:store node:store]
|
||||
[(snoc index atom) node]
|
||||
@ -671,7 +671,8 @@
|
||||
=/ end=(unit time) (slaw %da i.t.t.t.t.t.path)
|
||||
=/ update-log=(unit update-log:store) (~(get by update-logs) [ship term])
|
||||
?~ update-log [~ ~]
|
||||
``noun+!>((subset:orm-log u.update-log start end))
|
||||
:: orm-log is ordered backwards, so swap start and end
|
||||
``noun+!>((subset:orm-log u.update-log end start))
|
||||
::
|
||||
[%x %update-log @ @ ~]
|
||||
=/ =ship (slav %p i.t.t.path)
|
||||
|
@ -24,6 +24,6 @@
|
||||
<div id="portal-root"></div>
|
||||
<script src="/~landscape/js/channel.js"></script>
|
||||
<script src="/~landscape/js/session.js"></script>
|
||||
<script src="/~landscape/js/bundle/index.004a953767d725beb8fc.js"></script>
|
||||
<script src="/~landscape/js/bundle/index.a3923bdec6badc072f30.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import React, { useState } from 'react';
|
||||
import Helmet from 'react-helmet';
|
||||
import styled from 'styled-components';
|
||||
|
||||
@ -10,6 +10,7 @@ import Tiles from './components/tiles';
|
||||
import Tile from './components/tiles/tile';
|
||||
import Welcome from './components/welcome';
|
||||
import Groups from './components/Groups';
|
||||
import { writeText } from '~/logic/lib/util';
|
||||
|
||||
const ScrollbarLessBox = styled(Box)`
|
||||
scrollbar-width: none !important;
|
||||
@ -19,70 +20,75 @@ const ScrollbarLessBox = styled(Box)`
|
||||
}
|
||||
`;
|
||||
|
||||
export default class LaunchApp extends React.Component {
|
||||
render() {
|
||||
const { props } = this;
|
||||
export default function LaunchApp(props) {
|
||||
const [hashText, setHashText] = useState(props.baseHash);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Helmet>
|
||||
<title>OS1 - Home</title>
|
||||
</Helmet>
|
||||
<ScrollbarLessBox height='100%' overflowY='scroll'>
|
||||
<Welcome firstTime={props.launch.firstTime} api={props.api} />
|
||||
<Box
|
||||
mx='2'
|
||||
display='grid'
|
||||
gridTemplateColumns='repeat(auto-fill, minmax(128px, 1fr))'
|
||||
gridGap={3}
|
||||
p={2}
|
||||
pt={0}
|
||||
>
|
||||
<Tile
|
||||
bg="transparent"
|
||||
color="green"
|
||||
to="/~landscape/home"
|
||||
p={0}
|
||||
>
|
||||
<Box p={2} height='100%' width='100%' bg='green'>
|
||||
<Row alignItems='center'>
|
||||
<Icon
|
||||
color="white"
|
||||
// fill="rgba(0,0,0,0)"
|
||||
icon="Boot"
|
||||
/>
|
||||
<Text ml="1" mt='1px' color="white">DMs + Drafts</Text>
|
||||
</Row>
|
||||
</Box>
|
||||
</Tile>
|
||||
<Tiles
|
||||
tiles={props.launch.tiles}
|
||||
tileOrdering={props.launch.tileOrdering}
|
||||
api={props.api}
|
||||
location={props.userLocation}
|
||||
weather={props.weather}
|
||||
/>
|
||||
<Box display={["none", "block"]} width="100%" gridColumn="1 / -1"></Box>
|
||||
<Groups unreads={props.unreads} groups={props.groups} associations={props.associations} />
|
||||
</Box>
|
||||
</ScrollbarLessBox>
|
||||
return (
|
||||
<>
|
||||
<Helmet>
|
||||
<title>OS1 - Home</title>
|
||||
</Helmet>
|
||||
<ScrollbarLessBox height='100%' overflowY='scroll'>
|
||||
<Welcome firstTime={props.launch.firstTime} api={props.api} />
|
||||
<Box
|
||||
position="absolute"
|
||||
fontFamily="mono"
|
||||
left="0"
|
||||
bottom="0"
|
||||
color="gray"
|
||||
bg="white"
|
||||
ml={3}
|
||||
mb={3}
|
||||
borderRadius={2}
|
||||
fontSize={0}
|
||||
mx='2'
|
||||
display='grid'
|
||||
gridTemplateColumns='repeat(auto-fill, minmax(128px, 1fr))'
|
||||
gridGap={3}
|
||||
p={2}
|
||||
pt={0}
|
||||
>
|
||||
{props.baseHash}
|
||||
<Tile
|
||||
bg="transparent"
|
||||
color="green"
|
||||
to="/~landscape/home"
|
||||
p={0}
|
||||
>
|
||||
<Box p={2} height='100%' width='100%' bg='green'>
|
||||
<Row alignItems='center'>
|
||||
<Icon
|
||||
color="white"
|
||||
// fill="rgba(0,0,0,0)"
|
||||
icon="Boot"
|
||||
/>
|
||||
<Text ml="1" mt='1px' color="white">DMs + Drafts</Text>
|
||||
</Row>
|
||||
</Box>
|
||||
</Tile>
|
||||
<Tiles
|
||||
tiles={props.launch.tiles}
|
||||
tileOrdering={props.launch.tileOrdering}
|
||||
api={props.api}
|
||||
location={props.userLocation}
|
||||
weather={props.weather}
|
||||
/>
|
||||
<Box display={["none", "block"]} width="100%" gridColumn="1 / -1"></Box>
|
||||
<Groups unreads={props.unreads} groups={props.groups} associations={props.associations} />
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
}
|
||||
</ScrollbarLessBox>
|
||||
<Box
|
||||
position="absolute"
|
||||
fontFamily="mono"
|
||||
left="0"
|
||||
bottom="0"
|
||||
color="gray"
|
||||
bg="white"
|
||||
ml={3}
|
||||
mb={3}
|
||||
borderRadius={2}
|
||||
fontSize={0}
|
||||
p={2}
|
||||
cursor="pointer"
|
||||
onClick={() => {
|
||||
writeText(props.baseHash);
|
||||
setHashText('copied');
|
||||
setTimeout(() => {
|
||||
setHashText(props.baseHash);
|
||||
}, 2000);
|
||||
}}
|
||||
>
|
||||
{hashText || props.baseHash}
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -34,8 +34,9 @@ export function ChatNotification(props: {
|
||||
contacts: Rolodex;
|
||||
groups: Groups;
|
||||
api: GlobalApi;
|
||||
remoteContentPolicy: any;
|
||||
}) {
|
||||
const { index, contents, read, time, api, timebox } = props;
|
||||
const { index, contents, read, time, api, timebox, remoteContentPolicy } = props;
|
||||
const authors = _.map(contents, "author");
|
||||
|
||||
const { chat, mention } = index;
|
||||
@ -46,7 +47,7 @@ export function ChatNotification(props: {
|
||||
const group = props.groups[groupPath];
|
||||
|
||||
const desc = describeNotification(mention, contents.length);
|
||||
const groupContacts = props.contacts[groupPath];
|
||||
const groupContacts = props.contacts[groupPath] || {};
|
||||
|
||||
const onClick = useCallback(() => {
|
||||
if (props.archived) {
|
||||
@ -74,7 +75,8 @@ export function ChatNotification(props: {
|
||||
/>
|
||||
<Col pb="3" pl="5">
|
||||
{_.map(_.take(contents, 5), (content, idx) => {
|
||||
const to = `/~landscape${groupPath}/resource/chat${appPath}?msg=${content.number}`;
|
||||
const workspace = group?.hidden ? '/home' : groupPath;
|
||||
const to = `/~landscape${workspace}/resource/chat${appPath}?msg=${content.number}`;
|
||||
return (
|
||||
<Link key={idx} to={to}>
|
||||
<ChatMessage
|
||||
@ -85,6 +87,7 @@ export function ChatNotification(props: {
|
||||
contacts={groupContacts}
|
||||
fontSize='0'
|
||||
pt='2'
|
||||
remoteContentPolicy={remoteContentPolicy}
|
||||
/>
|
||||
</Link>
|
||||
);
|
||||
|
@ -59,7 +59,7 @@ const GraphUrl = ({ url, title }) => (
|
||||
</Box>
|
||||
);
|
||||
|
||||
const GraphNodeContent = ({ contents, mod, description, index }) => {
|
||||
const GraphNodeContent = ({ contents, mod, description, index, remoteContentPolicy }) => {
|
||||
const idx = index.slice(1).split("/");
|
||||
if (mod === "link") {
|
||||
if (idx.length === 1) {
|
||||
@ -67,7 +67,7 @@ const GraphNodeContent = ({ contents, mod, description, index }) => {
|
||||
return <GraphUrl title={text} url={url} />;
|
||||
} else if (idx.length === 2) {
|
||||
const [{ text }] = contents;
|
||||
return <RichText>{text}</RichText>;
|
||||
return <RichText remoteContentPolicy={remoteContentPolicy}>{text}</RichText>;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -76,7 +76,7 @@ const GraphNodeContent = ({ contents, mod, description, index }) => {
|
||||
return null;
|
||||
} else if (idx[1] === "2") {
|
||||
const [{ text }] = contents;
|
||||
return <RichText>{text}</RichText>;
|
||||
return <RichText remoteContentPolicy={remoteContentPolicy}>{text}</RichText>;
|
||||
} else if (idx[1] === "1") {
|
||||
const [{ text: header }, { text: body }] = contents;
|
||||
const snippet = getSnippet(body);
|
||||
@ -124,7 +124,8 @@ const GraphNode = ({
|
||||
graph,
|
||||
group,
|
||||
read,
|
||||
onRead
|
||||
onRead,
|
||||
remoteContentPolicy
|
||||
}) => {
|
||||
author = deSig(author);
|
||||
const history = useHistory();
|
||||
@ -172,6 +173,7 @@ const GraphNode = ({
|
||||
mod={mod}
|
||||
description={description}
|
||||
index={index}
|
||||
remoteContentPolicy={remoteContentPolicy}
|
||||
/>
|
||||
</Row>
|
||||
</Col>
|
||||
@ -189,8 +191,9 @@ export function GraphNotification(props: {
|
||||
associations: Associations;
|
||||
contacts: Rolodex;
|
||||
api: GlobalApi;
|
||||
remoteContentPolicy: any;
|
||||
}) {
|
||||
const { contents, index, read, time, api, timebox } = props;
|
||||
const { contents, index, read, time, api, timebox, remoteContentPolicy } = props;
|
||||
|
||||
const authors = _.map(contents, "author");
|
||||
const { graph, group } = index;
|
||||
@ -234,6 +237,7 @@ export function GraphNotification(props: {
|
||||
group={group}
|
||||
read={read}
|
||||
onRead={onClick}
|
||||
remoteContentPolicy={remoteContentPolicy}
|
||||
/>
|
||||
))}
|
||||
</Col>
|
||||
|
@ -63,7 +63,7 @@ export function Header(props: {
|
||||
|
||||
const time = moment(props.time).format("HH:mm");
|
||||
const groupTitle =
|
||||
props.associations.contacts?.[props.group]?.metadata?.title || props.group;
|
||||
props.associations.contacts?.[props.group]?.metadata?.title;
|
||||
|
||||
const app = props.chat ? 'chat' : 'graph';
|
||||
const channelTitle =
|
||||
@ -87,8 +87,12 @@ export function Header(props: {
|
||||
{!!moduleIcon && <Icon icon={moduleIcon as any} />}
|
||||
{!!channel && <Text fontWeight="500">{channelTitle}</Text>}
|
||||
<Rule vertical height="12px" />
|
||||
<Text fontWeight="500">{groupTitle}</Text>
|
||||
<Rule vertical height="12px"/>
|
||||
{groupTitle &&
|
||||
<>
|
||||
<Text fontWeight="500">{groupTitle}</Text>
|
||||
<Rule vertical height="12px"/>
|
||||
</>
|
||||
}
|
||||
<Text fontWeight="regular" color="lightGray">
|
||||
{time}
|
||||
</Text>
|
||||
|
@ -3,7 +3,7 @@ import f from "lodash/fp";
|
||||
import _ from "lodash";
|
||||
import { Icon, Col, Row, Box, Text, Anchor } from "@tlon/indigo-react";
|
||||
import moment from "moment";
|
||||
import { Notifications, Rolodex, Timebox, IndexedNotification } from "~/types";
|
||||
import { Notifications, Rolodex, Timebox, IndexedNotification, Groups } from "~/types";
|
||||
import { MOMENT_CALENDAR_DATE, daToUnix, resourceAsPath } from "~/logic/lib/util";
|
||||
import { BigInteger } from "big-integer";
|
||||
import GlobalApi from "~/logic/api/global";
|
||||
@ -38,6 +38,7 @@ function filterNotification(associations: Associations, groups: string[]) {
|
||||
export default function Inbox(props: {
|
||||
notifications: Notifications;
|
||||
archive: Notifications;
|
||||
groups: Groups;
|
||||
showArchive?: boolean;
|
||||
api: GlobalApi;
|
||||
associations: Associations;
|
||||
@ -145,9 +146,11 @@ export default function Inbox(props: {
|
||||
contacts={props.contacts}
|
||||
archive={!!props.showArchive}
|
||||
associations={props.associations}
|
||||
groups={props.groups}
|
||||
graphConfig={props.notificationsGraphConfig}
|
||||
groupConfig={props.notificationsGroupConfig}
|
||||
chatConfig={props.notificationsChatConfig}
|
||||
remoteContentPolicy={props.remoteContentPolicy}
|
||||
api={api}
|
||||
/>
|
||||
)}
|
||||
@ -163,9 +166,11 @@ export default function Inbox(props: {
|
||||
archive={!!props.showArchive}
|
||||
associations={props.associations}
|
||||
api={api}
|
||||
groups={props.groups}
|
||||
graphConfig={props.notificationsGraphConfig}
|
||||
groupConfig={props.notificationsGroupConfig}
|
||||
chatConfig={props.notificationsChatConfig}
|
||||
remoteContentPolicy={props.remoteContentPolicy}
|
||||
/>
|
||||
)
|
||||
)}
|
||||
@ -186,6 +191,7 @@ function sortIndexedNotification(
|
||||
|
||||
function DaySection({
|
||||
contacts,
|
||||
groups,
|
||||
archive,
|
||||
timeboxes,
|
||||
latest = false,
|
||||
@ -194,6 +200,7 @@ function DaySection({
|
||||
groupConfig,
|
||||
graphConfig,
|
||||
chatConfig,
|
||||
remoteContentPolicy
|
||||
}) {
|
||||
const calendar = latest
|
||||
? MOMENT_CALENDAR_DATE
|
||||
@ -226,7 +233,9 @@ function DaySection({
|
||||
notification={not}
|
||||
archived={archive}
|
||||
contacts={contacts}
|
||||
groups={groups}
|
||||
time={date}
|
||||
remoteContentPolicy={remoteContentPolicy}
|
||||
/>
|
||||
</React.Fragment>
|
||||
))
|
||||
|
@ -8,7 +8,9 @@ import {
|
||||
NotificationGraphConfig,
|
||||
GroupNotificationsConfig,
|
||||
NotifIndex,
|
||||
Groups,
|
||||
Associations,
|
||||
Contacts,
|
||||
} from "~/types";
|
||||
import GlobalApi from "~/logic/api/global";
|
||||
import { getParentIndex } from "~/logic/lib/notification";
|
||||
@ -24,9 +26,12 @@ interface NotificationProps {
|
||||
associations: Associations;
|
||||
api: GlobalApi;
|
||||
archived: boolean;
|
||||
groups: Groups;
|
||||
contacts: Contacts;
|
||||
graphConfig: NotificationGraphConfig;
|
||||
groupConfig: GroupNotificationsConfig;
|
||||
chatConfig: string[];
|
||||
remoteContentPolicy: any;
|
||||
}
|
||||
|
||||
function getMuted(
|
||||
@ -137,6 +142,7 @@ export function Notification(props: NotificationProps) {
|
||||
timebox={props.time}
|
||||
time={time}
|
||||
associations={associations}
|
||||
remoteContentPolicy={props.remoteContentPolicy}
|
||||
/>
|
||||
</Wrapper>
|
||||
);
|
||||
@ -172,10 +178,11 @@ export function Notification(props: NotificationProps) {
|
||||
contacts={props.contacts}
|
||||
read={read}
|
||||
archived={archived}
|
||||
groups={{}}
|
||||
groups={props.groups}
|
||||
timebox={props.time}
|
||||
time={time}
|
||||
associations={associations}
|
||||
remoteContentPolicy={props.remoteContentPolicy}
|
||||
/>
|
||||
</Wrapper>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user