[PR #4766] [MERGED] [PM-18067] Consolidate item name fields into ItemHeader #5195

Closed
opened 2025-11-26 23:55:22 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/4766
Author: @SaintPatrck
Created: 2/21/2025
Status: Merged
Merged: 2/27/2025
Merged by: @SaintPatrck

Base: mainHead: PM-18067/view-item-favicon


📝 Commits (10+)

  • 7804d84 [PM-18067] Consolidate item name fields into ItemHeader
  • 60da236 Add illustration colors
  • 537e743 Replaced standardHorizontalMargin with explicit horizontal padding
  • 9e920f1 Refactor ItemHeader to use cardStyle and remove custom card styling.
  • 0cc7067 Add divider to ItemHeader in vault item view
  • 7073124 Make cardStyle parameter optional in BitwardenTextField
  • 6953d5e Migrate VaultItem related locations to ImmutableList
  • 78d5965 Refactor ItemHeader to use LazyColumn for overflow locations
  • 6da8e2c Adjust height of Spacer in BitwardenTextField based on cardStyle presence
  • aba8344 Revert unintentional change

📊 Changes

24 files changed (+1771 additions, -340 deletions)

View changed files

📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/components/field/BitwardenTextField.kt (+3 -3)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/components/header/BitwardenExpandingHeader.kt (+57 -19)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/theme/color/BitwardenColorScheme.kt (+10 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/theme/color/ColorScheme.kt (+12 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/theme/shape/BitwardenShapes.kt (+1 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/theme/shape/Shapes.kt (+1 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemCardContent.kt (+64 -35)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemIdentityContent.kt (+75 -42)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemLoginContent.kt (+77 -57)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemSecureNoteContent.kt (+45 -25)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemSshKeyContent.kt (+52 -42)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModel.kt (+83 -13)
app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/component/ItemHeader.kt (+402 -0)
app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/component/ItemNameField.kt (+0 -49)
app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/model/VaultItemLocation.kt (+59 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/model/VaultItemStateData.kt (+3 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/util/CipherViewExtensions.kt (+42 -0)
app/src/main/res/drawable/ic_organization.xml (+28 -0)
📝 app/src/main/res/values/strings.xml (+3 -0)
📝 app/src/test/java/com/x8bit/bitwarden/data/vault/datasource/sdk/model/CipherViewUtil.kt (+2 -1)

...and 4 more files

📄 Description

🎟️ Tracking

PM-18067

📔 Objective

This commit introduces ItemHeader, a new composable that replaces ItemNameField to display the item name, favorite status, and related details like organization, collections, and folder.

Key changes:

  • Removes ItemNameField
  • Adds ItemHeader for displaying item name and favorite status, along with item location information.
  • Introduces a new ic_organization icon.
  • Adds the logic for showing item locations (organization, collections, folders) in a collapsible view.
  • Removes ItemNameField from VaultItemLoginContent, VaultItemIdentityContent, VaultItemSecureNoteContent, VaultItemCardContent, VaultItemSshKeyContent and replace it with ItemHeader
  • Adds the logic to fetch and display the item icon in ItemHeader based on item type
  • Adds an ItemLocationListItem for displaying location details.
  • Adds a VaultItemLocation data class for representing item locations.
  • Adds new baseIconUrl and isIconLoadingDisabled variables to the VaultItemState to handle icon display.
  • Updates CipherView.toIconData to handle the item icon.
  • Adds new show_more, no_folder and show_less string resources.
  • Updates the BitwardenShapes to include favicon shapes.
  • Updates the BitwardenColorScheme to include faviconForeground and faviconBackground.
  • Updates BitwardenExpandingHeader to include expandedText, collapsedText and showExpansionIndicator properties.

📸 Screenshots

Card - No Icon - No Locations
Card - No Icon - No Locations

Card - No Icon - Org & Collection
Card - No Icon - Org & Collection

Login - Icon - Org/Collections/Folders - Expanded
Login - Icon - Org/Collections/Folders - Expanded

Login - Icon - Org/Collections/Folders - Collapsed
Screenshot 2025-02-27 at 12 01 47 PM

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation 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/4766 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 2/21/2025 **Status:** ✅ Merged **Merged:** 2/27/2025 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `main` ← **Head:** `PM-18067/view-item-favicon` --- ### 📝 Commits (10+) - [`7804d84`](https://github.com/bitwarden/android/commit/7804d8430f8058651b08abb53f399cde4a57ac4e) [PM-18067] Consolidate item name fields into `ItemHeader` - [`60da236`](https://github.com/bitwarden/android/commit/60da236f3e405479c72bd983f2d413b3b05d8d3b) Add `illustration` colors - [`537e743`](https://github.com/bitwarden/android/commit/537e74389188f870566441427431017dcd1005a5) Replaced `standardHorizontalMargin` with explicit horizontal padding - [`9e920f1`](https://github.com/bitwarden/android/commit/9e920f1cf5f6a59f8b890e449f1599271a28c2f3) Refactor `ItemHeader` to use `cardStyle` and remove custom card styling. - [`0cc7067`](https://github.com/bitwarden/android/commit/0cc7067808c1bb362d7ac204836b5c820801636a) Add divider to ItemHeader in vault item view - [`7073124`](https://github.com/bitwarden/android/commit/707312449554a9543887267eec8a48580104c6ef) Make `cardStyle` parameter optional in `BitwardenTextField` - [`6953d5e`](https://github.com/bitwarden/android/commit/6953d5e132eec448f64a71f4e5ce19e9ccdfad4b) Migrate VaultItem related locations to ImmutableList - [`78d5965`](https://github.com/bitwarden/android/commit/78d59652715261c036d5b802ee4ec2bd8d93fb12) Refactor `ItemHeader` to use `LazyColumn` for overflow locations - [`6da8e2c`](https://github.com/bitwarden/android/commit/6da8e2c47be4469bda1a2fc220bb463884b8a167) Adjust height of Spacer in `BitwardenTextField` based on `cardStyle` presence - [`aba8344`](https://github.com/bitwarden/android/commit/aba8344df105f2d67bc243b01f235d9a67a8c323) Revert unintentional change ### 📊 Changes **24 files changed** (+1771 additions, -340 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/components/field/BitwardenTextField.kt` (+3 -3) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/components/header/BitwardenExpandingHeader.kt` (+57 -19) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/theme/color/BitwardenColorScheme.kt` (+10 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/theme/color/ColorScheme.kt` (+12 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/theme/shape/BitwardenShapes.kt` (+1 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/theme/shape/Shapes.kt` (+1 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemCardContent.kt` (+64 -35) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemIdentityContent.kt` (+75 -42) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemLoginContent.kt` (+77 -57) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemSecureNoteContent.kt` (+45 -25) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemSshKeyContent.kt` (+52 -42) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModel.kt` (+83 -13) ➕ `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/component/ItemHeader.kt` (+402 -0) ➖ `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/component/ItemNameField.kt` (+0 -49) ➕ `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/model/VaultItemLocation.kt` (+59 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/model/VaultItemStateData.kt` (+3 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/util/CipherViewExtensions.kt` (+42 -0) ➕ `app/src/main/res/drawable/ic_organization.xml` (+28 -0) 📝 `app/src/main/res/values/strings.xml` (+3 -0) 📝 `app/src/test/java/com/x8bit/bitwarden/data/vault/datasource/sdk/model/CipherViewUtil.kt` (+2 -1) _...and 4 more files_ </details> ### 📄 Description ## 🎟️ Tracking PM-18067 ## 📔 Objective This commit introduces `ItemHeader`, a new composable that replaces `ItemNameField` to display the item name, favorite status, and related details like organization, collections, and folder. Key changes: - Removes `ItemNameField` - Adds `ItemHeader` for displaying item name and favorite status, along with item location information. - Introduces a new `ic_organization` icon. - Adds the logic for showing item locations (organization, collections, folders) in a collapsible view. - Removes `ItemNameField` from `VaultItemLoginContent`, `VaultItemIdentityContent`, `VaultItemSecureNoteContent`, `VaultItemCardContent`, `VaultItemSshKeyContent` and replace it with `ItemHeader` - Adds the logic to fetch and display the item icon in `ItemHeader` based on item type - Adds an `ItemLocationListItem` for displaying location details. - Adds a `VaultItemLocation` data class for representing item locations. - Adds new `baseIconUrl` and `isIconLoadingDisabled` variables to the `VaultItemState` to handle icon display. - Updates `CipherView.toIconData` to handle the item icon. - Adds new `show_more`, `no_folder` and `show_less` string resources. - Updates the `BitwardenShapes` to include `favicon` shapes. - Updates the `BitwardenColorScheme` to include `faviconForeground` and `faviconBackground`. - Updates `BitwardenExpandingHeader` to include expandedText, collapsedText and showExpansionIndicator properties. ## 📸 Screenshots Card - No Icon - No Locations <img width="365" alt="Card - No Icon - No Locations" src="https://github.com/user-attachments/assets/9759f519-fe6e-4f60-a1b7-100b37dc8a20" /> Card - No Icon - Org & Collection <img width="365" alt="Card - No Icon - Org & Collection" src="https://github.com/user-attachments/assets/3e57312a-da80-4e9b-90e9-798a7750998f" /> Login - Icon - Org/Collections/Folders - Expanded <img width="365" alt="Login - Icon - Org/Collections/Folders - Expanded" src="https://github.com/user-attachments/assets/9421017a-4925-4a13-9b2a-0f98602373bf" /> Login - Icon - Org/Collections/Folders - Collapsed <img width="375" alt="Screenshot 2025-02-27 at 12 01 47 PM" src="https://github.com/user-attachments/assets/80c6e796-54b6-4908-8b7d-d8134cd19f01" /> ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation 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-26 23:55:22 -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#5195