[WIP] Decompose report action items#83577
Draft
adhorodyski wants to merge 2 commits intoExpensify:mainfrom
Draft
[WIP] Decompose report action items#83577adhorodyski wants to merge 2 commits intoExpensify:mainfrom
adhorodyski wants to merge 2 commits intoExpensify:mainfrom
Conversation
adhorodyski
commented
Feb 26, 2026
| } | ||
|
|
||
| setModerationDecision(latestDecision); | ||
| if (![CONST.MODERATION.MODERATOR_DECISION_APPROVED, CONST.MODERATION.MODERATOR_DECISION_PENDING].some((item) => item === latestDecision) && !isPendingRemove(action)) { |
Contributor
Author
There was a problem hiding this comment.
if all these branches are just setting state, all you need is derived state and not an effect running.
adhorodyski
commented
Feb 26, 2026
|
|
||
| function useActionModeration(action: OnyxTypes.ReportAction) { | ||
| const [isHidden, setIsHidden] = useState(false); | ||
| const [moderationDecision, setModerationDecision] = useState<OnyxTypes.DecisionName>(CONST.MODERATION.MODERATOR_DECISION_APPROVED); |
Contributor
Author
There was a problem hiding this comment.
derived state, not useState, same here
adhorodyski
commented
Feb 26, 2026
| break; | ||
| } | ||
|
|
||
| // Tag modification actions use a predicate check instead of direct actionName match |
Contributor
Author
There was a problem hiding this comment.
I understand this strategy is there only for backward compat, right?
adhorodyski
commented
Feb 26, 2026
| action: OnyxTypes.ReportAction; | ||
|
|
||
| /** The report ID this action belongs to */ | ||
| reportID: string | undefined; |
Contributor
Author
There was a problem hiding this comment.
is there a need for this in an interface, if we always refer to the currently navigated item? Could be obtained from this nav's context.
adhorodyski
commented
Feb 26, 2026
| } | ||
| setIsHidden(false); | ||
| }, [latestDecision, action]); | ||
| useActionCleanup(action.reportActionID, reactionListRef); |
Contributor
Author
There was a problem hiding this comment.
from the props you can clearly see not all actions want to call/manage these
adhorodyski
commented
Feb 26, 2026
| @@ -1146,6 +987,17 @@ function PureReportActionItem({ | |||
| * @returns child component(s) | |||
| */ | |||
| const renderItemContent = (hovered = false, isWhisper = false, hasErrors = false): React.JSX.Element => { | |||
| // Check if a dedicated renderer exists for this action type | |||
Contributor
Author
There was a problem hiding this comment.
this is the compat layer, right?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
Fixed Issues
$
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari