[PER-10678] Replace navigate lean in filesystem - #1141
aasandei-vsp wants to merge 6 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1141 +/- ##
==========================================
+ Coverage 53.12% 53.39% +0.26%
==========================================
Files 364 363 -1
Lines 12776 12747 -29
Branches 2323 2319 -4
==========================================
+ Hits 6787 6806 +19
+ Misses 5754 5701 -53
- Partials 235 240 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
679b60a to
9e5b648
Compare
eca895f to
a16a271
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
Three unresolved moderate findings concern malformed deep-link handling, forwarding folder_linkId in tests, and preserving requested folder identifiers.
Pull request overview
Replaces navigateLean with getWithChildren for folder navigation while preserving server-defined child ordering and consolidating folder resolution.
Changes:
- Updates filesystem and timeline navigation.
- Preserves mixed folder/record ordering.
- Fixes breadcrumbs and public-folder publishing behavior.
- Removes the obsolete lean resolver and updates tests.
File summaries
| File | Description |
|---|---|
src/app/views/views.routes.ts |
Uses the shared folder resolver for timeline routes. |
src/app/shared/services/api/folder.repo.ts |
Preserves server child ordering. |
src/app/shared/services/api/folder.repo.spec.ts |
Tests mixed-child ordering. |
src/app/shared/components/breadcrumbs/breadcrumbs.component.ts |
Corrects shared-folder breadcrumbs. |
src/app/shared/components/breadcrumbs/breadcrumbs.component.spec.ts |
Tests shared breadcrumb behavior. |
src/app/filesystem/filesystem-api.service.ts |
Switches navigation to getWithChildrenByIdentifier. |
src/app/filesystem/filesystem-api.service.spec.ts |
Updates filesystem navigation tests. |
src/app/file-browser/components/publish/publish.component.ts |
Detects public Stela folders. |
src/app/file-browser/components/publish/publish.component.spec.ts |
Tests publishing behavior. |
src/app/file-browser/components/publish/publish.component.html |
Uses the computed public-item state. |
src/app/core/resolves/lean-folder-resolve.service.ts |
Removes the obsolete resolver. |
src/app/core/resolves/lean-folder-resolve.service.spec.ts |
Removes obsolete resolver tests. |
src/app/core/resolves/folder-resolve.service.ts |
Updates folder-link ID conversion and error handling. |
src/app/core/resolves/folder-resolve.service.spec.ts |
Expands resolver coverage. |
Review details
Suppressed comments (3)
src/app/core/resolves/folder-resolve.service.ts:37
toFolderLinkIdreturnsundefinedfor a malformed URL segment, so/.../{archiveNbr}/bogusis converted into an archive-only identifier.getWithChildrenByIdentifierthen performs the valid archive lookup path instead of rejecting the bad folder link, which can load the archive root rather than showing the error toast and redirect required for a bogus deep link. Validate the route segment and route the invalid case through the existing error handler before dropping the identifier.
folder_linkId: toFolderLinkId(route.params.folderLinkId),
src/app/filesystem/filesystem-api.service.spec.ts:91
FolderResolveServicesupplies botharchiveNbrandfolder_linkIdfor every deep-link request, but this test only passesarchiveNbr. It therefore never verifies the identifier used to resolve nested folders; a regression droppingfolder_linkIdwould still pass. Includefolder_linkIdin the request and assert that it is forwarded (or rename the test).
await service.navigate({ archiveNbr: '0001-0000' });
src/app/filesystem/filesystem-api.service.ts:37
- The Stela folder payload does not guarantee
folderLinkIdorarchiveNumber, but this path returns the converted response without restoring the identifiers supplied in the request. A deep-linked/current folder can therefore losefolder_linkId/archiveNbr, which breaks breadcrumb/current-folder operations and also prevents the cache from matching a later visit by link id. Preserve the requested identifiers when the response omits them, asFolderPickerComponent.setFolderalready does.
response = await this.api.folder.getWithChildrenByIdentifier(
new FolderVO(folder),
- Files reviewed: 14/14 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
0e1d365 to
feba265
Compare
7b92066 to
76092ef
Compare
feba265 to
13fb2e7
Compare
76092ef to
9c94752
Compare
In the new converter from stela records/folders, when the items were coming as children of a folder, they would be separated into folders and records for mapping, so the sort order the backend sent was lost. We do not do any kind of sorting on the FE, so this actually fixes the scrambled sort issue we were having before. Issue: PER-10678
The folder resolver's catch block would expect a FolderResponse type of error, which we are trying to move away from. So instead of converting the stela error to a FolderResponse, we will just make the expected error type more generic. Issue: PER-10678
The fileSystem service, that is used by the folder resolver has quite a wide reach, so this will instantly replace a lot of the navigateLean calls from route level. Issue: PER-10678
Folder resolve is already using getWithChildren and it serves the same data the lean folder resolve did, so keeping it became redundant. Issue: PER-10678
Stela sends the real sharers hierarchy of folders, so when we build the breadcrumbs, the root will be set as Private instead of Shares. In order to bypass that, we'll check if the route we are is shared and show the correct route. Issue: PER-10678
In the publish dialog, the title was decided by a property from the folder or record, so if that property would ever be undefined, the dialog would crash. Moved the property check in the component instead of the view and also check if the item includes a type, which is a stela property. Issue: PER-10678
9c94752 to
e5436f2
Compare
cecilia-donnelly
left a comment
There was a problem hiding this comment.
Wow, this is so clean and the commits are so well separated. Thank you! I'm amazed at how much you're doing here with so few changes.
Manual test cases — filesystem navigate moved from navigateLean to getWithChildren
Setup: Sign in as the owner of an archive with nested folders that mix records and
sub-folders, and at least one folder whose sort is set to something other than the default.
You also need a public archive with nested public folders.
Warning
The converter now keeps children in the order the server sends. Records are no longer
grouped ahead of folders.
Main file browser ⭐
(this is the core of the change — the app's primary navigation path)
Scenario — navigating folders
Scenario — deep link
/app/private/{archiveNbr}/{folderLinkId}and open it ina fresh tab.
Child ordering ⭐
Scenario — mixed folder, alphabetical sort
sort dropdown first if needed, then reload).
so the choice must survive a fresh load.
Scenario — the other Stela lists (sanity)
Timeline through the shared resolver ⭐
Scenario — revisiting a timeline folder
go back, then enter the same sub-folder again.
Scenario — timeline deep link
/app/private/view/timeline/{archiveNbr}/{folderLinkId}in a fresh tab.Public archive, signed out ⭐ ------ TEST ON DEV
Nothing in the app fetched a folder from Stela without any token before this change. The
Stela side is verified in its source; the v1 identity bridge for deep links is the open
question.
Scenario — anonymous browsing. ------ TEST ON DEV
/p/archive/{archiveNbr}/…) andnavigate into a public folder.
Unlisted share ---- CHECK THUMBNAILS ON DEV(BE seems to not be sending thumbnails on dev anymore, after an upload, worth checking)
Error handling
Scenario — network failure while navigating
Scenario — deep link to a folder that does not exist
folderLinkIdand load it./private.