[PR #5393] [MERGED] Replace toObjectRoute with custom ParcelableRouteSerializer #5729

Closed
opened 2025-11-27 00:13:20 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/5393
Author: @david-livefront
Created: 6/19/2025
Status: Merged
Merged: 6/23/2025
Merged by: @david-livefront

Base: mainHead: replace-to-object-route


📝 Commits (1)

  • 000a991 Replace toObjectRoute with custom ParcelableRouteSerializer

📊 Changes

9 files changed (+372 additions, -103 deletions)

View changed files

📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupAutoFillNavigation.kt (+28 -9)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupUnlockNavigation.kt (+28 -9)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/auth/feature/vaultunlock/VaultUnlockNavigation.kt (+28 -10)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/SettingsNavigation.kt (+28 -11)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/other/OtherNavigation.kt (+28 -10)
app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/util/SavedStateHandleExtensions.kt (+0 -25)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/tools/feature/generator/GeneratorNavigation.kt (+35 -18)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingNavigation.kt (+38 -11)
ui/src/main/kotlin/com/bitwarden/ui/platform/util/ParcelableRouteSerializer.kt (+159 -0)

📄 Description

🎟️ Tracking

N/A

📔 Objective

This PR is replaces the toObjectRoute function with a custom ParcelableRouteSerializer KSerializer in order to make parsing sealed routes much easier. An additional benefit is that we can more easily pass around parcelables to destinations without dealing with custom NavTypes.

Ideally the Navigation component would support this form of navigation internally but as of right now they do not. More information about this can be found here.

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/5393 **Author:** [@david-livefront](https://github.com/david-livefront) **Created:** 6/19/2025 **Status:** ✅ Merged **Merged:** 6/23/2025 **Merged by:** [@david-livefront](https://github.com/david-livefront) **Base:** `main` ← **Head:** `replace-to-object-route` --- ### 📝 Commits (1) - [`000a991`](https://github.com/bitwarden/android/commit/000a991ec859f720618fbb38d362df5088124874) Replace toObjectRoute with custom ParcelableRouteSerializer ### 📊 Changes **9 files changed** (+372 additions, -103 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupAutoFillNavigation.kt` (+28 -9) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupUnlockNavigation.kt` (+28 -9) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/auth/feature/vaultunlock/VaultUnlockNavigation.kt` (+28 -10) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/SettingsNavigation.kt` (+28 -11) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/other/OtherNavigation.kt` (+28 -10) ➖ `app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/util/SavedStateHandleExtensions.kt` (+0 -25) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/tools/feature/generator/GeneratorNavigation.kt` (+35 -18) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingNavigation.kt` (+38 -11) ➕ `ui/src/main/kotlin/com/bitwarden/ui/platform/util/ParcelableRouteSerializer.kt` (+159 -0) </details> ### 📄 Description ## 🎟️ Tracking N/A ## 📔 Objective This PR is replaces the `toObjectRoute` function with a custom `ParcelableRouteSerializer` `KSerializer` in order to make parsing sealed routes much easier. An additional benefit is that we can more easily pass around parcelables to destinations without dealing with custom NavTypes. Ideally the Navigation component would support this form of navigation internally but as of right now they do not. More information about this can be found [here](https://issuetracker.google.com/issues/415834969). ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-27 00:13:20 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#5729