Desktop: per-store ignore (hide only the App Store or Google Play side), N ignored show toggle in sidebar and portfolio, Unignore in the app controls; ignore flags sync with the shared app list

This commit is contained in:
CRTkafa 2026-10-23 01:35:27 +08:00
parent 13b91dd423
commit 9610c9477e
14 changed files with 347 additions and 17 deletions

View file

@ -5,7 +5,7 @@ import type { UnifiedApp as CoreApp } from '../../../../cli/lib/identity';
export {
buildApps, type BuildInput, NO_OVERRIDES, normId, normName, type Overrides, type Pair, pairCandidates, type Pairing, refKey, type StoreRef, storeTarget,
withIgnored, withLink, withPair, withStudio, withUnpair,
withIgnored, withLink, withPair, withSideIgnored, withStudio, withUnpair,
} from '../../../../cli/lib/identity';
export type UnifiedApp = CoreApp<Project>;

View file

@ -0,0 +1,25 @@
// "N ignored · show": whether the sidebar and the portfolio list the ignored apps (dimmed, with Restore). A per-viewer
// convenience kept in localStorage (a private window or blocked storage just means hidden), shared by every list.
import { useEffect, useState } from 'react';
const KEY = 'storebound.showIgnored';
const EVT = 'storebound:show-ignored';
export function readShowIgnored(): boolean {
try { return localStorage.getItem(KEY) === '1'; } catch { return false; }
}
export function setShowIgnored(on: boolean): void {
try { localStorage.setItem(KEY, on ? '1' : '0'); } catch { /* private mode */ }
window.dispatchEvent(new Event(EVT));
}
export function useShowIgnored(): [boolean, (on: boolean) => void] {
const [on, set] = useState(readShowIgnored);
useEffect(() => {
const f = () => set(readShowIgnored());
window.addEventListener(EVT, f);
return () => window.removeEventListener(EVT, f);
}, []);
return [on, setShowIgnored];
}