Skip to content

Conversation

slifty
Copy link
Contributor

@slifty slifty commented Sep 15, 2025

This PR updates getWithChildren to use stela.

This function is not used in many places right now -- in particular I was only able to reliably trigger it by viewing the Apps section of the navigation.

We picked this one because it will be used for unlisted shares.

Related to #683

@slifty slifty force-pushed the PER-10107-use-folder-get-stela branch 2 times, most recently from 22c3d46 to 8bc9934 Compare September 15, 2025 20:22
@slifty slifty force-pushed the PER-10107-use-record-get-v2 branch 2 times, most recently from 67f1542 to 43c79d1 Compare September 15, 2025 20:24
@slifty slifty force-pushed the PER-10107-use-folder-get-stela branch from 8bc9934 to d00b5bf Compare September 25, 2025 15:28
@slifty slifty force-pushed the PER-10107-use-record-get-v2 branch from 43c79d1 to d47ad15 Compare September 25, 2025 15:29
@slifty slifty force-pushed the PER-10107-use-folder-get-stela branch from d00b5bf to c43a07c Compare September 25, 2025 15:31
Copy link

codecov bot commented Sep 25, 2025

Codecov Report

❌ Patch coverage is 22.58065% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.04%. Comparing base (2e200fa) to head (3c5811e).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
src/app/shared/services/api/folder.repo.ts 11.11% 24 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #720      +/-   ##
==========================================
- Coverage   45.16%   45.04%   -0.12%     
==========================================
  Files         370      370              
  Lines       11284    11309      +25     
  Branches     1860     1862       +2     
==========================================
- Hits         5096     5094       -2     
- Misses       6013     6042      +29     
+ Partials      175      173       -2     

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Contributor

@aasandei-vsp aasandei-vsp left a comment

Choose a reason for hiding this comment

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

From my point of view, taking into account that I'm still getting used to the code base, it looks good.

@slifty
Copy link
Contributor Author

slifty commented Sep 29, 2025

@aasandei-vsp Thank you, also I just wanted to underscore how accurate your review was / please do continue to flag things like that even if in this case we didn't end up making every change!

@aasandei-vsp
Copy link
Contributor

@aasandei-vsp Thank you, also I just wanted to underscore how accurate your review was / please do continue to flag things like that even if in this case we didn't end up making every change!

I promise to do this and push back as well whenever I have a strong opinion about smth and back it up with arguments. I feel this is the only way to actually get to a healthy codebase.

Copy link
Member

@cecilia-donnelly cecilia-donnelly left a comment

Choose a reason for hiding this comment

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

I had some pending comments - I will leave those here since @aasandei-vsp has already done such a thorough review!

stelaFolder.children ??= [];
const childFolderVOs = stelaFolder.children
.filter((child): child is StelaFolder => !isStelaRecord(child))
.map(convertStelaFolderToFolderVO);
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to have a limit on how deeply we recurse? I suppose not since we need folders to work all the way down. Maybe a better question is: "does this recurse all the way down the children of a folder and do we need it to do that?"

Copy link
Contributor Author

@slifty slifty Sep 30, 2025

Choose a reason for hiding this comment

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

We could prevent a second layer just in defensive spirit -- but this also begs the question about the data stela returns (I assume folders in stela are shallow?)

PHP doesn't provide full depth right (i.e. our components are already assuming child folders need to be loaded?) <-- I will check.

thumbURL2000: stelaFolder.thumbnailUrls['2000'],
thumbDT: stelaFolder.displayTimestamp,
thumbnail256: stelaFolder.thumbnailUrls['256'],
thumbnail256CloudPath: stelaFolder.thumbnailUrls['256'],
Copy link
Member

Choose a reason for hiding this comment

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

Do you know why we have both of these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's in the VO (not sure if both are actually used but I suppose therein lies the ultimate desire to move from VOs!)

public thumbnail256: string;
public thumbnail256CloudPath: string;

status: stelaFolder.status,
publicDT: stelaFolder.publicAt,
parentFolderId: stelaFolder.parentFolder.id,
pathAsText: stelaFolder.paths.names,
Copy link
Member

Choose a reason for hiding this comment

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

(note to self) Plural?

@slifty slifty force-pushed the PER-10107-use-record-get-v2 branch 2 times, most recently from d67a8f3 to 685be13 Compare September 30, 2025 18:17
@slifty slifty force-pushed the PER-10107-use-folder-get-stela branch from c43a07c to b8b7fb5 Compare September 30, 2025 18:45
Base automatically changed from PER-10107-use-record-get-v2 to main September 30, 2025 21:49
This continues our migration away from the PHP api / into stela.
Similar to the work around get record we want to decouple the actual API
calls from our component implementations.  Once we're fully onto Stela
we can update our components to use the stela data format.
@slifty slifty force-pushed the PER-10107-use-folder-get-stela branch from b8b7fb5 to 3c5811e Compare October 6, 2025 16:15
Copy link
Member

@cecilia-donnelly cecilia-donnelly left a comment

Choose a reason for hiding this comment

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

So, yes, this is only used in two ways: one is to load subfolders of "Apps" (I only see these in accounts that I used for testing our Etherpad integration, which I don't have locally or in dev). Even if we break that, I'm not too worried about it. The basic left menu I can confirm is loading.

The other place is to get folder thumbnails, which we only display in the public archive. This was working too, once I tried in a private window (to avoid using cached "broken" thumbnails). Looking good!

@slifty slifty merged commit 1781403 into main Oct 7, 2025
6 of 8 checks passed
@slifty slifty deleted the PER-10107-use-folder-get-stela branch October 7, 2025 19:04
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.

3 participants