From cd00a2064228890f4891f5b15825d1f5a0d681e9 Mon Sep 17 00:00:00 2001 From: Innei Date: Wed, 23 Oct 2024 18:19:18 +0800 Subject: [PATCH 1/3] fix(ci): cannot release macOS APP (#957) (#1078) error message: ``` node_modules/macos-alias install: Traceback (most recent call last): node_modules/macos-alias install: File "/Users/runner/work/Follow/Follow/node_modules/node-gyp/gyp/gyp_main.py", line 42, in node_modules/macos-alias install: import gyp # noqa: E402 node_modules/macos-alias install: ^^^^^^^^^^ node_modules/macos-alias install: File "/Users/runner/work/Follow/Follow/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in node_modules/macos-alias install: import gyp.input node_modules/macos-alias install: File "/Users/runner/work/Follow/Follow/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in node_modules/macos-alias install: from distutils.version import StrictVersion node_modules/macos-alias install: ModuleNotFoundError: No module named 'distutils' node_modules/macos-alias install: gyp ERR! configure error node_modules/macos-alias install: gyp ERR! stack Error: `gyp` failed with exit code: 1 node_modules/macos-alias install: gyp ERR! stack at ChildProcess.onCpExit (/Users/runner/work/Follow/Follow/node_modules/node-gyp/lib/configure.js:325:16) node_modules/macos-alias install: gyp ERR! stack at ChildProcess.emit (node:events:519:28) node_modules/macos-alias install: gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12) node_modules/macos-alias install: gyp ERR! System Darwin 23.6.0 node_modules/macos-alias install: gyp ERR! command "/Users/runner/hostedtoolcache/node/22.9.0/arm64/bin/node" "/Users/runner/work/Follow/Follow/node_modules/.bin/node-gyp" "rebuild" node_modules/macos-alias install: gyp ERR! cwd /Users/runner/work/Follow/Follow/node_modules/macos-alias node_modules/macos-alias install: gyp ERR! node -v v22.9.0 node_modules/macos-alias install: gyp ERR! node-gyp -v v9.4.1 node_modules/macos-alias install: gyp ERR! not ok node_modules/macos-alias install: Failed ``` Repair refers to: https://github.com/actions/runner/issues/2958#issuecomment-2186602747 Test passed. Signed-off-by: Kevin Cui Co-authored-by: Kevin Cui --- .github/workflows/build.yml | 4 ++++ .github/workflows/nightly.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5f0cc05af..22fbe2b57 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,6 +62,10 @@ jobs: node-version: 22 cache: "pnpm" + - name: Install Python setuptools + if: runner.os == 'macOS' + run: brew install python-setuptools + - name: Install appdmg if: runner.os == 'macOS' run: pnpm add -g appdmg diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a0ac8912c..daf79a634 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -52,6 +52,10 @@ jobs: node-version: 22 cache: "pnpm" + - name: Install Python setuptools + if: runner.os == 'macOS' + run: brew install python-setuptools + - name: Install appdmg if: runner.os == 'macOS' run: pnpm add -g appdmg From 30e2f815de8cf1502e90b94ec8d8025b6fb84a32 Mon Sep 17 00:00:00 2001 From: Innei Date: Sat, 26 Oct 2024 17:28:44 +0800 Subject: [PATCH 2/3] chore: rebuild hash (#1161) Signed-off-by: Innei --- plugins/vite/deps.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/vite/deps.ts b/plugins/vite/deps.ts index 44a49ac15..2c01f2d2c 100644 --- a/plugins/vite/deps.ts +++ b/plugins/vite/deps.ts @@ -14,8 +14,8 @@ export function createDependencyChunksPlugin(dependencies: string[][]): Plugin { outputConfig.assetFileNames = "assets/[name].[hash:6][extname]" outputConfig.chunkFileNames = (chunkInfo) => { return chunkInfo.name.startsWith("vendor/") - ? "[name].[hash].js" - : "assets/[name].[hash:9].js" + ? "[name].[hash:9].js" + : "assets/[name].[hash].js" } const manualChunks = Array.isArray(output) ? output[0].manualChunks : output.manualChunks From e1816e1a12d8b4a8a2c46d2b758a3ce07ee90f0d Mon Sep 17 00:00:00 2001 From: Innei Date: Sun, 27 Oct 2024 18:19:41 +0800 Subject: [PATCH 3/3] perf: resolve feed item select area performance problem (#1176) Signed-off-by: Innei --- apps/renderer/src/modules/feed-column/index.tsx | 13 ++++++++++++- apps/renderer/src/modules/feed-column/item.tsx | 5 +---- apps/renderer/src/modules/feed-column/list.tsx | 1 + 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/apps/renderer/src/modules/feed-column/index.tsx b/apps/renderer/src/modules/feed-column/index.tsx index eb7531a8f..553ad94a3 100644 --- a/apps/renderer/src/modules/feed-column/index.tsx +++ b/apps/renderer/src/modules/feed-column/index.tsx @@ -1,5 +1,6 @@ import { ActionButton } from "@follow/components/ui/button/index.js" import { Routes, views } from "@follow/constants" +import { useTypeScriptHappyCallback } from "@follow/hooks" import { useSubscribeElectronEvent } from "@follow/shared/event" import { stopPropagation } from "@follow/utils/dom" import { clamp, cn } from "@follow/utils/utils" @@ -24,6 +25,7 @@ import { useSubscriptionStore } from "~/store/subscription" import { useFeedUnreadStore } from "~/store/unread" import { WindowUnderBlur } from "../../components/ui/background" +import { getSelectedFeedIds, setSelectedFeedIds } from "./atom" import { FeedColumnHeader } from "./header" import { FeedList } from "./list" @@ -190,7 +192,16 @@ export function FeedColumn({ children, className }: PropsWithChildren<{ classNam ))} -
+
{ + if (!(e.target instanceof HTMLElement) || !e.target.closest("[data-feed-id]")) { + const nextSelectedFeedIds = getSelectedFeedIds() + setSelectedFeedIds(nextSelectedFeedIds.length === 0 ? nextSelectedFeedIds : []) + } + }, [])} + > {views.map((item, index) => (
diff --git a/apps/renderer/src/modules/feed-column/item.tsx b/apps/renderer/src/modules/feed-column/item.tsx index 57299bd95..d8c75f958 100644 --- a/apps/renderer/src/modules/feed-column/item.tsx +++ b/apps/renderer/src/modules/feed-column/item.tsx @@ -80,11 +80,8 @@ const FeedItemImpl = ({ view, feedId, className }: FeedItemProps) => { }) const [isContextMenuOpen, setIsContextMenuOpen] = useState(false) - useAnyPointDown((e) => { + useAnyPointDown(() => { setIsContextMenuOpen(false) - if (!(e.target instanceof HTMLElement) || !e.target.closest("[data-feed-id]")) { - setSelectedFeedIds([]) - } }) if (!feed) return null diff --git a/apps/renderer/src/modules/feed-column/list.tsx b/apps/renderer/src/modules/feed-column/list.tsx index 19811884b..0d8f08394 100644 --- a/apps/renderer/src/modules/feed-column/list.tsx +++ b/apps/renderer/src/modules/feed-column/list.tsx @@ -189,6 +189,7 @@ function FeedListImpl({ className, view }: { className?: string; view: number }) hitRate={10} onSelect={(e) => { const allChanged = [...e.added, ...e.removed] + setSelectedFeedIds((prev) => { const added = allChanged .map((el) => el.dataset.feedId)