Repository navigation
refactor(mosaic): resolve the open profile page with one shared controller - #10530
alexcarpenter merged 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 5d209b6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
7731e2f
into
austin/mosaic-profile-stale-page
Description
Stacked on #10508. Follow-up from a review of that PR.
#10508 tracks the open profile page in two places:
ProfilePagesViewfalls back to the first listed page, and two new controllers each rebuilt the page list to find a stale page. This keeps the fix and has both profiles use one controller and one page list.useProfilePagesController(initialPage, pageIds)inprofile-pages/replacesuseOrganizationProfileControlleranduseUserProfileController. WhenpageIdsdoesn't include the open page, it stores the first ID.undefinedmeans the navigation is still loading, so nothing resets.organizationProfileNavEntriesanduserProfileNavEntriesbuild the page list once in the layout files. The views and the ID helpers (organizationProfilePageIds,userProfilePageIds) both use them.{ status: 'loading' | 'hidden' | 'ready' }union and the'ready' as constinCombinedUserProfileView. The organization page list is now just optional.OrganizationProfilePageListOptionsmoves fromorganization-profile.view.tsxtoorganization-profile.types.ts, so the layout file no longer imports from the view.One change in stored state, read from the code and not covered by its own test: the controller now also replaces an unlisted account page and runs in
mode='user'. Before, onlyorganization/pages were replaced.ProfilePagesViewalready showed the first listed page in those cases, so what users see doesn't change.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change