Skip to content

[menu-bar] Show minimal popover when opened via deep link#312

Open
krystofwoldrich wants to merge 5 commits intomainfrom
@krystofwoldrich/deeplink-minimal-popover
Open

[menu-bar] Show minimal popover when opened via deep link#312
krystofwoldrich wants to merge 5 commits intomainfrom
@krystofwoldrich/deeplink-minimal-popover

Conversation

@krystofwoldrich
Copy link
Copy Markdown

@krystofwoldrich krystofwoldrich commented Mar 10, 2026

Screen.Recording.2026-03-10.at.09.56.32.mov

Summary

  • When the app is opened via a browser deep link (expo-orbit://), only the builds/progress section is shown instead of the full device list, projects, and footer
  • When the user clicks the menu bar icon directly, the full UI is displayed as before
  • Handles both cold start (app launched via URL) and warm start (app already running) deep link scenarios

Implementation

  • Native side (AppDelegate.swift): emits deepLinkOpened event before opening the popover so React can distinguish deep link opens from user clicks
  • Core.tsx: tracks isDeepLinkMode state using the native event + Linking.getInitialURL() for cold starts; conditionally hides projects section and device list
  • Popover/index.tsx: hides footer in deep link mode

Test plan

  • Open app via expo-orbit:///download?url=... from browser → should show only progress bar
  • Click menu bar icon → should show full device list, projects, and footer
  • Open via deep link, then click menu bar icon while task is running → should expand to full UI
  • Cold launch app via deep link → should show minimal UI

🤖 Generated with Claude Code

krystofwoldrich and others added 4 commits March 10, 2026 09:58
…a deep link

When the app is opened via a browser deep link (expo-orbit://), only show
the builds/progress section instead of the full device list and footer.
The full menu bar is shown when the user clicks the menu bar icon directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@krystofwoldrich krystofwoldrich marked this pull request as ready for review March 10, 2026 12:10
Copy link
Copy Markdown
Member

@gabrieldonadel gabrieldonadel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @krystofwoldrich! This idea looks great. Just need to implement the equivalent on Electron as well

Comment on lines +102 to +132
// Track whether the popover was opened via a deep link (browser) or user click.
// In deep link mode, only the progress UI is shown.
const [isDeepLinkMode, setIsDeepLinkMode] = useState(false);
const deepLinkPending = useRef(false);

// Handle cold start: if app was launched via URL scheme, React wasn't mounted
// when deepLinkOpened fired, so check the initial URL instead.
useEffect(() => {
Linking.getInitialURL().then((url) => {
if (url) {
setIsDeepLinkMode(true);
}
});
}, []);

useEffect(() => {
const listener = DeviceEventEmitter.addListener('deepLinkOpened', () => {
deepLinkPending.current = true;
});
return () => listener.remove();
}, []);

// When popover is focused by user click, exit deep link mode.
// Deep link opens also trigger popoverFocused, but deepLinkPending
// distinguishes them: the native side emits deepLinkOpened before
// popoverFocused, so we check and consume the flag here.
usePopoverFocusEffect(
useCallback(() => {
if (deepLinkPending.current) {
deepLinkPending.current = false;
setIsDeepLinkMode(true);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can incorporate this logic into the useDeepLinking hook?

Co-authored-by: Gabriel Donadel Dall'Agnol <donadeldev@gmail.com>
@gabrieldonadel
Copy link
Copy Markdown
Member

Unfortunatlly this is a bit unstable in its current form
image
image

@krystofwoldrich
Copy link
Copy Markdown
Author

Let's leave it out of today release then, I can revisit it and make sure it's solid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants