From e4b663768052d211a03924669de688b629605bbc Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 19 Oct 2023 07:43:54 +0800 Subject: [PATCH 01/17] Ok, hopefully fix messed up tag_name Seems working but need better tag name --- .github/workflows/prodtag.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/prodtag.yml b/.github/workflows/prodtag.yml index bf206fc0..8d62deb7 100644 --- a/.github/workflows/prodtag.yml +++ b/.github/workflows/prodtag.yml @@ -14,15 +14,17 @@ jobs: - uses: actions/checkout@v4 with: ref: production - - run: git tag "`date +%Y.%m.%d`.`git rev-parse --short HEAD`" $(git rev-parse HEAD) - - run: git push --tags + # - run: git tag "`date +%Y.%m.%d`.`git rev-parse --short HEAD`" $(git rev-parse HEAD) + # - run: git push --tags - uses: actions/setup-node@v3 with: node-version: 18 - run: npm ci && npm run build - run: cd dist && zip -r ../phanpy-dist.zip . && cd .. + - id: tag_name + run: echo ::set-output name=tag_name::$(date +%Y.%m.%d).$(git rev-parse --short HEAD) - uses: softprops/action-gh-release@v1 with: - tag_name: ${{ github.ref_name }} + tag_name: ${{ steps.tag_name.outputs.tag_name }} generate_release_notes: true files: phanpy-dist.zip From 7145c20136507cfecba48cdb48235cfd6d5cab44 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 19 Oct 2023 10:13:26 +0800 Subject: [PATCH 02/17] Fix wonky filter bar button transitions --- src/app.css | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app.css b/src/app.css index fcf4b0cd..92cc9957 100644 --- a/src/app.css +++ b/src/app.css @@ -2133,14 +2133,19 @@ ul.link-list li a .icon { text-decoration: none; white-space: nowrap; border: 2px solid transparent; - transition: all 0.3s ease-out; + transition: border-color 0.3s ease-out; display: inline-flex; align-items: center; gap: 8px; } -.filter-bar > a:is(:hover, :focus) { +.filter-bar > a:focus-visible { border-color: var(--link-light-color); } +@media (hover: hover) { + .filter-bar > a:hover { + border-color: var(--link-light-color); + } +} .filter-bar > a > * { vertical-align: middle; } From 106cd16e414731d6eee3ada4749e4e94a8417345 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 19 Oct 2023 10:13:53 +0800 Subject: [PATCH 03/17] Add loading state to filter bar --- src/app.css | 7 +++++++ src/components/timeline.jsx | 8 +++++++- src/pages/search.jsx | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/app.css b/src/app.css index 92cc9957..60b5268c 100644 --- a/src/app.css +++ b/src/app.css @@ -2116,6 +2116,13 @@ ul.link-list li a .icon { transparent ); align-items: center; + transition: opacity 0.3s ease-out; + + &.loading, + .loading > & { + pointer-events: none; + opacity: 0.5; + } } .filter-bar.centered { justify-content: center; diff --git a/src/components/timeline.jsx b/src/components/timeline.jsx index 8ec6cd95..0f812a6d 100644 --- a/src/components/timeline.jsx +++ b/src/components/timeline.jsx @@ -334,7 +334,13 @@ function Timeline({ )} - {!!timelineStart &&
{timelineStart}
} + {!!timelineStart && ( +
+ {timelineStart} +
+ )} {!!items.length ? ( <>
    diff --git a/src/pages/search.jsx b/src/pages/search.jsx index 13016111..4d0f11e7 100644 --- a/src/pages/search.jsx +++ b/src/pages/search.jsx @@ -152,7 +152,7 @@ function Search(props) {
    {!!q && ( -
    +
    {!!type && ( ‹ All From c0c2bb45fe85d34cf31c2dd1270a63a2ba72ab10 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 19 Oct 2023 10:15:54 +0800 Subject: [PATCH 04/17] Auto-close account sheet when location path changes Test this on account sheet first, probably useful for other sheets too --- src/components/account-sheet.jsx | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/components/account-sheet.jsx b/src/components/account-sheet.jsx index 6a0d74f9..435cfa26 100644 --- a/src/components/account-sheet.jsx +++ b/src/components/account-sheet.jsx @@ -1,4 +1,5 @@ -import { useEffect } from 'preact/hooks'; +import { useEffect, useRef } from 'preact/hooks'; +import { useLocation } from 'react-router-dom'; import { api } from '../utils/api'; import states from '../utils/states'; @@ -16,17 +17,28 @@ function AccountSheet({ account, instance: propInstance, onClose }) { } }, [account]); + const location = useLocation(); + const currentLocationRef = useRef(location.pathname); + useEffect(() => { + if ( + currentLocationRef.current && + location.pathname !== currentLocationRef.current + ) { + onClose?.(); + } + }, [location.pathname]); + return (
    { - const accountBlock = e.target.closest('.account-block'); - if (accountBlock) { - onClose({ - destination: 'account-statuses', - }); - } - }} + // onClick={(e) => { + // const accountBlock = e.target.closest('.account-block'); + // if (accountBlock) { + // onClose({ + // destination: 'account-statuses', + // }); + // } + // }} > {!!onClose && ( )}
    - Private note for @{account?.acct} + Private note about @{account?.username || account?.acct}
    Date: Thu, 19 Oct 2023 20:19:55 +0800 Subject: [PATCH 12/17] Sneak in a slight copy change --- src/components/nav-menu.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/nav-menu.jsx b/src/components/nav-menu.jsx index 5591609d..fb8ff2ac 100644 --- a/src/components/nav-menu.jsx +++ b/src/components/nav-menu.jsx @@ -263,7 +263,7 @@ function NavMenu(props) { }} > {' '} - Shortcuts Settings… + Shortcuts / Columns… { From d62712d587d1674446af4159f5c18d3ac945d8d1 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 19 Oct 2023 20:47:11 +0800 Subject: [PATCH 13/17] double-tap zoom out once reach max scale --- src/components/media.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/media.jsx b/src/components/media.jsx index 6699fc4f..c700dc7e 100644 --- a/src/components/media.jsx +++ b/src/components/media.jsx @@ -130,6 +130,7 @@ function Media({ enabled: pinchZoomEnabled, draggableUnZoomed: false, inertiaFriction: 0.9, + doubleTapZoomOutOnMaxScale: true, containerProps: { className: 'media-zoom', style: { From 2916d1146b4c9bf1fef9169b9b7d7e96f1cbdda2 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 19 Oct 2023 20:50:32 +0800 Subject: [PATCH 14/17] Adjust the

    out --- src/components/shortcuts-settings.jsx | 80 +++++++++++++-------------- 1 file changed, 39 insertions(+), 41 deletions(-) diff --git a/src/components/shortcuts-settings.jsx b/src/components/shortcuts-settings.jsx index c6ecfd31..cd90bcbe 100644 --- a/src/components/shortcuts-settings.jsx +++ b/src/components/shortcuts-settings.jsx @@ -249,46 +249,45 @@ function ShortcutsSettings({ onClose }) {

    -

    - Specify a list of shortcuts that'll appear as: -

    - {[ - { - value: 'float-button', - label: 'Floating button', - imgURL: floatingButtonUrl, - }, - { - value: 'tab-menu-bar', - label: 'Tab/Menu bar', - imgURL: tabMenuBarUrl, - }, - { - value: 'multi-column', - label: 'Multi-column', - imgURL: multiColumnUrl, - }, - ].map(({ value, label, imgURL }) => ( - - ))} -
    - {/* { + states.settings.shortcutsViewMode = e.target.value; + }} + />{' '} + {' '} + {label} + + ))} +
    + {/* */} -

    {/*

    From 71bf8608e692d812064722246175b1859025324e Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 19 Oct 2023 21:07:00 +0800 Subject: [PATCH 15/17] Relayout the menu items in nav menu again --- src/components/nav-menu.css | 17 ++++++++++++++++- src/components/nav-menu.jsx | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/components/nav-menu.css b/src/components/nav-menu.css index 7a1d3077..a37c69e5 100644 --- a/src/components/nav-menu.css +++ b/src/components/nav-menu.css @@ -1,3 +1,9 @@ +.nav-menu section:last-child { + background-color: var(--bg-faded-color); + margin-bottom: -8px; + padding-bottom: 8px; +} + @media (min-width: 23em) { .nav-menu { display: grid; @@ -8,6 +14,7 @@ 'left right'; padding: 0; width: 22em; + max-width: 100%; } .nav-menu .top-menu { grid-area: top; @@ -27,7 +34,6 @@ } } .nav-menu section:last-child { - background-color: var(--bg-faded-color); background-image: linear-gradient( to right, var(--divider-color) 1px, @@ -45,6 +51,15 @@ animation: phanpying 0.2s ease-in-out both; border-top-right-radius: inherit; border-bottom-right-radius: inherit; + margin-bottom: 0; + display: flex; + flex-direction: column; + + .divider-grow { + flex-grow: 1; + height: auto; + background-color: transparent; + } } .nav-menu section:last-child > .szh-menu__divider:first-child { display: none; diff --git a/src/components/nav-menu.jsx b/src/components/nav-menu.jsx index fb8ff2ac..ac9c390e 100644 --- a/src/components/nav-menu.jsx +++ b/src/components/nav-menu.jsx @@ -249,6 +249,7 @@ function NavMenu(props) { Blocked users… + { states.showKeyboardShortcutsHelp = true; From 861619ce5719cc95787bba14f4ebf4962420e5d2 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 19 Oct 2023 22:10:20 +0800 Subject: [PATCH 16/17] Fix max-width of nav menu --- src/components/nav-menu.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/nav-menu.css b/src/components/nav-menu.css index a37c69e5..0e8e302f 100644 --- a/src/components/nav-menu.css +++ b/src/components/nav-menu.css @@ -14,7 +14,7 @@ 'left right'; padding: 0; width: 22em; - max-width: 100%; + max-width: calc(100vw - 16px); } .nav-menu .top-menu { grid-area: top; From 66fa6fbe52216d1d3ede607ec0852e3a70a4f072 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 19 Oct 2023 22:57:56 +0800 Subject: [PATCH 17/17] Memoize getHTMLText --- src/utils/getHTMLText.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/getHTMLText.jsx b/src/utils/getHTMLText.jsx index fc03b647..142f7e7d 100644 --- a/src/utils/getHTMLText.jsx +++ b/src/utils/getHTMLText.jsx @@ -1,3 +1,5 @@ +import mem from './mem'; + const div = document.createElement('div'); function getHTMLText(html) { if (!html) return ''; @@ -10,4 +12,4 @@ function getHTMLText(html) { return div.innerText.replace(/[\r\n]{3,}/g, '\n\n').trim(); } -export default getHTMLText; +export default mem(getHTMLText);