Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/components/Search/SearchBulkActionsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,10 @@ function SearchBulkActionsButton({queryJSON}: SearchBulkActionsButtonProps) {
/>
</View>
) : (
<View style={[styles.flexRow, styles.gap3]}>
<View style={[styles.flexRow, styles.alignItemsCenter, styles.gap3]}>
<ButtonWithDropdownMenu

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 Restrict larger bulk-action button size to web only

Removing buttonSize={CONST.DROPDOWN_BUTTON_SIZE.SMALL} here makes ButtonWithDropdownMenu fall back to MEDIUM for every wide-layout client, not just web. SearchPage chooses wide vs narrow using shouldUseNarrowLayout (width-based), so iOS/Android tablets also execute this path and get the larger control (plus the accompanying spacing offset in styles.searchBulkActionsButton), which conflicts with the stated goal of a web-only visual tweak and can regress native tablet layout consistency.

Useful? React with 👍 / 👎.

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.

Sorry I don't mean web-only, I actually mean wide screen only. So I think we're good here.

onPress={() => null}
shouldAlwaysShowDropdownMenu
buttonSize={CONST.DROPDOWN_BUTTON_SIZE.SMALL}
customText={selectionButtonText}
options={headerButtonsOptions}
shouldPopoverUseScrollView={popoverUseScrollView}
Expand Down
4 changes: 3 additions & 1 deletion src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4900,8 +4900,10 @@ const staticStyles = (theme: ThemeColors) =>
minHeight: variables.componentSizeSmall,
},

// The filter bar row is 34px tall, but the default (larger) bulk-action button is 40px.
// To keep the bar from growing, we pull the button up/down by half the difference: (40 - 34) / 2 = 3.
searchBulkActionsButton: {
marginVertical: 3,
marginVertical: -3,

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.

❌ CONSISTENCY-2 (docs)

The value -3 is a magic number with no explanation of why this specific value is used. Negative margins are especially worth documenting since they are an unusual layout technique that can cause clipping or overlap issues. The previous value 3 was also a magic number, but switching to a negative margin makes the intent even less clear.

Define a named constant or add a comment explaining why -3 is the correct value. For example:

// Negative margin compensates for the larger default button size
// to keep the bulk actions bar at the same height
const SEARCH_BULK_ACTIONS_BUTTON_VERTICAL_OFFSET = -3;

searchBulkActionsButton: {
    marginVertical: SEARCH_BULK_ACTIONS_BUTTON_VERTICAL_OFFSET,
},

Reviewed at: ed27170 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

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.

@MelvinBot can you implement that suggestion?

Can you also explain in that comment that we arrived at that number because the current height of the view is 34. The bigger button is 40, which is 6 more. That means we need to pull the button up by half of the difference, so 6/2 is 3.

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.

@MelvinBot you are an assignee now, please retry this request

},

filtersBar: {
Expand Down
Loading