feat: Add desktop Open In button (#350)
* feat: add OpenInAppButton and macOS path opener * feat: filter installed apps on macOS and use in OpenInAppButton * feat: fetch and display macOS app icons in OpenInAppButton * feat(desktop): cache and fetch installed macOS apps * feat: add force refresh and retry for installed apps * feat(OpenInAppButton): add Copy Path action in dropdown header * feat: enhance caching mechanism for apps discovery --------- Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
committed by
GitHub
co-authored by
Bohdan Triapitsyn
parent
9534e3d016
commit
b432437b02
@@ -56,6 +56,7 @@ function App({ apis }: AppProps) {
|
||||
const refreshGitHubAuthStatus = useGitHubAuthStore((state) => state.refreshStatus);
|
||||
const [isVSCodeRuntime, setIsVSCodeRuntime] = React.useState<boolean>(() => apis.runtime.isVSCode);
|
||||
const [showCliOnboarding, setShowCliOnboarding] = React.useState(false);
|
||||
const appReadyDispatchedRef = React.useRef(false);
|
||||
|
||||
React.useEffect(() => {
|
||||
setIsVSCodeRuntime(apis.runtime.isVSCode);
|
||||
@@ -157,6 +158,15 @@ function App({ apis }: AppProps) {
|
||||
syncDirectoryAndSessions();
|
||||
}, [currentDirectory, isSwitchingDirectory, loadSessions, isConnected, isVSCodeRuntime]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (typeof window === 'undefined') return;
|
||||
if (!isInitialized || isSwitchingDirectory) return;
|
||||
if (appReadyDispatchedRef.current) return;
|
||||
appReadyDispatchedRef.current = true;
|
||||
(window as unknown as { __openchamberAppReady?: boolean }).__openchamberAppReady = true;
|
||||
window.dispatchEvent(new Event('openchamber:app-ready'));
|
||||
}, [isInitialized, isSwitchingDirectory]);
|
||||
|
||||
useEventStream();
|
||||
|
||||
// Server-authoritative session status polling
|
||||
|
||||
Reference in New Issue
Block a user