Skip to content

[PER-10678] Replace navigate lean in filesystem - #1141

Open
aasandei-vsp wants to merge 6 commits into
mainfrom
PER-10678-replace-navigate-lean-filesystem
Open

aasandei-vsp wants to merge 6 commits into
mainfrom
PER-10678-replace-navigate-lean-filesystem

Conversation

@aasandei-vsp

@aasandei-vsp aasandei-vsp commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

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

  1. Open My Files and navigate into a nested folder.
    • EXPECTED: The folder loads.
  2. Navigate back to My Files, then into the same folder again.
    • EXPECTED: The second visit renders instantly (cache).

Scenario — deep link

  1. Copy a folder URL of the form /app/private/{archiveNbr}/{folderLinkId} and open it in
    a fresh tab.
    • EXPECTED: The folder loads directly.

Child ordering ⭐

Scenario — mixed folder, alphabetical sort

  1. Open a folder containing both records and sub-folders, sorted A–Z (set it via the
    sort dropdown first if needed, then reload).
    • EXPECTED: Items interleave purely by name, regardless if it's a folder or record.
  2. Reload the page.
    • EXPECTED: The order is identical after reload.
  3. Switch the sort to Date and reload once more.
    • EXPECTED: The reloaded order reflects the date sort — the server owns the order,
      so the choice must survive a fresh load.

Scenario — the other Stela lists (sanity)

  1. Start a Move on any item and browse the folder picker to a mixed folder.
    • EXPECTED: Folders list in the current sort order (the picker shows folders only).
  2. Publish a folder and wait for the dialog to finish.
    • EXPECTED: The dialog resolves and produces a link, as it did before.

Timeline through the shared resolver ⭐

Scenario — revisiting a timeline folder

  1. Open a folder in timeline view, navigate into a sub-folder, then use the breadcrumb to
    go back, then enter the same sub-folder again.
    • EXPECTED: The timeline is drawn correctly for every action, no error banner, no blank page.

Scenario — timeline deep link

  1. Open a timeline URL /app/private/view/timeline/{archiveNbr}/{folderLinkId} in a fresh tab.
    • EXPECTED: Loads correctly, no error banner or blanck page.

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

  1. In the signed-out browser(I use incognito mode in Chrome), open a public archive (/p/archive/{archiveNbr}/…) and
    navigate into a public folder.
    • EXPECTED: Children folder/records load.
  2. Copy the URL of a nested public folder and open it in a new signed-out tab(I use incognito mode in Chrome, just to make sure).
    • EXPECTED: The inner folder loads with all its content and the breadcrumb reflects the hierarchy correctly.

Unlisted share ---- CHECK THUMBNAILS ON DEV(BE seems to not be sending thumbnails on dev anymore, after an upload, worth checking)

  1. Open an unlisted share link to a folder.
    • EXPECTED: Loads all records and folders and the breadcrumb reflects the path correctly.

Error handling

Scenario — network failure while navigating

  1. In the file browser, set devtools network to Offline and click into a folder.
    • EXPECTED: An error toast appears (generic message).
  2. Set the network back to Online and navigate again.
    • EXPECTED: The navigation lands in the clicked folder.

Scenario — deep link to a folder that does not exist

  1. Edit a deep-link URL to a bogus folderLinkId and load it.
    • EXPECTED: An error toast, then a redirect to /private.

@aasandei-vsp aasandei-vsp self-assigned this Aug 21, 2026
@aasandei-vsp
aasandei-vsp marked this pull request as draft August 21, 2026 14:14
@codecov

codecov Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.39%. Comparing base (217c054) to head (e5436f2).
⚠️ Report is 4 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aasandei-vsp
aasandei-vsp force-pushed the PER-10677-replace-navigate-lean-timeline branch 2 times, most recently from 679b60a to 9e5b648 Compare September 8, 2026 15:56
@aasandei-vsp
aasandei-vsp force-pushed the PER-10678-replace-navigate-lean-filesystem branch from eca895f to a16a271 Compare September 9, 2026 11:34
@aasandei-vsp
aasandei-vsp marked this pull request as ready for review September 9, 2026 14:22
@slifty
slifty requested a lite review from Copilot September 16, 2026 20:14

Copilot AI 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.

🔵 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

  • toFolderLinkId returns undefined for a malformed URL segment, so /.../{archiveNbr}/bogus is converted into an archive-only identifier. getWithChildrenByIdentifier then 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

  • FolderResolveService supplies both archiveNbr and folder_linkId for every deep-link request, but this test only passes archiveNbr. It therefore never verifies the identifier used to resolve nested folders; a regression dropping folder_linkId would still pass. Include folder_linkId in 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 folderLinkId or archiveNumber, but this path returns the converted response without restoring the identifiers supplied in the request. A deep-linked/current folder can therefore lose folder_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, as FolderPickerComponent.setFolder already 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.

@aasandei-vsp
aasandei-vsp force-pushed the PER-10677-replace-navigate-lean-timeline branch 2 times, most recently from 0e1d365 to feba265 Compare September 17, 2026 14:54
@aasandei-vsp
aasandei-vsp force-pushed the PER-10678-replace-navigate-lean-filesystem branch from 7b92066 to 76092ef Compare September 17, 2026 15:06
@aasandei-vsp
aasandei-vsp force-pushed the PER-10677-replace-navigate-lean-timeline branch from feba265 to 13fb2e7 Compare September 18, 2026 09:15
@aasandei-vsp
aasandei-vsp force-pushed the PER-10678-replace-navigate-lean-filesystem branch from 76092ef to 9c94752 Compare September 18, 2026 09:31
Base automatically changed from PER-10677-replace-navigate-lean-timeline to main September 21, 2026 08:03
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
@aasandei-vsp
aasandei-vsp force-pushed the PER-10678-replace-navigate-lean-filesystem branch from 9c94752 to e5436f2 Compare September 21, 2026 08:11

@cecilia-donnelly cecilia-donnelly left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Comment thread src/app/shared/services/api/folder.repo.ts
Comment thread src/app/core/resolves/folder-resolve.service.ts
Comment thread src/app/shared/components/breadcrumbs/breadcrumbs.component.ts
@aasandei-vsp aasandei-vsp added the QA This issue is ready for QA / user acceptance testing label Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA This issue is ready for QA / user acceptance testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants