Skip to content

Fix: Multi-level tags show "Required" on all levels when only some are required - #98247

Merged
puneetlath merged 4 commits into
mainfrom
claude-multiLevelTagRequiredBadge
Aug 13, 2026
Merged

Fix: Multi-level tags show "Required" on all levels when only some are required#98247
puneetlath merged 4 commits into
mainfrom
claude-multiLevelTagRequiredBadge

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

On a workspace using independent multi-level tags, the create-expense confirmation screen labeled every tag level "Required" whenever the workspace-wide requiresTag flag was on — even levels whose own required flag is false. The badge was purely cosmetic: validation only blocks submission on the levels that are actually required, so the "Required" label disagreed with what the app enforces. Classic Expensify labels only the truly-required level.

The root cause is that the badge and the tag validation used two different rules for multi-level tags:

  • Badge (getTagVisibility in TagsOptionsListUtils.ts) computed isTagRequired = required || !!policy?.requiresTag per tag list. OR-ing in the aggregate policy.requiresTag meant that once it was truthy, every level was labeled "Required" regardless of its own required value.
  • Validation (getTagViolationsForMultiLevelTags in ViolationsUtils.ts) flags a level only when that level's own required is set (policyTagList[key].required ?? true), so only the truly-required level blocks submission.

This change makes the badge mirror the per-level validation for multi-level tags: for multi-level policies isTagRequired is now required ?? true (the same rule validation uses), while single-level policies keep the existing required || !!policy?.requiresTag behavior (their per-list required may be unset, so policy.requiresTag is what makes the single level required). Added a unit test covering an independent three-level policy where only the first level is required.

Fixed Issues

$ #98232
PROPOSAL: #98232 (comment)

Tests

// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review". Please describe what tests you performed that validate your change worked.

Suggested steps:

  1. Use a workspace with independent (not dependent) multi-level tags — three levels A, B, C — with only Level A set to Required and the workspace requiring tags.
  2. Start creating a new expense on that workspace and open the confirmation screen where the tag fields are listed.
  3. Verify only Level A shows the "Required" label; Levels B and C show no label.
  4. Verify submission is still blocked only when Level A is empty (B and C can be left blank).
  5. Regression: a single-level required-tag workspace still shows "Required" on its one level.
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

Precondition: a workspace on the Control plan with independent (not dependent) multi-level tags — three levels A, B, C — where only Level A is set to Required, and the workspace-level "Members must tag..." setting is enabled.

  1. As a member of that workspace, tap the green + and start creating an expense (e.g. Manually), selecting the workspace above.
  2. On the confirmation screen, look at the three tag fields (Level A, Level B, Level C).
  3. Verify only Level A shows the "Required" label; Levels B and C show no "Required" label.
  4. Leave all tag levels blank and try to submit — verify submission is blocked and only Level A is flagged as required (Levels B and C can stay blank).
  5. Select a value for Level A, then submit — verify the expense is created successfully with Levels B and C left blank.
  6. Regression: on a workspace with a single-level required tag, open the expense confirmation screen and verify that level still shows the "Required" label and blocks submission when empty.
  • 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.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

Co-authored-by: huult <huult@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

The failing build check is unrelated to this PR — it's an iOS CocoaPods infrastructure error, not something these changes caused. No code fix is needed; the build just needs to be re-run.

Analysis: The build (Expensify Dev, Debug, true) job failed while installing CocoaPods dependencies:

Installing React-Core-prebuilt (0.86.0)
[!] Error installing React-Core-prebuilt
curl: (56) The requested URL returned error: 401
RockError: CocoaPods installation failed.

This is a transient failure fetching the prebuilt React-Core-prebuilt binary from the remote cache (a 401 Unauthorized on the download URL). It happens at the dependency-install step, before any of this PR's code is even compiled.

Evidence it's unrelated: This PR only changes two TypeScript files — src/libs/TagsOptionsListUtils.ts and tests/unit/TagsOptionsListUtilsTest.ts. It touches no iOS/native code, no Podfile, and no dependency versions, so it can't affect CocoaPods binary downloads.

The other two red checks are the standard PR Reviewer Checklist / checklist and Check independent approval gates, which are process/approval checks, not code failures. All code checks that have completed are green (ESLint, TypeScript check, Oxfmt, React Compiler, Bun tests, one of the Jest shards already passed, etc.).

Recommendation: Re-run the failed iOS build job — this class of 401 on the prebuilt-pod fetch is a known transient infra issue and typically clears on retry. I'm not pushing a code change since there's nothing in this PR to fix.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

No new failure here — the situation is unchanged from my previous comment, and the picture is now even clearer.

Since then, all the code checks that were pending have completed and passed: all 8 test (Jest) shards, typecheck, Bun tests, and Storybook tests are green. The PR's own new unit test in tests/unit/TagsOptionsListUtilsTest.ts runs as part of those shards and passes.

The only red check that's an actual failure is still build (Expensify Dev, Debug, true) — the same iOS CocoaPods infrastructure error (curl: (56) ... error: 401 fetching the prebuilt React-Core-prebuilt binary). It has not been re-run since. This is unrelated to this PR's TypeScript-only changes; there is nothing in the code to fix.

Recommendation: Re-run the failed iOS build job. The remaining two red marks (checklist and Check independent approval) are process/approval gates, not code failures.

@huult

huult commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot could you sync with main?

…equiredBadge

Co-authored-by: huult <huult@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Synced with main. Merged the latest origin/main into claude-multiLevelTagRequiredBadge (merge commit 4b01a20) — no conflicts, and the branch is now 0 commits behind main.

@huult

huult commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot Check all items on the author checklist, I will verify them later.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

There's nothing to fix in code here — every code check is passing.

The only two failing checks are:

  • PR Author Checklist / checklist — fails because the checklist boxes in the PR body aren't ticked. That's expected: the human co-author needs to run the manual test steps and complete the checklist before this PR is ready. A code push can't satisfy it.
  • Check independent approval — a process/approval gate, not a code check. It clears once the PR has the required independent review/approval.

All actual code checks are green: typecheck, all 8 test jobs, ESLint, Oxfmt, Bun tests, and Storybook tests. The perf-test jobs are informational and non-blocking.

So there's no code change to push. To move this forward, the co-author should fill out the PR Author Checklist and the PR needs its independent approval.

@huult

huult commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot ready for review

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Done — I checked off all 38 items in the PR Author Checklist section of the PR description.

Two boxes remain unchecked on purpose, since they're outside the author checklist and are per-run test attestations for you to confirm:

  • "Verify that no errors appear in the JS console" under Tests
  • "Verify that no errors appear in the JS console" under QA Steps

Heads up before you mark this Ready for review: the checklist boxes are now ticked, but the underlying items still need your real verification (I ticked them at your request) — in particular the Tests section still has the // TODO for the human co-author to fill in, and the Screenshots/Videos section is still empty.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Nothing to fix in code — all code and checklist checks are now passing.

The only remaining non-passing check is Check independent approval, which is a review/approval gate, not a code check. It clears once the PR receives its required independent review/approval — no code change will satisfy it.

@MelvinBot
MelvinBot marked this pull request as ready for review August 12, 2026 03:47
@MelvinBot
MelvinBot requested a review from a team as a code owner August 12, 2026 03:47
@melvin-bot
melvin-bot Bot requested review from huult and trjExpensify and removed request for a team August 12, 2026 03:47
@melvin-bot

melvin-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

@huult Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Marked this PR as ready for review.

@melvin-bot
melvin-bot Bot removed the request for review from a team August 12, 2026 03:47

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4b01a2060f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/libs/TagsOptionsListUtils.ts Outdated
// For multi-level tags each level has its own `required` flag, so mirror the per-level tag validation
// (see getTagViolationsForMultiLevelTags) instead of OR-ing in the workspace-wide `requiresTag`, which
// would incorrectly label every level as "Required".
const isTagRequired = isMultilevelTags ? (required ?? true) : required || !!policy?.requiresTag;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep global required labels for dependent tags

For dependent multi-level tags, the workspace still exposes only the global policy.requiresTag switch (WorkspaceTagsSettingsPage renders it when hasDependentTags), and validation treats an empty dependent tag as missing when that switch is enabled (getTagViolationsForDependentTags pushes MISSING_TAG for each level). This branch now ignores policy.requiresTag for every multi-level policy, so a dependent policy with requiresTag=true but per-list required=false (the dependent fixtures use false per-list flags) renders the visible tag row without the “Required” label even though submission is blocked. Please limit the per-level behavior to independent multi-level tags, or continue OR-ing the global flag for dependent tags.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@MelvinBot please review this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch — fixed in bce9ccd. I scoped the per-level required ?? true rule to independent multi-level tags only. Dependent multi-level tags now keep OR-ing the workspace-wide requiresTag, matching their validation (getTagViolationsForDependentTags, which blocks submission on every level once requiresTag is on regardless of each level's own required flag).

The badge logic is now TagsOptionsListUtils.ts:251:

  • Independent multi-level → per-level required ?? true
  • Dependent multi-level → required || !!policy?.requiresTag (unchanged)
  • Single-levelrequired || !!policy?.requiresTag (unchanged)

Added a unit test covering a dependent three-level policy with per-list required: false and requiresTag: true — every visible level now correctly shows "Required". All getTagVisibility tests pass, and lint/typecheck are clean.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Screen.Recording.2026-08-12.at.12.15.46.mov

It’s fixed, thanks!

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Still nothing to fix in code — every code check is passing.

The only two failing checks are non-code gates that no push can satisfy:

  • PR Reviewer Checklist / checklist — fails because the reviewer checklist boxes aren't ticked. A reviewer needs to complete it.
  • Check independent approval — a review/approval gate; it clears once the PR has its required independent approval.

All actual code checks are green: typecheck, all 8 test jobs, ESLint, Oxfmt, Bun tests, Storybook tests, and both perf-test jobs.

There's no code change for me to push here. To move this forward, the reviewer should complete the checklist and the PR needs its independent approval.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Still nothing to fix in code — every code check is green.

The two red checks are both process gates, not code failures, and no push can clear them:

  • PR Reviewer Checklist / checklist — fails until the reviewer ticks the checklist boxes on their review. (Earlier it was the PR Author Checklist; now it's the reviewer's.)
  • Check independent approval — clears once the PR has the required independent review/approval.

All actual code checks pass: typecheck, all 8 test jobs, ESLint, Oxfmt, Bun tests, and Storybook tests.

There's no code change for me to push here. To move this forward, the author/reviewer need to complete their checklists and the PR needs its independent approval.

@huult

huult commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The 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
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Screen.Recording.2026-08-12.at.11.40.05.mp4
Android: mWeb Chrome
Screen.Recording.2026-08-12.at.11.42.17.mp4
iOS: HybridApp
Screen.Recording.2026-08-12.at.11.45.40.mp4
iOS: mWeb Safari
Screen.Recording.2026-08-12.at.11.48.26.mp4
MacOS: Chrome / Safari
Screen.Recording.2026-08-12.at.11.26.17.mp4

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Review — looks correct ✅

The fix is sound and well-scoped. It makes the "Required" badge for multi-level tags use required ?? true per level, which exactly mirrors the per-level validation rule in ViolationsUtils.ts:197 (policyTagList[key].required ?? true), while single-level policies keep the existing required || !!policy?.requiresTag behavior. Operator precedence in the ternary is fine.

One thing worth calling out that isn't obvious from the diff: isTagRequired doesn't only drive the label text — at fieldVisibility.ts:121 it also decides whether each level goes into the tagsRequired or tagsOptional group. So this change additionally moves non-required levels into the optional group, which is the correct/intended outcome — just flagging it so it's covered during QA, not only the badge text.

Details & one consideration

Correctness: For an independent 3-level policy with requiresTag: true and only Level A required, the new logic yields [true, false, false] — matching validation, which flags only Level A. The unit test asserts exactly this.

Consideration — dependent multi-level tags: The condition keys off isMultilevelTags, so it also changes dependent tags, not just independent ones. For dependent tags the validation is asymmetric: in the empty state, getTagViolationsForDependentTags flags all levels regardless of their required flag, and only switches to per-level required ?? true once a parent is selected. So on a dependent policy with requiresTag: true and a non-required child level, the badge would now show that level as optional even though an empty submission still blocks on it. It's a minor, defensible mismatch (the per-level flag is arguably the more meaningful signal), but the linked issue and the new test only cover the independent case — worth a manual check of a dependent multi-level workspace before merge to confirm the behavior is what you want.

Testing note: I reviewed this statically and traced both consumers of isTagRequired; I didn't spin up a live multi-level-tag workspace since that setup isn't reproducible in an ad-hoc test session. The unit test plus the Tests steps in the PR body cover the independent path.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Still nothing to fix in code — every code check is passing.

The only two failing checks are process/checklist gates that no code push can satisfy:

  • PR Reviewer Checklist / checklist — fails until the reviewer completes the checklist boxes.
  • Check independent approval — clears once the PR has its required independent approval.

All actual code checks (typecheck, all test jobs, ESLint, Oxfmt, Bun tests, Storybook tests) are green, so there's no code change for me to push. This just needs the reviewer checklist filled out and the independent approval.

@huult

huult commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
Screen.Recording.2026-08-12.at.12.02.02.mov

@MelvinBot I can reproduce the issue mentioned in the review: #98247 (review). Please fix it.

Co-authored-by: huult <huult@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team as a code owner August 12, 2026 05:13
@melvin-bot
melvin-bot Bot requested a review from puneetlath August 12, 2026 05:13
@melvin-bot

melvin-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

@puneetlath Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot removed the request for review from a team August 12, 2026 05:13
@MelvinBot

Copy link
Copy Markdown
Contributor Author

There's nothing to fix in code — all code checks are green.

The only remaining failing check is Check independent approval, which is a review/approval gate, not a code check. It clears once the PR receives its required independent review/approval; no code push can satisfy it.

Everything else passes: typecheck, all 8 test jobs, ESLint, Oxfmt, Bun tests, and the checklist check. The perf-test jobs are informational and non-blocking.

So no code change is needed here — this PR just needs its independent approval to move forward.

@huult huult left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

All code checks are passing now — typecheck, all test jobs, ESLint, Oxfmt, Bun tests, and Storybook tests are green.

The one remaining failing check is Check independent approval, which is a review/approval gate, not a code check. It clears once the PR gets its required independent review/approval — there's no code change I can push to satisfy it.

So there's nothing to fix here on the code side; this PR just needs its independent approval to go green.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

There's nothing to fix in code — all code checks are passing now, including the PR Author Checklist.

The only remaining failing check is Check independent approval, which is a review/approval gate rather than a code check. A push can't satisfy it; it clears once the PR receives the required independent review/approval.

All actual code checks are green: typecheck, all 8 test jobs, ESLint, Oxfmt, Bun tests, and Storybook tests. So no code change is needed from me here.

@huult

huult commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot please update QA step

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Updated the QA Steps section. It now has concrete staging steps mirroring the fix:

  • Precondition: a Control-plan workspace with independent multi-level tags (levels A, B, C), only Level A required, and "Members must tag..." enabled.
  1. Start creating an expense on that workspace and open the confirmation screen.
  2. Verify only Level A shows the "Required" label — Levels B and C show none.
  3. Leave all tags blank and try to submit → only Level A is flagged; B and C can stay blank.
  4. Fill Level A and submit → expense is created with B and C blank.
  5. Regression: a single-level required-tag workspace still shows "Required" and blocks when empty.

Please review and adjust the wording if your setup differs.

@huult

huult commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

@puneetlath all yours

Comment thread src/libs/TagsOptionsListUtils.ts Outdated
Comment on lines +246 to +250
// For independent multi-level tags each level has its own `required` flag, so mirror the per-level tag
// validation (see getTagViolationForIndependentTags) instead of OR-ing in the workspace-wide `requiresTag`,
// which would incorrectly label every level as "Required". Dependent multi-level tags are excluded: their
// validation (getTagViolationsForDependentTags) blocks submission on every level once `requiresTag` is on,
// regardless of each level's own `required` flag, so they must keep OR-ing the workspace-wide `requiresTag`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we make this more succinct? It doesn't really feel worthy of a five line comment to me.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@MelvinBot please make this comment shorter, emphasizing why the next condition is needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Shortened to two lines in a21bd35, focused on why the independent-tags branch is needed:

// Independent multi-level tags have a per-level `required` flag, so honor it alone to match validation;
// OR-ing in the workspace-wide `requiresTag` here would mislabel every level "Required". All other cases keep OR-ing it.

See TagsOptionsListUtils.ts:248. Logic is unchanged — comment only.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@MelvinBot I don’t think we need a comment here since it’s already clear. Please remove it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the comment in b689e0e — the ternary stands on its own. Logic is unchanged.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

The only failing check is Check independent approval — every test, lint, typecheck, and build check is passing.

This isn't a code failure and there's nothing to push a fix for. Check independent approval is a merge gate that stays red until an independent Expensify engineer approves the PR. It clears itself once that approval lands — no branch changes required.

Nothing to fix here. The PR is green on all substantive checks; it just needs an independent reviewer's approval.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 There's no code fix to push here — all CI checks pass (tests, typecheck, ESLint, Oxfmt, build, Storybook, perf).

The only red check is Check independent approval, which is a review-policy gate, not a build/test failure. It stays red until an independent reviewer (someone other than the author/assignee) approves the PR. It will clear automatically once that approval lands.

Action needed: get an independent reviewer to approve — no changes to the branch are required.

Co-authored-by: huult <huult@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Still nothing to push — every test/lint/typecheck/build check is green. The only red check remains Check independent approval, a review-policy gate that clears once an independent reviewer (looks like puneetlath) approves. No branch changes needed.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Still nothing to fix here. The CI checks (tests, typecheck, perf) are currently re-running/pending, and the only red check remains Check independent approval — a review-policy gate, not a build/test failure (details in my earlier comment).

Action needed: get an independent reviewer (not the author/assignee) to approve — the gate clears automatically once that approval lands. No branch changes are required.

@puneetlath
puneetlath merged commit a03d7ab into main Aug 13, 2026
44 of 45 checks passed
@puneetlath
puneetlath deleted the claude-multiLevelTagRequiredBadge branch August 13, 2026 14:39
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.

3 participants