Skip to content

fix: delete background taller than its row on ServersHistory - #7536

Open
OtavioStasiak wants to merge 5 commits into
developfrom
fix.red-bottom-background-on-servers-history
Open

fix: delete background taller than its row on ServersHistory#7536
OtavioStasiak wants to merge 5 commits into
developfrom
fix.red-bottom-background-on-servers-history

Conversation

@OtavioStasiak

@OtavioStasiak OtavioStasiak commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Proposed changes

The workspaces action sheet renders a red bar under the last row. This isn't a background color—it's the swipe-to-delete action showing through.

DeleteAction renders a full-width red plate behind every server row. Previously, the plate height was calculated as rowHeight + SERVER_ITEM_PADDING_VERTICAL to account for the row's vertical padding. This worked while ROW_HEIGHT = 56, because the rendered row height was 44 + 12 + 12 = 68, matching the plate.

PR #7449 changed ROW_HEIGHT to 68 (the actual rendered height), added an explicit row height, and removed minHeight. Although the row still renders at 68dp, the constant now already includes the padding, while Actions.tsx continued adding SERVER_ITEM_PADDING_VERTICAL, making the plate 80dp tall. As a result, 12dp of the delete action became visible beneath the last row.

The issue only appears on the final row because intermediate rows are covered by the next sibling and separator. The last row ends at the sheet's safe-area padding, leaving the overflow exposed.

This fix removes the height arithmetic entirely and stretches the plate using top: 0 and bottom: 0, allowing it to always match the parent's height regardless of ROW_HEIGHT or fontScale. As part of this cleanup, SERVER_ITEM_PADDING_VERTICAL and the unused rowHeight prop were removed from Actions.tsx, SwipeableDeleteItem/Touchable.tsx, and ServerItem/Touchable.tsx.

Additionally, a .catch() was added to the floating Haptics.impactAsync() promise without awaiting it, preserving the gesture timing while avoiding an unhandled promise.

No row heights change. The only layout difference is replacing "height": 80 with top: 0 / bottom: 0; the 68dp row height introduced in #7449 remains unchanged, preserving pixel-grid alignment. This also fixes a secondary issue where, at larger fontScale values (~1.18+), the delete action no longer failed to fill the entire row.

Post-mortem

The root cause was a hidden coupling: Actions.tsx assumed ROW_HEIGHT excluded vertical padding, but that assumption was never encoded in the implementation. When #7449 legitimately redefined the constant, the dependency remained invisible because the rendered row height did not change. RoomItem/Actions.tsx avoids this problem by deriving its height from useResponsiveLayout().rowHeight. Replacing explicit height calculations with top: 0 / bottom: 0 removes the coupling entirely and prevents this class of bug in the future.

Issue(s)

https://rocketchat.atlassian.net/browse/NATIVE-1446

How to test or reproduce

  • Open Servers History on NewServerView;

Android Portrait

Before After
Screenshot_1785532074 Screenshot_1785531247
Screenshot_1785532078 Screenshot_1785531251

Android Landscape

Before After
Screenshot_1785532091 Screenshot_1785531268
Screenshot_1785532094 Screenshot_1785531266

iOS Portrait

Before After
Simulator Screenshot - iPhone 16 - 2026-07-31 at 18 11 59 Simulator Screenshot - iPhone 16 - 2026-07-31 at 17 57 20
Simulator Screenshot - iPhone 16 - 2026-07-31 at 18 12 05 Simulator Screenshot - iPhone 16 - 2026-07-31 at 17 57 33

iOS Landscape

Before After
Simulator Screenshot - iPhone 16 - 2026-07-31 at 18 12 14 Simulator Screenshot - iPhone 16 - 2026-07-31 at 17 57 48
Simulator Screenshot - iPhone 16 - 2026-07-31 at 18 12 19 Simulator Screenshot - iPhone 16 - 2026-07-31 at 17 57 54

iPad Portrait

Before After
Simulator Screenshot - iPad (A16) - 2026-07-31 at 18 11 24 Simulator Screenshot - iPad (A16) - 2026-07-31 at 18 00 44
Simulator Screenshot - iPad (A16) - 2026-07-31 at 18 11 30 Simulator Screenshot - iPad (A16) - 2026-07-31 at 18 00 51

iPad Landscape

Before After
Simulator Screenshot - iPad (A16) - 2026-07-31 at 18 11 39 Simulator Screenshot - iPad (A16) - 2026-07-31 at 18 01 23
Simulator Screenshot - iPad (A16) - 2026-07-31 at 18 11 47 Simulator Screenshot - iPad (A16) - 2026-07-31 at 18 01 12

Screenshots

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Summary by CodeRabbit

Bug Fixes

  • Improved swipe-to-delete action layout so controls consistently fill the server row.
  • Removed obsolete sizing behavior to prevent spacing and alignment issues.
  • Improved resilience when haptic feedback is unavailable or fails.
  • Preserved swipe animations, accessibility, and deletion behavior.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c7f6b8a2-8804-4ef8-8973-099ebd287a20

📥 Commits

Reviewing files that changed from the base of the PR and between 140a44e and 4504c94.

⛔ Files ignored due to path filters (2)
  • app/containers/ServerItem/__snapshots__/ServerItem.test.tsx.snap is excluded by !**/*.snap
  • app/views/NewServerView/components/ServersHistoryItem/__snapshots__/ServersHistoryItem.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (3)
  • app/containers/ServerItem/SwipeableDeleteItem/Actions.tsx
  • app/containers/ServerItem/SwipeableDeleteItem/Touchable.tsx
  • app/containers/ServerItem/Touchable.tsx
💤 Files with no reviewable changes (1)
  • app/containers/ServerItem/SwipeableDeleteItem/Touchable.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/containers/ServerItem/Touchable.tsx
  • app/containers/ServerItem/SwipeableDeleteItem/Actions.tsx
📜 Recent review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: ESLint and Test / run-eslint-and-test
  • GitHub Check: E2E Shard Preflight
  • GitHub Check: format

Walkthrough

The swipe-to-delete components remove the unused rowHeight prop and related style calculation. Delete actions now fill the row through absolute top and bottom constraints. Haptic feedback failures are ignored.

Changes

Swipe delete layout cleanup

Layer / File(s) Summary
Remove row-height contract
app/containers/ServerItem/SwipeableDeleteItem/Actions.tsx, app/containers/ServerItem/SwipeableDeleteItem/Touchable.tsx, app/containers/ServerItem/Touchable.tsx
The delete action API and server-item wiring no longer use rowHeight. The unused ROW_HEIGHT import is removed.
Stretch delete actions to row bounds
app/containers/ServerItem/SwipeableDeleteItem/Actions.tsx
Computed height and padding are removed. Action containers use absolute top and bottom constraints. Haptic feedback failures are ignored while swipe and deletion behavior remain unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: type: bug

Suggested reviewers: diegolmello

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main bug fix: correcting the delete background height in ServersHistory.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (4)
  • NATIVE-1446: Request failed with status code 401
  • FEC6-4147: Request failed with status code 401
  • A957-4604: Request failed with status code 401
  • D24A-4111: Request failed with status code 401

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/containers/ServerItem/SwipeableDeleteItem/Actions.tsx (1)

28-33: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add explicit return types to the changed functions.

DeleteAction is exported, but its callback passed to memo relies on return-type inference. triggerDeleteAnimation also relies on inference. Add an explicit component return type, such as ReactElement, and add : void to triggerDeleteAnimation.

As per coding guidelines, add explicit type annotations to function parameters and return types.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/containers/ServerItem/SwipeableDeleteItem/Actions.tsx` around lines 28 -
33, Add explicit return types to the functions in DeleteAction: annotate the
memoized component callback with the appropriate ReactElement return type and
annotate triggerDeleteAnimation with : void, while preserving the existing
behavior and parameter types.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/containers/ServerItem/SwipeableDeleteItem/Actions.tsx`:
- Line 34: Update the haptic call in the delete action within Actions.tsx to
attach a catch handler to Haptics.impactAsync, preventing native failures from
becoming unhandled promise rejections while keeping the animation non-blocking.

---

Nitpick comments:
In `@app/containers/ServerItem/SwipeableDeleteItem/Actions.tsx`:
- Around line 28-33: Add explicit return types to the functions in DeleteAction:
annotate the memoized component callback with the appropriate ReactElement
return type and annotate triggerDeleteAnimation with : void, while preserving
the existing behavior and parameter types.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ec578b44-27d5-420f-992c-242bec633012

📥 Commits

Reviewing files that changed from the base of the PR and between 6f9a093 and 9a1e2d1.

⛔ Files ignored due to path filters (2)
  • app/containers/ServerItem/__snapshots__/ServerItem.test.tsx.snap is excluded by !**/*.snap
  • app/views/NewServerView/components/ServersHistoryItem/__snapshots__/ServersHistoryItem.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (3)
  • app/containers/ServerItem/SwipeableDeleteItem/Actions.tsx
  • app/containers/ServerItem/SwipeableDeleteItem/Touchable.tsx
  • app/containers/ServerItem/Touchable.tsx
💤 Files with no reviewable changes (1)
  • app/containers/ServerItem/SwipeableDeleteItem/Touchable.tsx
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: ESLint and Test / run-eslint-and-test
  • GitHub Check: format
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,ts,jsx,tsx}: Use descriptive names for functions, variables, and classes that clearly convey their purpose
Write comments that explain the 'why' behind code decisions, not the 'what'
Keep functions small and focused on a single responsibility
Use const by default, let when reassignment is needed, and avoid var
Prefer async/await over .then() chains for handling asynchronous operations
Use explicit error handling with try/catch blocks for async operations
Avoid deeply nested code; refactor complex logic into helper functions

Files:

  • app/containers/ServerItem/Touchable.tsx
  • app/containers/ServerItem/SwipeableDeleteItem/Actions.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use TypeScript for type safety; add explicit type annotations to function parameters and return types
Prefer interfaces over type aliases for defining object shapes in TypeScript
Use enums for sets of related constants rather than magic strings or numbers

Files:

  • app/containers/ServerItem/Touchable.tsx
  • app/containers/ServerItem/SwipeableDeleteItem/Actions.tsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{js,jsx,ts,tsx}: Before committing changes to JavaScript or TypeScript files, run pnpm prettier-lint and TZ=UTC pnpm test for the modified files.
Use the local-first data flow: the UI reads from WatermelonDB, while sagas synchronize data with the server.
Use Redux and Redux-Saga for global or server state, and use Zustand for feature-local stores; do not assume all state is in Redux.

Files:

  • app/containers/ServerItem/Touchable.tsx
  • app/containers/ServerItem/SwipeableDeleteItem/Actions.tsx
🧠 Learnings (2)
📚 Learning: 2026-04-30T17:07:51.020Z
Learnt from: diegolmello
Repo: RocketChat/Rocket.Chat.ReactNative PR: 7274
File: app/lib/services/voip/MediaCallEvents.ts:0-0
Timestamp: 2026-04-30T17:07:51.020Z
Learning: In this Rocket.Chat React Native codebase, the ESLint rule `no-void: error` is enforced. When you see a promise returned from an async call that is not awaited (a “floating promise”), do not silence it with the `void somePromise()` pattern. Instead, handle the promise explicitly by attaching `.catch(...)` (or otherwise awaiting/handling the error) so unhandled-rejection risks are addressed in a way that satisfies the existing ESLint configuration.

Applied to files:

  • app/containers/ServerItem/Touchable.tsx
  • app/containers/ServerItem/SwipeableDeleteItem/Actions.tsx
📚 Learning: 2026-06-25T18:37:44.793Z
Learnt from: diegolmello
Repo: RocketChat/Rocket.Chat.ReactNative PR: 7434
File: app/views/ScreenLockConfigView.tsx:101-141
Timestamp: 2026-06-25T18:37:44.793Z
Learning: In the Rocket.Chat React Native codebase, do not treat passing an `async` function directly to an event prop in React/React Native UI components (e.g., `onPress={async () => ...}` in TSX) as a “floating promises” CI-blocking lint issue—this repo does not enable the ESLint `no-floating-promises` rule (while `no-void` is enforced). Only raise robustness follow-ups when there are genuinely unhandled promise paths (e.g., fire-and-forget calls like `save()` that return a Promise that is neither awaited nor handled), and prefer making sure failure paths are explicitly handled/reported rather than blocking on lint-style floating-promise concerns.

Applied to files:

  • app/containers/ServerItem/Touchable.tsx
  • app/containers/ServerItem/SwipeableDeleteItem/Actions.tsx
🔇 Additional comments (2)
app/containers/ServerItem/SwipeableDeleteItem/Actions.tsx (1)

22-26: LGTM!

Also applies to: 35-118, 120-136

app/containers/ServerItem/Touchable.tsx (1)

6-6: LGTM!

Also applies to: 34-46

Comment thread app/containers/ServerItem/SwipeableDeleteItem/Actions.tsx Outdated
@OtavioStasiak OtavioStasiak changed the title fix: delete background taller than its row on server items fix: delete background taller than its row on ServersHistory Jul 31, 2026
@OtavioStasiak
OtavioStasiak temporarily deployed to approve_e2e_testing July 31, 2026 21:05 — with GitHub Actions Inactive
@OtavioStasiak OtavioStasiak changed the title fix: delete background taller than its row on ServersHistory fix(regression): delete background taller than its row on ServersHistory Jul 31, 2026
@OtavioStasiak OtavioStasiak changed the title fix(regression): delete background taller than its row on ServersHistory fix: delete background taller than its row on ServersHistory Jul 31, 2026

@Rohit3523 Rohit3523 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants