Skip to content

Handle existing apps for deep links#2683

Merged
ImranR98 merged 4 commits intoImranR98:mainfrom
micahmo:feature/improve-deep-links
Jan 17, 2026
Merged

Handle existing apps for deep links#2683
ImranR98 merged 4 commits intoImranR98:mainfrom
micahmo:feature/improve-deep-links

Conversation

@micahmo
Copy link
Copy Markdown
Contributor

@micahmo micahmo commented Dec 17, 2025

This PR enhances the obtainium://add... deep linking functionality. I found that if I followed a link for an app that I already had installed, it still prompted me to add it again. This PR improves that functionality so that, if the app that the user is trying to "add" is already installed, we navigate to the existing app page instead of the add app page.

Before

qemu-system-x86_64_rMOD8QS6Vv.mp4

After

qemu-system-x86_64_SkvLsRPh7y.mp4

@ImranR98
Copy link
Copy Markdown
Owner

The current functionality seems more useful to me since the user might want to replace their existing config with the new one (I know I've done this before). But I can see how that would be confusing if it wasn't their intention. Maybe we should have a confirmation box to let the user either overwrite their current config or not.

@micahmo
Copy link
Copy Markdown
Contributor Author

micahmo commented Dec 23, 2025

The current functionality seems more useful to me since the user might want to replace their existing config with the new one

Ok fair enough, I hadn't considered that work flow!

How about we still navigate to "add" by default, but if the same app URL is already installed, we show a snackbar that tells the user and lets them navigate to the app page. If you think that approach would work I can try it out.

@ImranR98
Copy link
Copy Markdown
Owner

Oh hold on, this is about obtainium://add which just takes you to the add app page, not obtainium://app which is what I was thinking of (that imports a whole pre-built app config). Should've paid more attention. For add I think your proposal makes sense as is.

@micahmo
Copy link
Copy Markdown
Contributor Author

micahmo commented Dec 23, 2025

How about we still navigate to "add" by default, but if the same app URL is already installed, we show a snackbar that tells the user and lets them navigate to the app page.

Here's what this approach would look like, if you want to consider this instead.

main...micahmo:feature/improve-deep-links-2

qemu-system-x86_64_lSD0PpypbG.mp4

Comment thread lib/pages/apps.dart Outdated
AppsProvider appsProvider = context.read<AppsProvider>();

AppInMemory? match;
for (AppInMemory a in appsProvider.apps.values) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This would be more performant if we could reference the app ID instead of URL, then we could do so directly and not have to loop. Which is doable since we already search through these apps in home.dart:202.

Comment thread lib/pages/home.dart Outdated
.getSource(data)
.standardizeUrl(data);

bool alreadyInstalled = appsProvider.apps.values.any(
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Instead of bool alreadyInstalled, let's save the appId of the found app (if any) so that we can use it (instead of URL) to open the app page and avoid searching AppsProvider.apps twice.

@ImranR98
Copy link
Copy Markdown
Owner

@micahmo just need a couple of minor changes before I merge this.

@micahmo
Copy link
Copy Markdown
Contributor Author

micahmo commented Jan 17, 2026

Hey @ImranR98, thanks for the review! I believe I addressed your comments in the way you were asking. Let me know!

@ImranR98 ImranR98 merged commit 3bfb393 into ImranR98:main Jan 17, 2026
@ImranR98
Copy link
Copy Markdown
Owner

Thanks, works well! Merged.

@micahmo micahmo deleted the feature/improve-deep-links branch January 17, 2026 03:27
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