Skip to content

feat(ui): moves folder rendering from the client to the server #12710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jun 10, 2025

Conversation

JarrodMFlesch
Copy link
Contributor

@JarrodMFlesch JarrodMFlesch commented Jun 6, 2025

Moves folder rendering for collection-folders view, browse-by-folders view and the move-to-folder drawer. This is how the rest of payload behaves, following this same paradigm allows the feature to integrate well with other things such as the multi-tenant plugin.

Copy link
Contributor

@DanRibbens DanRibbens left a comment

Choose a reason for hiding this comment

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

I didn't get all the way through this.

* This will ensure that prefs are only updated when explicitly set by the user
* This could potentially be done by injecting a `sessionID` into the params and comparing it against a session cookie
*/
const browseByFolderPreferences = await upsertPreferences<{
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the right way to do this, new ServerFunction perhaps?

})
} catch (error) {
// eslint-disable-next-line no-console
console.error('Error moving items:', error)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this have toast the error instead of swallowing it?

Copy link
Contributor

@DanRibbens DanRibbens left a comment

Choose a reason for hiding this comment

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

Consider the couple places you had console.error adding toast. Otherwise it looks good to me.

@JarrodMFlesch JarrodMFlesch merged commit a43d1a6 into main Jun 10, 2025
77 checks passed
@JarrodMFlesch JarrodMFlesch deleted the feat/ssr-folder-views branch June 10, 2025 15:56
Copy link
Contributor

🚀 This is included in version v3.43.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants