Skip to content

Fix dependent tag second-level row stuck faded after selecting first-level tag#94756

Draft
MelvinBot wants to merge 1 commit into
mainfrom
claude-dependentTagRowEmptyHighlight
Draft

Fix dependent tag second-level row stuck faded after selecting first-level tag#94756
MelvinBot wants to merge 1 commit into
mainfrom
claude-dependentTagRowEmptyHighlight

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

When a dependent (multi-level) tag's first level is selected, the newly-revealed second-level tag row (e.g. Region after selecting State) appeared empty/faded on iOS and Android until the user tapped it.

Root cause: MenuItemWithTopDescription applied the entry-fade animation style only while its highlighted prop was true (outerWrapperStyle={highlighted ? highlightedOuterWrapperStyle : outerWrapperStyle}). For a freshly-revealed dependent tag row, highlighted flips true → false on the very next render — mid-animation — which detaches the animated highlight style from the native node before the fade's withTiming completes. The shared value keeps animating to 1 on the UI thread, but nothing reads it anymore, so the row freezes at a partial opacity. Web was unaffected because it re-applies the flattened style on every React commit.

Fix: Extracted the highlight into a dedicated HighlightableMenuItemWithTopDescription that owns the useAnimatedHighlightStyle hook and always applies the animated style (no longer gated on highlighted), so the style stays attached for the entire fade. When highlighted is false, the hook returns a static opacity: 1 with no pulse (initialNonRepeatableProgressValue = 1), so the always-applied style is inert for non-highlighted rows. MenuItemWithTopDescription is reverted to a plain pass-through, leaving a single highlight implementation.

Migrated the three remaining MenuItemWithTopDescription call sites that pass highlighted:

  • MoneyRequestConfirmationList/sections/TagFields.tsx (the reported bug)
  • pages/iou/SplitExpenseEditPage.tsx (same dependent-tag pattern)
  • ReportActionItem/MoneyRequestView.tsx

The WorkspaceInitialPage/DomainInitialPage call sites already use the separate HighlightableMenuItem component (which already applies its highlight style unconditionally), so they needed no change.

Fixed Issues

$ #94005
PROPOSAL: #94005 (comment)

Tests

  1. Create a workspace and enable Tags in More features.
  2. Open Tags → Import → Multi-level tags → Choose file → upload dependent tags → toggle off "Are these independent tags".
  3. Tap Next → Import → Got it.
  4. Start creating a manual expense in the workspace and enter an amount.
  5. On the confirmation page, open the first-level tag row (e.g. State) and select a value (e.g. California).
  6. Back on the Confirm details page, verify the second-level tag row (e.g. Region) is fully visible (not empty/faded) without needing to tap it.
  7. Verify the same on iOS App and Android App.
  • Verify that no errors appear in the JS console

Offline tests

Same as Tests.

QA Steps

Same as Tests.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios
    • I turned off my network connection and tested it while offline
    • I tested this PR with a High Traffic account against the staging or production API
  • I verified the PR is properly formatted

Screenshots/Videos

  • I verified that similar component doesn't exist in the codebase
  • I verified that all props are defined accurately and each prop has a /** comment above it */
  • I verified that each file is named correctly
  • I verified that each component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
  • I verified that the only data being stored in component state is data necessary for rendering and nothing else
  • In component if we are not using the full Onyx data that we loaded, I've added the proper selector in order to ensure the component only re-renders when the data it is using changes
  • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
  • I verified that component internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
  • I verified that all JSX used for rendering exists in the render method
  • I verified that each component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions

Screenshots/Videosundefined

…hlight style

Co-authored-by: Bernhard Owen Josephus <bernhardoj@users.noreply.github.com>
@MelvinBot MelvinBot requested a review from a team June 27, 2026 03:36
@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/components/MenuItemWithTopDescription.tsx 100.00% <100.00%> (ø)
...c/components/ReportActionItem/MoneyRequestView.tsx 73.28% <ø> (ø)
src/pages/iou/SplitExpenseEditPage.tsx 0.00% <ø> (ø)
...oneyRequestConfirmationList/sections/TagFields.tsx 0.00% <0.00%> (ø)
...onents/HighlightableMenuItemWithTopDescription.tsx 0.00% <0.00%> (ø)
... and 12 files with indirect coverage changes

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