Skip to content

[PER-10679] Replace navigateLean with getWithChildren for the timeline view - #1138

Merged
aasandei-vsp merged 4 commits into
mainfrom
PER-10677-replace-navigate-lean-timeline
Sep 21, 2026
Merged

aasandei-vsp merged 4 commits into
mainfrom
PER-10677-replace-navigate-lean-timeline

Conversation

@aasandei-vsp

@aasandei-vsp aasandei-vsp commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Warning

Do not merge before #1135 , this PR depends on the mappings from that specific PR
Depends on accessRole being on stela records and folders

Manual test cases — timeline view moved from navigateLean to getWithChildren

Note

The timeline folder tiles no longer show an N items count. That is expected — Stela's
folder payload has no record-count field. The tile renders without the count line rather
than showing zero.


Timeline navigation ⭐

Scenario — loading the timeline

  1. Navigate to Public files, then switch to the timeline view.
    • EXPECTED: Items plot on the timeline and the breadcrumb bar shows the folder path.

Scenario — clicking a folder in the timeline

  1. Click a folder tile on the timeline.
    • EXPECTED: The view navigates into that folder and its contents plot.
  2. Check the breadcrumb bar.
    • EXPECTED: A new crumb is appended for the folder you entered.

Scenario — clicking a breadcrumb

  1. Navigate two folders deep, then click the first folder crumb in the bar.
    • EXPECTED: The timeline actually navigates back to that folder and its contents
      change. It does not just zoom or refit in place.

Scenario — deep link

  1. Copy a timeline URL of the form /app/private/view/timeline/{archiveNbr}/{folderLinkId}
    and open it in a fresh tab.
    • EXPECTED: The folder loads and plots. Previously this path could not resolve at all.

Permissions ⭐

(run as both the owner and the Viewer account — the point is that the two differ)

Stela reports the caller's role as owner / viewer, which this PR translates into
access.role.owner / access.role.viewer. Untranslated, every gate denied.

Scenario — owner keeps their actions

  1. Go to the private list view
  2. Click on a row(record or folder)
    • EXPECTED: Rename, Copy and Delete are all enabled.

Scenario — viewer is still restricted

  1. Open a folder shared to you as a Viewer.
  2. Click a row (record or folder)
    • EXPECTED: Write actions (Rename, Delete) are disabled.

Breadcrumbs outside the timeline

Scenario — unlisted share breadcrumbs

  1. Open an unlisted share link to a nested folder.
    • EXPECTED: The breadcrumb bar renders the full path.
  2. Click a middle crumb.
    • EXPECTED: It navigates to that ancestor folder.
  3. Look at the address bar after the click.
    • EXPECTED: A real path with an archive number and link id — no null or
      undefined segment such as /private/null/194781.

Shared record via share preview

Scenario — open a shared record

  1. Open a share link that points at a single record (not a folder).
    • EXPECTED: The record opens

Error handling

Scenario — deep link to a folder that does not exist

  1. Edit a timeline deep-link URL to use a bogus folderLinkId and load it.
    • EXPECTED: An error message is shown and you are redirected to /private. Previously
      this threw a TypeError inside the error handler, because the deep-link target has no
      type to call .includes('root') on.

@aasandei-vsp aasandei-vsp self-assigned this Aug 17, 2026
@aasandei-vsp
aasandei-vsp marked this pull request as draft August 17, 2026 12:31
@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.00000% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.12%. Comparing base (8f4a06a) to head (13fb2e7).

Files with missing lines Patch % Lines
...c/app/core/resolves/lean-folder-resolve.service.ts 66.66% 4 Missing and 1 partial ⚠️
...omponents/timeline-view/timeline-view.component.ts 75.00% 2 Missing ⚠️
src/app/shared/utilities/folder-error-message.ts 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1138      +/-   ##
==========================================
- Coverage   53.79%   53.12%   -0.68%     
==========================================
  Files         359      364       +5     
  Lines       12384    12776     +392     
  Branches     2256     2323      +67     
==========================================
+ Hits         6662     6787     +125     
- Misses       5485     5750     +265     
- Partials      237      239       +2     

☔ 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 from 229dc80 to ac8d6e8 Compare August 21, 2026 10:49
@aasandei-vsp
aasandei-vsp force-pushed the PER-10679-replace-navigate-lean-publish branch 2 times, most recently from 01eddfb to f22d6d7 Compare August 21, 2026 11:30
@aasandei-vsp
aasandei-vsp force-pushed the PER-10677-replace-navigate-lean-timeline branch from ac8d6e8 to 8aeaf3b Compare August 21, 2026 11:41
@aasandei-vsp
aasandei-vsp marked this pull request as ready for review August 21, 2026 11:43
@aasandei-vsp
aasandei-vsp force-pushed the PER-10677-replace-navigate-lean-timeline branch from 8aeaf3b to 28badda Compare August 21, 2026 11:52
@aasandei-vsp
aasandei-vsp force-pushed the PER-10679-replace-navigate-lean-publish branch from f22d6d7 to 476f085 Compare August 21, 2026 11:59
@aasandei-vsp
aasandei-vsp force-pushed the PER-10677-replace-navigate-lean-timeline branch 2 times, most recently from 99b406c to 3bae6b8 Compare August 21, 2026 13:24
@slifty
slifty requested a lite review from Copilot September 1, 2026 18:15

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.

🟡 Changes recommended

Breadcrumb identifier handling can still produce invalid null/undefined path segments and the deep-link resolver currently passes folder_linkId as a string instead of a number, risking incorrect navigation and requests.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR migrates timeline navigation (and lean folder resolving) from the legacy navigateLean v1 endpoint to Stela-backed getWithChildren via a new getWithChildrenByIdentifier helper, while also translating Stela accessRole values into the app’s access.role.* permissions model.

Changes:

  • Update timeline folder navigation and lean folder resolver to use getWithChildrenByIdentifier and unify error handling via getFolderErrorMessage.
  • Extend Stela folder/record conversion to map breadcrumbs (pathAsArchiveNbr, pathAsFolder_linkId) and translate accessRole.
  • Add/expand unit tests for timeline view, timeline breadcrumbs, access-role translation, folder repo behavior, and lean folder resolver.
File summaries
File Description
src/app/views/components/timeline-view/timeline-view.component.ts Switch folder navigation to getWithChildrenByIdentifier with toast error handling.
src/app/views/components/timeline-view/timeline-view.component.spec.ts Add unit tests around onFolderClick success/error behavior.
src/app/views/components/timeline-view/timeline-breadcrumbs/timeline-breadcrumbs.component.spec.ts Add breadcrumb construction tests from currentFolder path arrays.
src/app/shared/utilities/folder-error-message.ts Introduce shared helper for deriving a translatable folder-load error key.
src/app/shared/services/api/record.repo.ts Translate Stela accessRole into access.role.* and preserve optionality.
src/app/shared/services/api/record.repo.spec.ts Add tests for access-role translation and merging behavior.
src/app/shared/services/api/folder.repo.ts Map breadcrumb arrays from Stela payload and add getWithChildrenByIdentifier.
src/app/shared/services/api/folder.repo.spec.ts Add tests for breadcrumb mapping, identifier resolution, and role translation.
src/app/models/access-role.ts Add Stela archive-membership role types + translation utilities.
src/app/models/access-role.spec.ts Add tests ensuring translation coverage and compatibility with existing enums.
src/app/core/resolves/lean-folder-resolve.service.ts Convert resolver to async/await and use getWithChildrenByIdentifier + shared error message helper.
src/app/core/resolves/lean-folder-resolve.service.spec.ts Add resolver tests for defaults, deep links, share record case, and error redirects.
Review details

Suppressed comments (1)

src/app/core/resolves/lean-folder-resolve.service.ts:35

  • folder_linkId on FolderVO is a number, but the deep-link resolver passes the raw route param string through. This can break strict-equality comparisons and can lead to malformed requests when the repo expects numeric link ids; coerce it to a finite number (or leave it undefined so the existing error path can redirect).
		if (route.params.archiveNbr && route.params.folderLinkId) {
			targetFolder = new FolderVO({
				archiveNbr: route.params.archiveNbr,
				folder_linkId: route.params.folderLinkId,
			});
  • Files reviewed: 12/12 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/app/shared/services/api/folder.repo.ts Outdated
Comment thread src/app/core/resolves/lean-folder-resolve.service.spec.ts
Comment thread src/app/shared/services/api/folder.repo.spec.ts
@aasandei-vsp
aasandei-vsp force-pushed the PER-10679-replace-navigate-lean-publish branch from 476f085 to 91d528a Compare September 8, 2026 14:20
@aasandei-vsp
aasandei-vsp force-pushed the PER-10677-replace-navigate-lean-timeline branch from 1817ff4 to 679b60a Compare September 8, 2026 14:46
@aasandei-vsp

Copy link
Copy Markdown
Contributor Author

@slifty I have solved the copilot suggestions, do you think you could have another look, please?

@aasandei-vsp
aasandei-vsp force-pushed the PER-10677-replace-navigate-lean-timeline branch from 679b60a to 9e5b648 Compare September 8, 2026 15:56

@slifty slifty left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hooray!

@aasandei-vsp aasandei-vsp added the QA This issue is ready for QA / user acceptance testing label Sep 17, 2026
@aasandei-vsp
aasandei-vsp force-pushed the PER-10679-replace-navigate-lean-publish branch from 91d528a to 72580ae Compare September 17, 2026 14:34
@aasandei-vsp
aasandei-vsp force-pushed the PER-10677-replace-navigate-lean-timeline branch from 9e5b648 to 0e1d365 Compare September 17, 2026 14:39
@aasandei-vsp
aasandei-vsp force-pushed the PER-10679-replace-navigate-lean-publish branch from 72580ae to a02b7d2 Compare September 17, 2026 14:48
@aasandei-vsp
aasandei-vsp force-pushed the PER-10677-replace-navigate-lean-timeline branch from 0e1d365 to feba265 Compare September 17, 2026 14:54
@aasandei-vsp aasandei-vsp changed the title Replace navigateLean with getWithChildren for the timeline view [PER-10679] Replace navigateLean with getWithChildren for the timeline view Sep 17, 2026
@aasandei-vsp
aasandei-vsp force-pushed the PER-10679-replace-navigate-lean-publish branch from a02b7d2 to 9c89a8a Compare September 18, 2026 08:50
Base automatically changed from PER-10679-replace-navigate-lean-publish to main September 18, 2026 09:09
In order for the migration of the timeline to be complete, we needed
to map some extra fields to stela: folderLinkIds, archiveNumbers,
accessRole.
And for deep links, we needed to be able to get folders
using the properties mentioned above, so we needed an extra call to
the old API, because if the user is deep in a folder and uses the
browser refresh, the only way to identity the folder you were in,
would be using the archiveNbr and the folder_linkId, which is not
possible using the stela endpoints.

Issue: PER-10677
Lean folder response uses now getWithChildren instead of navigateLean
and returns consistently a promise, no observable.

Stela rejects with a raw http error, which is different from the old
backend, so a specific error message handler was needed.

Issue: PER-10677
The timeline folder navigation, going into a folder used the navigateLean
endpoint, so we replaced it with getWithChildren. The fact that we are making
a BE call from a component that otherwise does not have this kind of logic is
counterintuitive, but the needed refactoring to extract this logic is out of
scope for the current work and it would need testing many other places.

Issue: PER-10677
For the paths, we need to make sure that we do not generate anything
that is null or undefined, so we need to check that an archive number
or a folder link id is present.

For the folder link id, we need to make sure we only generate a number
or we leave it undefined, no matter what type we are actually receiving,
because the folderLinkId in stela is defined as an optional string or number.

Issue: PER-10677
@aasandei-vsp
aasandei-vsp force-pushed the PER-10677-replace-navigate-lean-timeline branch from feba265 to 13fb2e7 Compare September 18, 2026 09:15
@cecilia-donnelly
cecilia-donnelly removed their request for review September 18, 2026 15:26

@omnignorant omnignorant 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.

UAT passed on dev (branch PER-10677-replace-navigate-lean-timeline, commit 13fb2e7, Chrome only).

Verified: timeline loads with items plotted and the breadcrumb path shown; clicking a folder tile navigates in and appends a crumb; clicking a crumb two folders deep navigates back and the contents change; timeline deep links resolve in a fresh tab. Permissions hold in both directions - as owner, rename/copy/move/delete/share/publish are all enabled; in a Viewer-role share, only download is enabled and the name is not editable. A deep link with a bogus folder id shows "Folder not found" and redirects to /private with no console exception (reproduced twice). A shared record opens from a share preview.

Two non-blocking notes. Timeline navigation does not update the address bar - after clicking into a subfolder the URL still points at the folder the view was opened with, so a copied URL goes to the wrong place. And the PR title cites PER-10679, while the commits reference PER-10677; PER-10679 is the publish dialog delivered in #1135.

No Safari pass.

@aasandei-vsp
aasandei-vsp merged commit 217c054 into main Sep 21, 2026
20 checks passed
@aasandei-vsp
aasandei-vsp deleted the PER-10677-replace-navigate-lean-timeline branch September 21, 2026 08:03
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.

4 participants