Skip to content
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

ops: merge staging back into develop #3251

Merged
merged 60 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
c26d613
Merge pull request #3216 from tloncorp/develop
arthyn Feb 8, 2024
022952c
groups: filter out pinned from the main list on mobile
latter-bolden Feb 8, 2024
dcbeaed
groups list: make sure all group subsets are filtered
latter-bolden Feb 8, 2024
c9cc1db
talk sunset: correctly track settings store seen talk sunset state an…
latter-bolden Feb 8, 2024
b337fe4
talk sunset: indicate in header and allow sunset sheet to be manually…
latter-bolden Feb 8, 2024
0917261
Merge pull request #3220 from tloncorp/lb/mobile-pinned-filter-out
arthyn Feb 8, 2024
5e0a5f1
Merge pull request #3221 from tloncorp/lb/fix-talk-sunset
arthyn Feb 8, 2024
d56198d
app: fix 'undefined' in title and properly call it Tlon
arthyn Feb 8, 2024
939f6bf
app: show missing notifications
arthyn Feb 8, 2024
df7b1d9
notifications: copy adjustment
arthyn Feb 8, 2024
222f3eb
Merge pull request #3222 from tloncorp/hm/fix-title-in-channels
arthyn Feb 8, 2024
79ee7d7
messages: add hook for getting messages count dependent on filter
latter-bolden Feb 8, 2024
8967368
sidebar: extract messages sidebar item and add count
latter-bolden Feb 8, 2024
8079645
sidebar: use new messages sidebar item in top nav
latter-bolden Feb 8, 2024
3b5f3a0
Merge branch 'staging' into lb/messages-tab-count
latter-bolden Feb 8, 2024
c342622
Merge pull request #3223 from tloncorp/lb/messages-tab-count
latter-bolden Feb 8, 2024
a748b7b
nav: guard against messages tab count error
latter-bolden Feb 9, 2024
f35e489
Merge pull request #3226 from tloncorp/lb/messages-nav-tab-count-fix
arthyn Feb 9, 2024
d120ba0
ops: ensure we reglob when only targeting staging
arthyn Feb 9, 2024
b21a4a6
Merge pull request #3228 from tloncorp/hm/need-to-reglob-on-staging
arthyn Feb 9, 2024
7d76803
ops: add proper dependency
arthyn Feb 9, 2024
7a7dcb3
Merge branch 'staging' into hm/fix-canary
arthyn Feb 9, 2024
bf60da0
Merge pull request #3229 from tloncorp/hm/fix-canary
arthyn Feb 9, 2024
1032af0
update glob: [skip actions]
invalid-email-address Feb 9, 2024
7fc7606
ops: add log to see what's going on
arthyn Feb 9, 2024
8c166af
Merge pull request #3230 from tloncorp/hm/add-log-to-deploy
arthyn Feb 9, 2024
92e2d0e
ops: default tag better
arthyn Feb 9, 2024
f12497d
ops: add dependency
arthyn Feb 9, 2024
1224f12
Merge pull request #3231 from tloncorp/hm/better-defaulting
arthyn Feb 9, 2024
402b3f9
ops: bad yml
arthyn Feb 9, 2024
46df72d
Merge pull request #3232 from tloncorp/hm/fix-yml
arthyn Feb 9, 2024
04647aa
ops: try use env instead
arthyn Feb 9, 2024
71a4690
Merge branch 'staging' of github.com:tloncorp/landscape-apps into sta…
arthyn Feb 9, 2024
4694cf5
ops: brackets?
arthyn Feb 9, 2024
da4778a
ops: better referencing of vars
arthyn Feb 9, 2024
c97f542
ops: curly dereference
arthyn Feb 9, 2024
4d89b65
ops: trying double quotes
arthyn Feb 9, 2024
1224792
ops: try case matching
arthyn Feb 9, 2024
793f135
ops: matching case
arthyn Feb 9, 2024
9dd32f7
unread-count: referencing wrong unreads
arthyn Feb 9, 2024
47f6fc4
Merge pull request #3235 from tloncorp/hm/fix-dm-filter-count
arthyn Feb 9, 2024
66cb94e
update glob: [skip actions]
invalid-email-address Feb 9, 2024
5e8c5c8
leap: small QoL improvements for previous talk users
arthyn Feb 12, 2024
76c1bc9
Merge pull request #3237 from tloncorp/hm/leap-to-message
arthyn Feb 12, 2024
3c976ea
update glob: [skip actions]
invalid-email-address Feb 12, 2024
2d06ed7
desktop sidebar: fix dropdown links for Leap and Landscape
latter-bolden Feb 12, 2024
1331df6
Merge pull request #3239 from tloncorp/lb/sidebar-fixes
latter-bolden Feb 12, 2024
d08392a
update glob: [skip actions]
invalid-email-address Feb 12, 2024
e62d0ae
settings: add nav state for groups and messages tabs
latter-bolden Feb 12, 2024
4fbb277
sidebar utils: add helpers for accessing and setting nav state
latter-bolden Feb 12, 2024
c7fa1fc
nav: add effect for storing nav state when navigating between tabs
latter-bolden Feb 12, 2024
9e8ac79
sidebar: update groups and messages nav tabs to use stored nav state
latter-bolden Feb 13, 2024
e5c6e26
sidebar: move search into top section to avoid double scrollbar
latter-bolden Feb 13, 2024
f27e979
desktop nav: highlight messages & groups sidebaritems despite custom …
latter-bolden Feb 13, 2024
e1f3bbb
desktop sidebar: give list items min height so scroller is happy
latter-bolden Feb 13, 2024
3e9ab4d
Merge pull request #3240 from tloncorp/lb/sidebar-nav-state
latter-bolden Feb 13, 2024
71f9296
update glob: [skip actions]
invalid-email-address Feb 13, 2024
b7bc7a3
Merge branch 'develop' into lb/staging-merge
latter-bolden Feb 15, 2024
6772fb9
conflict fix: carry over staging variable swap
latter-bolden Feb 15, 2024
66d9557
unreads: use chat store unreads for sidebar count
patosullivan Feb 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/helpers/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ref=${6:-"develop"}
[ "$desk" == "talk" ] && from="talk" || from="desk"
folder=$ship/$desk

echo "Deploying $desk from $ref of $repo to $ship in $zone of $project"
set -e
set -o pipefail
cmdfile=$(mktemp "${TMPDIR:-/tmp/}janeway.XXXXXXXXX")
Expand Down
58 changes: 57 additions & 1 deletion .github/workflows/deploy-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,68 @@ on:
push:
branches:
- 'staging'
env:
tag: ${{ github.event.inputs.tag || 'staging' }}
jobs:
build-frontend:
runs-on: ubuntu-latest
name: 'Build Frontend'
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.tag }}
- uses: actions/setup-node@v3
with:
node-version-file: ./ui/.nvmrc
- working-directory: ./ui
run: |
npm ci
npm run build
- uses: actions/upload-artifact@v3
with:
name: 'ui-dist'
path: ui/dist
glob:
runs-on: ubuntu-latest
name: 'Make a glob'
needs: build-frontend
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.tag }}
- uses: actions/download-artifact@v3
with:
name: 'ui-dist'
path: ui/dist
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_SERVICE_KEY }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: 'glob'
uses: ./.github/actions/glob
with:
folder: 'ui/dist/*'
docket: 'desk/desk.docket-0'
- name: Commit and Push Glob
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
git add desk/desk.docket-0
git commit -n -m "update glob: ${{ steps.glob.outputs.hash }} [skip actions]" || echo "No changes to commit"
INPUT=${{ env.tag }}
BRANCH=${INPUT:-"staging"}
git pull origin $BRANCH --rebase --autostash
git push
deploy:
runs-on: ubuntu-latest
name: "Release to ~binnec-dozzod-marnus (canary)"
needs: glob
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.tag }}
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
Expand All @@ -25,7 +81,7 @@ jobs:
- id: deploy
name: Deploy
run:
./.github/helpers/deploy.sh tloncorp/landscape-apps groups binnec-dozzod-marnus us-central1-a mainnet-tlon-other-2d ${{ github.event.inputs.tag }}
./.github/helpers/deploy.sh tloncorp/landscape-apps groups binnec-dozzod-marnus us-central1-a mainnet-tlon-other-2d ${{ env.tag }}
env:
SSH_SEC_KEY: ${{ secrets.GCP_SSH_SEC_KEY }}
SSH_PUB_KEY: ${{ secrets.GCP_SSH_PUB_KEY }}
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ on:
push:
branches:
- 'develop'
env:
tag: ${{ github.event.inputs.tag || 'develop' }}
jobs:
build-frontend:
runs-on: ubuntu-latest
name: 'Build Frontend'
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag }}
ref: ${{ env.tag }}
- uses: actions/setup-node@v3
with:
node-version-file: ./ui/.nvmrc
Expand All @@ -36,7 +38,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag }}
ref: ${{ env.tag }}
- uses: actions/download-artifact@v3
with:
name: 'ui-dist'
Expand All @@ -58,7 +60,7 @@ jobs:
git config --global user.email [email protected]
git add desk/desk.docket-0
git commit -n -m "update glob: ${{ steps.glob.outputs.hash }} [skip actions]" || echo "No changes to commit"
INPUT=${{ github.event.inputs.tag }}
INPUT=${{ env.tag }}
BRANCH=${INPUT:-"develop"}
git pull origin $BRANCH --rebase --autostash
git push
Expand All @@ -69,7 +71,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag }}
ref: ${{ env.tag }}
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
Expand All @@ -79,7 +81,7 @@ jobs:
- id: deploy
name: Deploy
run:
./.github/helpers/deploy.sh tloncorp/landscape-apps groups wannec-dozzod-marnus us-central1-a mainnet-tlon-other-2d ${{ github.event.inputs.tag }}
./.github/helpers/deploy.sh tloncorp/landscape-apps groups wannec-dozzod-marnus us-central1-a mainnet-tlon-other-2d ${{ env.tag }}
env:
SSH_SEC_KEY: ${{ secrets.GCP_SSH_SEC_KEY }}
SSH_PUB_KEY: ${{ secrets.GCP_SSH_PUB_KEY }}
Expand Down
19 changes: 10 additions & 9 deletions ui/src/components/Leap/useLeap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
LEAP_RESULT_TRUNCATE_SIZE,
} from '@/constants';
import { emptyContact, useContacts } from '@/state/contact';
import { useModalNavigate } from '@/logic/routing';
import { useCheckDmUnread, useDms, useMultiDms } from '@/state/chat';
import useIsGroupUnread from '@/logic/useIsGroupUnread';
import { useCheckChannelUnread } from '@/logic/channel';
Expand All @@ -30,6 +29,7 @@ import ShapesIcon from '../icons/ShapesIcon';
import NotebookIcon from '../icons/NotebookIcon';
import PeopleIcon from '../icons/PeopleIcon';
import GridIcon from '../icons/GridIcon';
import useActiveTab from '../Sidebar/util';

interface LeapContext {
isOpen: boolean;
Expand Down Expand Up @@ -88,7 +88,6 @@ export default function useLeap() {
setSelectedIndex,
} = React.useContext(LeapContext);
const navigate = useNavigate();
const modalNavigate = useModalNavigate();
const groups = useGroups();
const currentGroupFlag = useGroupFlag();
const { isGroupUnread } = useIsGroupUnread();
Expand All @@ -103,6 +102,7 @@ export default function useLeap() {
const charges = useCharges();
const location = useLocation();
const mutuals = useMutuals();
const tab = useActiveTab();
const preSiggedMutuals = useMemo(
() => Object.keys(mutuals).map((m) => preSig(m)),
[mutuals]
Expand Down Expand Up @@ -231,7 +231,7 @@ export default function useLeap() {
0,
LEAP_DESCRIPTION_TRUNCATE_LENGTH
),
to: `/profile/${patp}`,
to: `/dm/${patp}`,
resultIndex: idx,
};
}),
Expand Down Expand Up @@ -336,9 +336,11 @@ export default function useLeap() {
section: 'Channels',
},
...filteredChannels.map(({ groupFlag, group, channel, nest }, idx) => {
const [chType, chFlag] = nestToFlag(nest);
const [chType, _chFlag] = nestToFlag(nest);
const loc = `/groups/${groupFlag}/channels/${nest}`;
const nav = tab === 'messages' ? `/dm${loc}` : loc;
const onSelect = () => {
navigate(`/groups/${groupFlag}/channels/${nest}`);
navigate(nav);
setSelectedIndex(0);
setInputValue('');
setIsOpen(false);
Expand All @@ -363,7 +365,7 @@ export default function useLeap() {
input: inputValue,
title: channel.meta.title,
subtitle: group.meta.title,
to: `/groups/${groupFlag}/channels/chat/${chFlag}`,
to: nav,
resultIndex:
idx +
(shipResults.length > LEAP_RESULT_TRUNCATE_SIZE
Expand All @@ -373,6 +375,7 @@ export default function useLeap() {
}),
];
}, [
tab,
currentGroupFlag,
groups,
inputValue,
Expand Down Expand Up @@ -571,9 +574,7 @@ export default function useLeap() {
const scoreChargeResult = (
entry: fuzzy.FilterResult<[string, ChargeWithDesk]>
): number => {
const { score, original } = entry;
const [_, charge] = original;

const { score } = entry;
const newScore = score;

return newScore;
Expand Down
14 changes: 11 additions & 3 deletions ui/src/components/Sidebar/AddGroupSidebarItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import { useLocation, useNavigate } from 'react-router-dom';
import AddIcon16 from '../icons/Add16Icon';
import HomeIconMobileNav from '../icons/HomeIconMobileNav';
import SidebarItem from './SidebarItem';
import useActiveTab from './util';
import useActiveTab, { useNavToTab } from './util';

export default function AddGroupSidebarItem() {
export default function GroupSidebarItem() {
const navigate = useNavigate();
const location = useLocation();
const activeTab = useActiveTab();
const [open, setOpen] = useState(false);
const navToTab = useNavToTab();

const onOpenChange = (openChange: boolean) => {
setOpen(openChange);
Expand All @@ -21,6 +22,12 @@ export default function AddGroupSidebarItem() {
navigate(path, { state: { backgroundLocation: location } });
};

const onClick = () => {
if (activeTab !== 'groups') {
navToTab('groups');
}
};

return (
<Dropdown.Root open={open} onOpenChange={onOpenChange}>
<SidebarItem
Expand All @@ -35,8 +42,9 @@ export default function AddGroupSidebarItem() {
isInactive={activeTab !== 'groups'}
/>
}
to="/groups"
onClick={onClick}
color={activeTab === 'groups' ? 'text-black' : 'text-gray-600'}
highlightPath="/groups"
actions={
<Dropdown.Trigger data-testid="add-group-sidebar-button-icon">
<AddIcon16 className="relative top-[2px] hidden h-4 w-4 group-hover:block" />
Expand Down
8 changes: 4 additions & 4 deletions ui/src/components/Sidebar/GroupList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ type AnyListItem = TopContentListItem | GroupListItem | SearchListItem;

function itemContent(_i: number, item: AnyListItem) {
if (item.type === 'top') {
return item.component;
return <div className="min-h-[1px]">{item.component}</div>;
}

if (item.type === 'search') {
const record = item.data;
if (record.type === 'group') {
return (
<div className="px-4 sm:px-2">
<div className="min-h-[1px] px-4 sm:px-2">
<GroupsSidebarItem
flag={record.flag}
isNew={record.status === 'new'}
Expand All @@ -31,7 +31,7 @@ function itemContent(_i: number, item: AnyListItem) {
}

return (
<div className="px-4 sm:px-2">
<div className="min-h-[1px] px-4 sm:px-2">
<GangItem
flag={record.flag}
invited={record.status === 'invited'}
Expand All @@ -43,7 +43,7 @@ function itemContent(_i: number, item: AnyListItem) {

const [flag] = item.data;
return (
<div className="px-4 sm:px-2">
<div className="min-h-[1px] px-4 sm:px-2">
<GroupsSidebarItem key={flag} flag={flag} />
</div>
);
Expand Down
59 changes: 59 additions & 0 deletions ui/src/components/Sidebar/MessagesSidebarItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import cn from 'classnames';
import { Link } from 'react-router-dom';
import useMessagesUnreadCount from '@/logic/useMessagesUnreadCount';
import MessagesIcon from '../icons/MessagesIcon';
import SidebarItem from './SidebarItem';
import useActiveTab, { useNavToTab } from './util';
import AddIcon16 from '../icons/Add16Icon';
import ActivityIndicator from './ActivityIndicator';

export default function MessagesSidebarItem() {
const activeTab = useActiveTab();
const unreadCount = useMessagesUnreadCount();
const navToTab = useNavToTab();

const onClick = () => {
if (activeTab !== 'messages') {
navToTab('messages');
}
};

return (
<SidebarItem
icon={
<MessagesIcon
className={cn(
'm-1 h-4 w-4',
activeTab === 'messages' && 'text-black'
)}
nonNav
isInactive={activeTab !== 'messages'}
/>
}
actions={
<div className="group">
{unreadCount > 0 && (
<ActivityIndicator
count={unreadCount}
className="group-hover:hidden"
bg={
activeTab === 'messages'
? 'bg-none text-black'
: 'bg-blue-soft text-blue'
}
/>
)}
<Link to="/dm/new" className="hidden items-center group-hover:flex">
<AddIcon16 className="h-4 w-4" />
</Link>
</div>
}
highlightPath="/messages"
onClick={onClick}
className="group"
color={activeTab === 'messages' ? 'text-black' : 'text-gray-600'}
>
Messages
</SidebarItem>
);
}
Loading
Loading