Skip to content

feat(ui): add reusable accordion with smooth animation#3869

Open
ajaysehwal wants to merge 7 commits intoZeusLN:masterfrom
ajaysehwal:accordian-animation
Open

feat(ui): add reusable accordion with smooth animation#3869
ajaysehwal wants to merge 7 commits intoZeusLN:masterfrom
ajaysehwal:accordian-animation

Conversation

@ajaysehwal
Copy link
Copy Markdown
Contributor

@ajaysehwal ajaysehwal commented Mar 19, 2026

Description

Please enter a description and screenshots, if appropriate, of the work covered in this PR

Reference from: https://docs.swmansion.com/react-native-reanimated/examples/accordion/

Summary

Introduces a reusable Accordion with animated expand/collapse, uses it across settings, tools, activity filters, and LSPS flows, and consolidates the old form-specific wrapper into a single component via headerLayout="form". Trims unused props, adds layout shorthands, and fixes controlled accordion state in Activity Filter plus a small accessibility improvement.

What changed

Accordion component (components/Accordion.tsx)

  • Animation: Height/opacity animation via Reanimated; shared open state for smooth toggling.
  • headerLayout="form": Form-style accordions (KeyValue title + caret, flat/embedded body styling)
    Standard (card) accordion

How to test

  • Activity → Filter → expand/collapse Services, Swaps, nested swap sections; toggles stay in sync.
  • Tools → Developer Tools → category accordions open/close; layout unchanged.
  • Settings / payments / channels → advanced / fee accordions; headers and carets behave as before.
  • LSPS1 / LSPS7 → service info + advanced accordions.
Screen.Recording.2026-04-06.at.12.16.59.PM.mov

This pull request is categorized as a:

  • New feature
  • Bug fix
  • Code refactor
  • Configuration change
  • Locales update
  • Quality assurance
  • Other

Checklist

  • I’ve run yarn run tsc and made sure my code compiles correctly
  • I’ve run yarn run lint and made sure my code didn’t contain any problematic patterns
  • I’ve run yarn run prettier and made sure my code is formatted correctly
  • I’ve run yarn run test and made sure all of the tests pass

Testing

If you modified or added a utility file, did you add new unit tests?

  • No, I’m a fool
  • Yes
  • N/A

I have tested this PR on the following platforms (please specify OS version and phone model/VM):

  • Android
  • iOS

I have tested this PR with the following types of nodes (please specify node version and API version where appropriate):

  • Embedded LND
  • LND (REST)
  • LND (Lightning Node Connect)
  • Core Lightning (CLNRest)
  • Nostr Wallet Connect
  • LndHub

Locales

  • I’ve added new locale text that requires translations
  • I’m aware that new translations should be made on the ZEUS Transfix page and not directly to this repo

Third Party Dependencies and Packages

  • Contributors will need to run yarn after this PR is merged in
  • 3rd party dependencies have been modified:
    • verify that package.json and yarn.lock have been properly updated
    • verify that dependencies are installed for both iOS and Android platforms

Other:

  • Changes were made that require an update to the README
  • Changes were made that require an update to onboarding

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new, animated accordion UI component built with react-native-reanimated. This component provides a modern and smooth user experience for expandable content sections. It has been integrated into the Activity Filter and Developer Tools screens, replacing their previous manual expansion logic with the new reusable component, thereby enhancing the overall user interface consistency and responsiveness.

Highlights

  • New Reusable Accordion Component: A new Accordion component has been introduced, leveraging react-native-reanimated for smooth open/close animations. This component is designed to be highly reusable and configurable, supporting controlled and uncontrolled states, custom headers, and icons.
  • Activity Filter UI Enhancement: The ActivityFilter screen has been updated to utilize the new Accordion component, improving the user experience for expanding and collapsing filter sections with smooth animations.
  • Developer Tools UI Refactor: The DeveloperTools screen has been refactored to integrate the new Accordion component for its command categories, streamlining the UI and providing a consistent animated expansion behavior.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new reusable Accordion component with smooth animation and integrates it into ActivityFilter.tsx and DeveloperTools.tsx. The new component effectively replaces previous manual expansion/collapse logic, simplifying the UI code in consuming components. However, the Accordion component's default styling is quite opinionated, leading to extensive style overrides in its usage, which could be improved for better reusability and maintainability. Additionally, a minor detail in the animation logic could be made more robust.

@ajaysehwal ajaysehwal changed the title feat(ui): add reusable accordion with soomth animation feat(ui): add reusable accordion with smooth animation Mar 20, 2026
@ajaysehwal ajaysehwal force-pushed the accordian-animation branch from 8cd1b45 to 2e9c698 Compare April 1, 2026 08:04
@ajaysehwal ajaysehwal marked this pull request as draft April 1, 2026 08:05
@ajaysehwal ajaysehwal force-pushed the accordian-animation branch from 2e9c698 to 8e39ca7 Compare April 6, 2026 06:39
@ajaysehwal ajaysehwal force-pushed the accordian-animation branch from 8e39ca7 to df4d94e Compare April 6, 2026 06:44
@ajaysehwal ajaysehwal marked this pull request as ready for review April 6, 2026 06:49
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.

2 participants