[PR #396] [CLOSED] Folder rearranging feature(#349) #741

Closed
opened 2026-03-03 00:22:59 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BoostIO/BoostNote-App/pull/396
Author: @ymtdzzz
Created: 4/6/2020
Status: Closed

Base: masterHead: feature/folder-arranging


📝 Commits (10+)

  • 4ab1cec Add parsing folder pathnames and folder tree component
  • 12e8875 Add validation & Refactoring
  • 1f218e0 Removed key 'isDirectory' from treeData
  • d874f32 Add feature of rearranging folders
  • a088ded Implemented folder order support
  • f46b97b Fixed some problems to pass current tests
  • c2589e6 Moved folderTree utils to a common file
  • 0ae7216 Add mobile touch support
  • 9a0226b Added tests
  • 9cdde2b Added loader

📊 Changes

19 files changed (+1423 additions, -70 deletions)

View changed files

📝 package-lock.json (+323 -7)
📝 package.json (+5 -0)
📝 src/components/App.tsx (+1 -0)
📝 src/components/molecules/FolderListFragment.tsx (+17 -1)
📝 src/components/molecules/StorageNavigatorFragment.tsx (+19 -5)
src/components/organisms/FolderList/FolderList.tsx (+64 -0)
📝 src/components/pages/StorageEditPage.tsx (+98 -1)
📝 src/index.tsx (+3 -1)
📝 src/lib/db/NoteDb.spec.ts (+14 -2)
📝 src/lib/db/NoteDb.ts (+37 -7)
📝 src/lib/db/createStore.ts (+90 -43)
📝 src/lib/db/store.spec.ts (+104 -0)
📝 src/lib/db/types.ts (+1 -0)
src/lib/folderRearrangement.ts (+23 -0)
src/lib/folderTree.ts (+214 -0)
src/lib/specs/folderTree.spec.ts (+292 -0)
📝 src/mobile/components/molecules/FolderListFragment.tsx (+17 -1)
📝 src/mobile/components/pages/StorageEditPage.tsx (+98 -1)
📝 src/mobile/index.tsx (+3 -1)

📄 Description

related issue: #349

Added folder tree component to the storage edit page.

Folder pathnames are transformed to folderTreeData.

Example
/
/FolderA
/FolderA/FolderA-A
/FolderA/FolderA-B
/FolderA/FolderA-B/FolderA-B-A
/FolderB

[
  {
    "title": "TestA",
    "pathname": "/TestA",
    "isDirectory": true,
    "children": [
      {
        "title": "TestAA",
        "pathname": "/TestA/TestAA",
        "isDirectory": true,
        "children": [
          {
            "title": "testAAA",
            "pathname": "/TestA/TestAA/testAAA",
            "isDirectory": true
          }
        ],
        "expanded": true
      }
    ],
    "expanded": true
  },
  {
    "title": "TestB",
    "pathname": "/TestB",
    "isDirectory": true
  }
]

By using this data and react-sortable-tree library, we can get each folder's before & after pathname.
(Please try to push the update folders button after rearranging folders.)

debug log
${after pathname}(${before pathname})

/FolderA(/FolderA)
/FolderA/FolderA-B-A(/FolderA/FolderA-B/FolderA-B-A)
/FolderA-A(/FolderA/FolderA-A)
/FolderB(/FolderB)
/FolderB/FolderA-B(/FolderA/FolderA-B)

Todos:

  • Add functions to transform pathnames to folder tree data
  • Remove the key 'isDirectory' from folderTreeDatas because all folderTreeDatas are directory
  • Add functions to execute updating all folders' pathnames within storage
  • Support folder's order
  • Add validation to check no duplicated pathnames
  • Styling (loading indicator, css)
  • Add tests

IssueHunt Summary

Referenced issues

This pull request has been submitted to:


IssueHunt has been backed by the following sponsors. Become a sponsor


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BoostIO/BoostNote-App/pull/396 **Author:** [@ymtdzzz](https://github.com/ymtdzzz) **Created:** 4/6/2020 **Status:** ❌ Closed **Base:** `master` ← **Head:** `feature/folder-arranging` --- ### 📝 Commits (10+) - [`4ab1cec`](https://github.com/BoostIO/BoostNote-App/commit/4ab1cece2b37f758fee35ed8d131050fc58844b3) Add parsing folder pathnames and folder tree component - [`12e8875`](https://github.com/BoostIO/BoostNote-App/commit/12e8875955c139010c50e66b690f82b51a84b3f0) Add validation & Refactoring - [`1f218e0`](https://github.com/BoostIO/BoostNote-App/commit/1f218e030101388ec703f277daec334ddbb45144) Removed key 'isDirectory' from treeData - [`d874f32`](https://github.com/BoostIO/BoostNote-App/commit/d874f326318b9344300568340fec754b8aa8cfdb) Add feature of rearranging folders - [`a088ded`](https://github.com/BoostIO/BoostNote-App/commit/a088dede5c789ff10c4f7349fdf8cda8529a26e4) Implemented folder order support - [`f46b97b`](https://github.com/BoostIO/BoostNote-App/commit/f46b97b18096388fbffa8cb65f3d9cffe034d914) Fixed some problems to pass current tests - [`c2589e6`](https://github.com/BoostIO/BoostNote-App/commit/c2589e66b0786e38c3c5522c6e919a73c1fe2054) Moved folderTree utils to a common file - [`0ae7216`](https://github.com/BoostIO/BoostNote-App/commit/0ae72163019a7aaeb4c0627006180052faf21353) Add mobile touch support - [`9a0226b`](https://github.com/BoostIO/BoostNote-App/commit/9a0226b2026914d01e8d5dfe5e428ffb59cc6273) Added tests - [`9cdde2b`](https://github.com/BoostIO/BoostNote-App/commit/9cdde2be10ce716e4313e25be2fe9a1b77d3259d) Added loader ### 📊 Changes **19 files changed** (+1423 additions, -70 deletions) <details> <summary>View changed files</summary> 📝 `package-lock.json` (+323 -7) 📝 `package.json` (+5 -0) 📝 `src/components/App.tsx` (+1 -0) 📝 `src/components/molecules/FolderListFragment.tsx` (+17 -1) 📝 `src/components/molecules/StorageNavigatorFragment.tsx` (+19 -5) ➕ `src/components/organisms/FolderList/FolderList.tsx` (+64 -0) 📝 `src/components/pages/StorageEditPage.tsx` (+98 -1) 📝 `src/index.tsx` (+3 -1) 📝 `src/lib/db/NoteDb.spec.ts` (+14 -2) 📝 `src/lib/db/NoteDb.ts` (+37 -7) 📝 `src/lib/db/createStore.ts` (+90 -43) 📝 `src/lib/db/store.spec.ts` (+104 -0) 📝 `src/lib/db/types.ts` (+1 -0) ➕ `src/lib/folderRearrangement.ts` (+23 -0) ➕ `src/lib/folderTree.ts` (+214 -0) ➕ `src/lib/specs/folderTree.spec.ts` (+292 -0) 📝 `src/mobile/components/molecules/FolderListFragment.tsx` (+17 -1) 📝 `src/mobile/components/pages/StorageEditPage.tsx` (+98 -1) 📝 `src/mobile/index.tsx` (+3 -1) </details> ### 📄 Description related issue: #349 Added folder tree component to the storage edit page. Folder pathnames are transformed to folderTreeData. <details><summary>Example</summary> ``` / /FolderA /FolderA/FolderA-A /FolderA/FolderA-B /FolderA/FolderA-B/FolderA-B-A /FolderB ``` ↓ ``` [ { "title": "TestA", "pathname": "/TestA", "isDirectory": true, "children": [ { "title": "TestAA", "pathname": "/TestA/TestAA", "isDirectory": true, "children": [ { "title": "testAAA", "pathname": "/TestA/TestAA/testAAA", "isDirectory": true } ], "expanded": true } ], "expanded": true }, { "title": "TestB", "pathname": "/TestB", "isDirectory": true } ] ``` </details> By using this data and react-sortable-tree library, we can get each folder's before & after pathname. (Please try to push the `update folders` button after rearranging folders.) <details><summary>debug log</summary> ``` ${after pathname}(${before pathname}) /FolderA(/FolderA) /FolderA/FolderA-B-A(/FolderA/FolderA-B/FolderA-B-A) /FolderA-A(/FolderA/FolderA-A) /FolderB(/FolderB) /FolderB/FolderA-B(/FolderA/FolderA-B) ``` </details> Todos: - [x] Add functions to transform pathnames to folder tree data - [x] Remove the key 'isDirectory' from folderTreeDatas because all folderTreeDatas are directory - [x] Add functions to execute updating all folders' pathnames within storage - [x] Support folder's order - [x] Add validation to check no duplicated pathnames - [x] Styling (loading indicator, css) - [x] Add tests <!-- Issuehunt content --> --- <details> <summary> <b>IssueHunt Summary</b> </summary> ### Referenced issues This pull request has been submitted to: - [#349: Rearrange folders](https://issuehunt.io/repos/74213528/issues/349) --- IssueHunt has been backed by the following sponsors. [Become a sponsor](https://issuehunt.io/membership/members) </details> <!-- /Issuehunt content--> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 00:22:59 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/BoostNote-App#741
No description provided.