Skip to content

feat(discover): rename, rearrange and delete folders [PER-2760] - #2453

Open
yasincaliskan wants to merge 10 commits into
mainfrom
yasincaliskan/per-2760-discover-folder-menu
Open

yasincaliskan wants to merge 10 commits into
mainfrom
yasincaliskan/per-2760-discover-folder-menu

Conversation

@yasincaliskan

Copy link
Copy Markdown
Collaborator

Description

People who made folders in native Discover can now tidy them. The folder screen header gets a "…" menu:

  • Rename Folder: the folder name sheet opens with the current name; same rules as create (trimmed, 1–40 characters, duplicates allowed).
  • Rearrange dApps: a full-height sheet to drag dApps into order and take some out with ×. Done saves both at once through a new store action setFolderItems. Cancel (the close icon) changes nothing. × only takes a dApp out of the folder; it stays a favorite. Hidden when the folder is empty.
  • Delete Folder: a confirm sheet ("Its dApps stay in your favorites."), then the folder goes and the screen leaves. Favorites are untouched.

Sheets open one after another; dismissing any of them changes nothing and tracks nothing. A folder deleted meanwhile makes the action a no-op.

Related Issues

  • Linear PER-2760 (favorites in folders: rename, rearrange, delete)

Checklist

  • Tested locally: on the iOS simulator, the menu, rename (prefilled, header updates) and delete (confirm, screen leaves, favorites kept). The Rearrange sheet was not opened on the simulator (filling a folder needs the 5 s toast tap, unreliable on the dev bundle); integration tests cover Done and Cancel.
  • Reviewed: a whole-branch review found nothing blocking.
  • Tests: store setFolderItems (order, unstarred keys dropped, dedupe, empty folder kept), the Rearrange sheet hook, the menu flow (each action, each dismiss, folder gone), and folder-screen integration (rename, delete, rearrange Done and Cancel, double tap).
  • Documentation: none needed.
  • Dependencies: none changed.

Contract Changes

  • Favorites store: new action setFolderItems(id, keys); no shape or version change.
  • New analytics events discover_folder_rename, discover_folder_delete, discover_folder_rearrange (removed_count).
  • New i18n keys under discover.folders.menu, .rearrange and .delete_confirm in all six bundles.

Behavior Changes

  • Multichain builds: the native folder screen has a "…" menu with Rename, Rearrange and Delete.
  • Algorand-only builds: no change.

Additional Notes

Calls I made:

  • The delete confirm is the app's confirm sheet, not a dialog, like every other destructive confirm.
  • Cancel in Rearrange is the sheet's close icon (left of the title); Figma wasn't reachable to check for a text button.

Left for later (minor, from the review):

  • Menu tests cover the "folder gone" guard for rename only, and there is no same-name rename test.
  • Rename and rearrange events also fire when nothing changed.
  • Rearrange derives favorite keys from the url instead of reading the folder's keys.
  • Accessibility: the drag handle has no label or reorder action (same as account sort), the × target is under 44 pt, menu rows have no button role.
  • Rearrange shows an empty list once every dApp is taken out.

@yasincaliskan
yasincaliskan requested a review from a team as a code owner November 16, 2026 12:29
@linear-code

linear-code Bot commented Nov 16, 2026

Copy link
Copy Markdown

PER-2760

@github-actions

Copy link
Copy Markdown

Device e2e flows affected

Every suite (22 suites, 255 scenarios, 47 p0): a change under a path every screen depends on.

  • apps/mobile/src/analytics/events/contexts/discover.ts
  • apps/mobile/src/analytics/events/metadata-keys.ts
  • apps/mobile/src/i18n/locales/de.json
  • apps/mobile/src/i18n/locales/en.json
  • apps/mobile/src/i18n/locales/es.json
  • apps/mobile/src/i18n/locales/fr.json
  • apps/mobile/src/i18n/locales/pt-BR.json
  • apps/mobile/src/i18n/locales/tr.json

Run them:

  • BrowserStack: the E2E / BrowserStack workflow with include left empty
  • A device: e2e/tools/run.sh <android|ios>

@yasin-ce yasin-ce left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Adds rename, rearrange and delete to the native Discover folder screen through a header menu. One new store action backs it, and the behaviour is well tested. Layering, i18n, theme tokens and tests all follow the repo rules. My comments are about reuse and one fragile key derivation, and none of them block.

The Rearrange sheet hasn't been opened on a device yet. Please run it once (drag, ×, Done, close icon, Android back) before merging.

@yasincaliskan

Copy link
Copy Markdown
Collaborator Author

Thanks. Your inline comments didn't come through on the PR, so I went by the summary. Fixed in the last two commits:

  • Fragile key derivation: the Rearrange sheet now keeps the folder's own keys ({ key, dapp } pairs read from folder.items) instead of re-deriving them from the url, so Done can't drop a dApp whose url no longer normalises to its key. A new hook test covers that case.
  • Reuse:
    • The row logo is a shared DappLogo, used by DappRow and the Rearrange rows.
    • The sheet options are one SCROLLING_AUTO_SHEET_OPTIONS, used by useCreateFolder, useToggleDiscoverFavorite and useFolderMenu.
    • pressIcon moved to test-utils, shared with add-account-default-chains.spec.

If I missed one of your comments, please repost it.

The device run of Rearrange is still open: on the simulator I couldn't get a dApp into a folder through the 5 s toast. Yasin will run drag, ×, Done, the close icon and back before merge.

@yasin-ce yasin-ce left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The follow-ups are in. The Rearrange sheet now uses the folder's own keys, so Done can't drop a dApp whose url no longer normalises to its key, and a test covers that case. The logo, sheet options and pressIcon are shared now. Nothing new blocks, and CI is green.

I'd still like one device run of Rearrange (drag, ×, Done, close icon, swipe down, Android back) before merging.

@yasincaliskan

Copy link
Copy Markdown
Collaborator Author

Device check of Rearrange on the iOS simulator: the sheet opens from the folder menu; × then the close icon changes nothing; × then Done takes the dApp out and keeps the (now empty) folder. Dragging is not checked: only one testnet dApp could be filed into a folder. Filling folders needed #2456, which fixes the empty Add to folder sheet.

@yasincaliskan

Copy link
Copy Markdown
Collaborator Author

Device run of Rearrange on the iOS simulator, with two dApps in a folder:

  • Drag: works; the order changes in the sheet.
  • Swipe down: the sheet stays open and keeps the edits (pan-down close is off, as account sort).
  • Close icon: changes nothing. × then Done: takes the dApp out and keeps the folder.
  • Android back: not run (no Android device here).

The run found one bug, fixed in the last commit: after Done, the folder screen showed only one of the two rows. FlashList v2 anchors the viewport on the first visible row and re-applies it on every data change, so the moved row ended up above the viewport. FavoriteDappList now sets maintainVisibleContentPosition={{ disabled: true }}, the same fix and reason as AccountMenu. Re-checked on the simulator: both rows show in the new order. There's no automated test for it: the test FlashList doesn't model scroll anchoring.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants