Skip to content

chore: Revise design of "bottom actions"#513

Merged
cyanChill merged 8 commits into
devfrom
chore/bottom-actions-redesign
Jun 16, 2026
Merged

chore: Revise design of "bottom actions"#513
cyanChill merged 8 commits into
devfrom
chore/bottom-actions-redesign

Conversation

@cyanChill

@cyanChill cyanChill commented Jun 16, 2026

Copy link
Copy Markdown
Member

Why

Hopefully this will be the last time we change this in this major version of the app. This design basically reverts back to a design similar to what we had in v2, but offers a different design for when we want to hide the navbar.

// With Navbar:
[          MiniPlayer          ]
[Search]   [Navbar]   [Settings]

// Without Navbar:
[Search] [MiniPlayer] [Settings]

Note

While working on this, I found out that the swipe gestures on the miniplayer randomly breaks only on dev mode when we return to the home screen after visiting the settings.

Checklist

  • Documentation is up to date to reflect these changes.
  • Ensure dependency licenses are up-to-date by running pnpm sync:licenses.
  • This diff will work correctly for pnpm android:prod.

Summary by CodeRabbit

  • New Features

    • Added dedicated Search and Settings buttons to bottom navigation
    • Settings button now displays an update badge when new updates are available
  • Style

    • Improved MiniPlayer animation with slide-down transitions for smoother visual feedback
    • Enhanced bottom navigation layout and positioning for better usability
    • Updated mini-player offset handling so bottom spacing reflects whether the mini-player is visible

- Based on how we layout the `layout={LinearTransition}`, the exiting animations might look a bit janky. This requires different positionings based on the desired layout.
- We have 3 cases:
  1. Navbar w/ no miniplayer.
  2. Navbar w/ miniplayer.
  3. No navbar w/ miniplayer.
- On app launch, swipe gestures work fine on miniplayer. Once we navigate to the settings and go back, they randomly break.
@cyanChill cyanChill added the enhancement New feature or request label Jun 16, 2026
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR refactors the BottomActions navigation system: NavActions.tsx is split into standalone exported SearchButton, SettingsButton, and Navbar components; a new index.tsx introduces a BottomActions orchestrator selecting between navbar/no-navbar layouts; MiniPlayer switches to slide-down transitions; useRenderBottomActions coerces navBar to Boolean; NScrollLayout adopts conditional bottom offset logic; and all consumer screens are re-pointed to the new module path.

Changes

BottomActions Refactor

Layer / File(s) Summary
Hook updates: navBar Boolean coercion and layout offset logic
mobile/src/navigation/components/BottomActions/useBottomActions.ts, mobile/src/navigation/layouts/NScrollLayout.tsx
useRenderBottomActions coerces navBar to explicit Boolean; NScrollLayout and NScrollListLayout implement conditional bottomOffset that adds extra padding when showNavbar is enabled and useBottomActionsOffset() indicates mini-player visibility.
NavActions: split into SearchButton, SettingsButton, exported Navbar
mobile/src/navigation/components/BottomActions/NavActions.tsx
BottomActions/HomeActions are removed; SearchButton and SettingsButton are added as RTL-aware animated icon buttons with i18n accessibility labels and useHasNewUpdate badge; Navbar is exported and its container is changed to Animated.View with SlideInDown/SlideOutDown; reanimated imports updated.
MiniPlayer: slide-down transitions and import path update
mobile/src/navigation/components/BottomActions/MiniPlayer.tsx
Entering/exiting transitions switched to SlideInDown/SlideOutDown; container className adjusted for explicit height/width sizing; BottomActionsOffset import re-pointed to ./useBottomActions.
New BottomActions index: WithNavBar and WithOutNavBar layouts
mobile/src/navigation/components/BottomActions/index.tsx
New BottomActions component reads showNavbar, selects a layout via useMemo, and wraps it in an absolutely positioned Animated.View with LinearTransition. WithNavBar renders MiniPlayer plus a horizontal SearchButton/Navbar/SettingsButton row; WithOutNavBar places SearchButton and SettingsButton on the sides with MiniPlayer in the middle.
Screen import path re-pointing
mobile/src/navigation/screens/RecentlyPlayedView.tsx, mobile/src/navigation/screens/albums/CurrentView.tsx, mobile/src/navigation/screens/artists/CurrentView.tsx, mobile/src/navigation/screens/genres/CurrentView.tsx, mobile/src/navigation/screens/playlists/CurrentView.tsx
All five screens switch useBottomActionsOffset import from ~/navigation/hooks/useBottomActions to ~/navigation/components/BottomActions/useBottomActions with adjacent import reordering; no runtime logic changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 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 accurately describes the primary change: a design revision of the bottom actions component with layout and animation updates across multiple files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
mobile/src/navigation/layouts/NScrollLayout.tsx (1)

75-78: ⚡ Quick win

Extract duplicated bottom-offset args into a shared helper.

The same offset expression appears twice; centralizing it avoids future drift between NScrollLayout and NScrollListLayout.

Also applies to: 164-167

🤖 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 `@mobile/src/navigation/layouts/NScrollLayout.tsx` around lines 75 - 78, The
bottom-offset calculation in useBottomActionsOffset call is duplicated across
two files. Extract the offset expression (16 + (showNavbar ? BottomActionsOffset
: 0) and the second argument showNavbar ? -8 : 0) into a shared helper function
that both NScrollLayout (lines 75-78) and NScrollListLayout (lines 164-167) can
use. Create a utility function that takes showNavbar as a parameter and returns
both offset values to eliminate the duplication and prevent future
inconsistencies between the two layouts.
🤖 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 `@mobile/src/navigation/components/BottomActions/index.tsx`:
- Around line 60-71: The SearchButton and SettingsButton components in the
Animated.View are currently gated behind the rendered.navBar condition, which
causes them to disappear on non-home routes. This violates the no-navbar layout
contract where side buttons should remain visible independently of the
home-route flag. Remove the rendered.navBar checks from both the SearchButton
(line 64) and SettingsButton (line 70) conditionals, either by always rendering
these components or by replacing the navBar condition with an appropriate
condition specific to the no-navbar mode layout contract that is independent of
the onHomeScreen flag.

In `@mobile/src/navigation/components/BottomActions/NavActions.tsx`:
- Line 69: The update badge in the NavActions component uses the hardcoded
`right-3` class for positioning, which breaks the layout in RTL (right-to-left)
locales because the badge will still appear on the right side instead of
mirroring to the left. Replace the `right-3` class with `end-3` in the View
component's className, as the `end` utility in Tailwind CSS is RTL-aware and
automatically adjusts positioning based on text direction, ensuring the badge
appears in the correct corner for both LTR and RTL locales.

---

Nitpick comments:
In `@mobile/src/navigation/layouts/NScrollLayout.tsx`:
- Around line 75-78: The bottom-offset calculation in useBottomActionsOffset
call is duplicated across two files. Extract the offset expression (16 +
(showNavbar ? BottomActionsOffset : 0) and the second argument showNavbar ? -8 :
0) into a shared helper function that both NScrollLayout (lines 75-78) and
NScrollListLayout (lines 164-167) can use. Create a utility function that takes
showNavbar as a parameter and returns both offset values to eliminate the
duplication and prevent future inconsistencies between the two layouts.
🪄 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: 15538a9f-72b0-4a71-868e-c98785d9dd8f

📥 Commits

Reviewing files that changed from the base of the PR and between 8dc3adb and d54e81d.

⛔ Files ignored due to path filters (1)
  • .github/assets/Promo - UI.png is excluded by !**/*.png
📒 Files selected for processing (10)
  • mobile/src/navigation/components/BottomActions/MiniPlayer.tsx
  • mobile/src/navigation/components/BottomActions/NavActions.tsx
  • mobile/src/navigation/components/BottomActions/index.tsx
  • mobile/src/navigation/components/BottomActions/useBottomActions.ts
  • mobile/src/navigation/layouts/NScrollLayout.tsx
  • mobile/src/navigation/screens/RecentlyPlayedView.tsx
  • mobile/src/navigation/screens/albums/CurrentView.tsx
  • mobile/src/navigation/screens/artists/CurrentView.tsx
  • mobile/src/navigation/screens/genres/CurrentView.tsx
  • mobile/src/navigation/screens/playlists/CurrentView.tsx

Comment thread mobile/src/navigation/components/BottomActions/index.tsx
Comment thread mobile/src/navigation/components/BottomActions/NavActions.tsx

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

Actionable comments posted: 1

🤖 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 `@mobile/src/navigation/layouts/NScrollLayout.tsx`:
- Around line 74-77: The miniplayVisible variable is using
useBottomActionsOffset() !== 0 as a visibility check, but this hook reflects
active-track offset logic rather than whether the mini-player is actually
rendered on the current route. This causes incorrect padding calculations even
when the mini-player is not displayed. Replace the miniplayVisible assignment at
line 76 (in the NScrollLayout.tsx file around the variable initialization) and
at line 164 (also in NScrollLayout.tsx) with a route-aware check that properly
determines if the mini-player is rendered, rather than relying on the bottom
offset hook value. Use a more accurate visibility flag that accounts for the
actual route-level rendering of the mini-player component.
🪄 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: de08e632-c8d3-4763-b9c5-2a96a4723c73

📥 Commits

Reviewing files that changed from the base of the PR and between d54e81d and f498d79.

📒 Files selected for processing (2)
  • mobile/src/navigation/components/BottomActions/useBottomActions.ts
  • mobile/src/navigation/layouts/NScrollLayout.tsx

Comment thread mobile/src/navigation/layouts/NScrollLayout.tsx
@cyanChill cyanChill merged commit bf41d44 into dev Jun 16, 2026
1 check passed
@cyanChill cyanChill deleted the chore/bottom-actions-redesign branch June 16, 2026 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant