diff --git a/apps/desktop/layer/renderer/src/hooks/biz/useEntryActions.tsx b/apps/desktop/layer/renderer/src/hooks/biz/useEntryActions.tsx index 2091e2e8e..7f7b418cf 100644 --- a/apps/desktop/layer/renderer/src/hooks/biz/useEntryActions.tsx +++ b/apps/desktop/layer/renderer/src/hooks/biz/useEntryActions.tsx @@ -228,7 +228,7 @@ export const useEntryActions = ({ compact?: boolean }) => { const entry = useEntry(entryId, entrySelector) - const { isCollection } = useRouteParams() + const { isCollection, entryId: routeEntryId } = useRouteParams() const isInCollection = useIsEntryStarred(entryId) const isEntryInReadability = useEntryIsInReadability(entryId) @@ -256,6 +256,8 @@ export const useEntryActions = ({ const shortcuts = useCommandShortcuts() + const isCurrentVisitEntry = routeEntryId === entryId + const actionConfigs: EntryActionItem[] = useMemo(() => { if (!hasEntry) return [] @@ -338,6 +340,7 @@ export const useEntryActions = ({ }), new EntryActionMenuItem({ id: COMMAND_ID.entry.exportAsPDF, + hide: !isCurrentVisitEntry, onClick: runCmdFn(COMMAND_ID.entry.exportAsPDF, [{ entryId }]), entryId, }), @@ -497,6 +500,7 @@ export const useEntryActions = ({ shortcuts, view, isInCollection, + isCurrentVisitEntry, isShowSourceContent, isShowAISummaryAuto, isShowAISummaryOnce, @@ -506,7 +510,6 @@ export const useEntryActions = ({ isCollection, compact, isEntryInReadability, - integrationSettings.customIntegration, integrationSettings.enableCustomIntegration, ]) diff --git a/apps/desktop/layer/renderer/src/modules/app-layout/ai/AIChatFixedPanel.tsx b/apps/desktop/layer/renderer/src/modules/app-layout/ai/AIChatFixedPanel.tsx index dd88ef2f0..f090f8d91 100644 --- a/apps/desktop/layer/renderer/src/modules/app-layout/ai/AIChatFixedPanel.tsx +++ b/apps/desktop/layer/renderer/src/modules/app-layout/ai/AIChatFixedPanel.tsx @@ -13,6 +13,7 @@ export const AIChatFixedPanel: FC = ({ className, ...prop return ( diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/layouts/EntryItemWrapper.tsx b/apps/desktop/layer/renderer/src/modules/entry-column/layouts/EntryItemWrapper.tsx index 71dd2e0b0..1ef9da01c 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/layouts/EntryItemWrapper.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-column/layouts/EntryItemWrapper.tsx @@ -248,9 +248,9 @@ const ActionBar = ({ entryId }: { entryId: string }) => { return ( { @@ -260,7 +260,7 @@ const ActionBar = ({ entryId }: { entryId: string }) => { >
- +
) diff --git a/apps/desktop/layer/renderer/src/modules/entry-content/actions/more-actions.tsx b/apps/desktop/layer/renderer/src/modules/entry-content/actions/more-actions.tsx index 14c5c0b5f..99acbef40 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-content/actions/more-actions.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-content/actions/more-actions.tsx @@ -27,10 +27,12 @@ export const MoreActions = ({ entryId, view, compact, + hideCustomizeToolbar = false, }: { entryId: string view: FeedViewType compact?: boolean + hideCustomizeToolbar?: boolean }) => { const { moreAction } = useSortedEntryActions({ entryId, view }) @@ -56,14 +58,17 @@ export const MoreActions = ({ const runCmdFn = useRunCommandFn() const extraAction: EntryActionMenuItem[] = useMemo( - () => [ - new EntryActionMenuItem({ - id: COMMAND_ID.settings.customizeToolbar, - onClick: runCmdFn(COMMAND_ID.settings.customizeToolbar, []), - entryId, - }), - ], - [entryId, runCmdFn], + () => + !hideCustomizeToolbar + ? [ + new EntryActionMenuItem({ + id: COMMAND_ID.settings.customizeToolbar, + onClick: runCmdFn(COMMAND_ID.settings.customizeToolbar, []), + entryId, + }), + ] + : [], + [entryId, hideCustomizeToolbar, runCmdFn], ) if (availableActions.length === 0 && extraAction.length === 0) { @@ -121,7 +126,7 @@ export const MoreActions = ({ return null })} - {availableActions.length > 0 && } + {availableActions.length > 0 && extraAction.length > 0 && } {extraAction .filter((item) => item instanceof MenuItemText) .map((config) => (