Skip to content

feat: Add all deeplinks#1935

Open
benjaminVadon wants to merge 71 commits intomainfrom
add-all-deeplinks
Open

feat: Add all deeplinks#1935
benjaminVadon wants to merge 71 commits intomainfrom
add-all-deeplinks

Conversation

@benjaminVadon
Copy link
Copy Markdown
Contributor

@benjaminVadon benjaminVadon commented Feb 3, 2026

Manage all deeplink (see DeeplinkParserTest to find all)
Entry point for deeplink parsing is DeeplinkType and more precisely DeeplinkAction for all parsable deeplinks

Depends on #1936
Depends on Infomaniak/android-core#724

@benjaminVadon benjaminVadon self-assigned this Feb 3, 2026
@benjaminVadon benjaminVadon changed the base branch from main to refactor-special-folders February 4, 2026 06:50
@benjaminVadon benjaminVadon changed the title Add all deeplinks feat: Add all deeplinks Feb 4, 2026
@benjaminVadon benjaminVadon marked this pull request as ready for review February 4, 2026 09:35
@github-actions github-actions Bot added the dependent This MR depends on another PR label Feb 4, 2026
@benjaminVadon benjaminVadon added the enhancement New feature or request label Feb 4, 2026
@benjaminVadon benjaminVadon force-pushed the add-all-deeplinks branch 3 times, most recently from 597c20e to 8bbe633 Compare February 6, 2026 06:10
@benjaminVadon benjaminVadon force-pushed the refactor-special-folders branch from 30d7ee0 to b0da743 Compare February 6, 2026 11:35
Base automatically changed from refactor-special-folders to main February 6, 2026 11:40
@github-actions github-actions Bot removed the dependent This MR depends on another PR label Feb 6, 2026
@sirambd sirambd requested a review from Copilot March 9, 2026 09:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a structured deeplink parsing system (new DeeplinkType/DeeplinkAction model + parser) and wires it into app launch + in-app navigation so the app can open the appropriate screen (and optionally preview a file) for supported kDrive/ksuite URLs.

Changes:

  • Introduce a new deeplink model hierarchy (DeeplinkType, DeeplinkAction, RoleFolder, FileType, ExternalFileType) and parsing pipeline (DeeplinkParser).
  • Update LaunchActivity/MainActivity/RootFilesFragment to route deeplinks through the new model and navigate to the correct destination.
  • Extend Navigation safe-args and fragments to support previewing specific files via new arguments (previewFileId, fileType, externalFileType) and add parser unit tests.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
app/src/test/kotlin/com/infomaniak/drive/data/models/deeplink/DeeplinkParserTest.kt Adds unit tests enumerating supported deeplink formats.
app/src/main/res/navigation/select_folder_navigation.xml Adds args for preview/external deeplink routing in select-folder flows.
app/src/main/res/navigation/main_navigation.xml Adds/renames args for deeplink routing (deeplinkType, fileType, previewFileId, externalFileType).
app/src/main/java/com/infomaniak/drive/ui/menu/SharedWithMeFragment.kt Adds deeplink handling to open/preview the targeted shared-with-me item.
app/src/main/java/com/infomaniak/drive/ui/menu/RecentChangesFragment.kt Reads new previewFileId arg to support direct preview.
app/src/main/java/com/infomaniak/drive/ui/menu/MySharesFragment.kt Reads new previewFileId arg to support direct preview.
app/src/main/java/com/infomaniak/drive/ui/home/RootFilesFragment.kt Observes deeplink navigation events and maps DeeplinkAction.Drive to NavDirections.
app/src/main/java/com/infomaniak/drive/ui/fileList/FileListFragment.kt Adds fileType arg support and file preview-on-entry behavior.
app/src/main/java/com/infomaniak/drive/ui/fileList/FavoritesFragment.kt Reads new previewFileId arg to support direct preview.
app/src/main/java/com/infomaniak/drive/ui/MainViewModel.kt Adds a navigateDeeplink StateFlow for deeplink-driven navigation.
app/src/main/java/com/infomaniak/drive/ui/MainActivity.kt Replaces old deeplink handling with new DeeplinkType routing.
app/src/main/java/com/infomaniak/drive/ui/LaunchArgsType.kt Introduces a unified discriminator for launch sources (notification/shortcut/deeplink).
app/src/main/java/com/infomaniak/drive/ui/LaunchActivity.kt Reworks launch routing to produce DeeplinkType and pass it to MainActivity (or browser).
app/src/main/java/com/infomaniak/drive/ui/DeeplinkParser.kt Adds parsing entrypoint from URL/path string to DeeplinkType.
app/src/main/java/com/infomaniak/drive/data/models/file/SpecialFolder.kt Refactors SpecialFolder to be Parcelable and exposes id/name directly.
app/src/main/java/com/infomaniak/drive/data/models/deeplink/RoleFolder.kt Defines role folder targets for “drive” deeplinks.
app/src/main/java/com/infomaniak/drive/data/models/deeplink/MatchResultExt.kt Adds match parsing helpers (parseId, parseOptionalId) for deeplink regex extraction.
app/src/main/java/com/infomaniak/drive/data/models/deeplink/InvalidValue.kt Adds an internal exception type for invalid deeplink parsing.
app/src/main/java/com/infomaniak/drive/data/models/deeplink/FolderType.kt Maps role folder strings to RoleFolder construction rules.
app/src/main/java/com/infomaniak/drive/data/models/deeplink/FileType.kt Adds file/folder path parsing types for drive/files deeplinks.
app/src/main/java/com/infomaniak/drive/data/models/deeplink/ExternalFileType.kt Adds parsing types for shared-with-me deeplinks.
app/src/main/java/com/infomaniak/drive/data/models/deeplink/DeeplinkType.kt Defines base DeeplinkType and intent “addTo” helper.
app/src/main/java/com/infomaniak/drive/data/models/deeplink/DeeplinkRegexAlias.kt Centralizes regex fragments for deeplink parsing.
app/src/main/java/com/infomaniak/drive/data/models/deeplink/DeeplinkAction.kt Defines supported deeplink actions (drive/office/collaborate).
app/src/main/java/com/infomaniak/drive/data/models/deeplink/ActionType.kt Maps top-level action type (“drive/office/collaborate”) to parsing/build logic.
app/src/main/AndroidManifest.xml Broadens intent-filter patterns to cover all supported deeplink paths and hosts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/main/java/com/infomaniak/drive/ui/home/RootFilesFragment.kt
Comment thread app/src/main/java/com/infomaniak/drive/ui/MainActivity.kt Outdated
Comment thread app/src/main/java/com/infomaniak/drive/ui/LaunchActivity.kt Outdated
Comment thread app/src/main/java/com/infomaniak/drive/ui/DeeplinkParser.kt Outdated
Comment thread app/src/main/java/com/infomaniak/drive/ui/fileList/FileListFragment.kt Outdated
Comment thread app/src/main/java/com/infomaniak/drive/data/models/deeplink/FolderType.kt Outdated
@github-actions
Copy link
Copy Markdown
Contributor

This review introduces a comprehensive refactoring of the deeplink handling system, replacing fragile string parsing with a type-safe architecture using sealed interfaces and enums. The implementation is well-structured with clear separation of concerns, extensive regex pattern definitions, and good test coverage for various deeplink scenarios. Key concerns include the use of previewManaged state flags in fragments to prevent re-processing, which may be fragile across configuration changes, and the reliance on specific regex group indices that could break if patterns are modified. Additionally, ensure the @IgnoredOnParcel annotation on the lazy file property in SpecialFolder doesn't cause serialization issues.

#ai-review-summary

Comment thread app/src/main/java/com/infomaniak/drive/ui/MainActivity.kt Outdated
Comment thread app/src/main/java/com/infomaniak/drive/ui/MainActivity.kt
Comment thread app/src/main/java/com/infomaniak/drive/ui/MainActivity.kt Outdated
Comment thread app/src/main/java/com/infomaniak/drive/ui/MainActivity.kt Outdated
Comment thread app/src/main/java/com/infomaniak/drive/ui/LaunchActivity.kt Outdated
Comment thread app/src/main/java/com/infomaniak/drive/ui/menu/RecentChangesFragment.kt Outdated
Comment thread app/src/main/java/com/infomaniak/drive/ui/menu/SharedWithMeFragment.kt Outdated
Comment thread app/src/main/java/com/infomaniak/drive/ui/menu/SharedWithMeFragment.kt Outdated
Comment thread app/src/main/java/com/infomaniak/drive/ui/DeeplinkParser.kt Outdated
@github-actions github-actions Bot added the dependent This MR depends on another PR label Mar 17, 2026
@benjaminVadon benjaminVadon force-pushed the add-all-deeplinks branch 3 times, most recently from 6612158 to ffd1204 Compare March 18, 2026 11:38
Comment thread app/src/main/java/com/infomaniak/drive/data/models/deeplink/ExternalFileType.kt Outdated
Comment thread app/src/main/java/com/infomaniak/drive/data/models/deeplink/ExternalFileType.kt Outdated
Comment thread app/src/main/java/com/infomaniak/drive/data/models/deeplink/ExternalFileType.kt Outdated
Comment thread app/src/main/java/com/infomaniak/drive/data/models/deeplink/ExternalFileType.kt Outdated
Comment thread app/src/main/java/com/infomaniak/drive/ui/MainActivity.kt Outdated
…known) and open them in webview

# Conflicts:
#	app/src/main/java/com/infomaniak/drive/ui/MainActivity.kt
…s url

# Conflicts:
#	Core

# Conflicts:
#	Core
…enting magic number and more evolution proof
@sonarqubecloud
Copy link
Copy Markdown

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

Labels

enhancement New feature or request Review effort 4/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants