-
Notifications
You must be signed in to change notification settings - Fork 389
feat: content tab rewrite for worlds #5136
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
Open
IMB11
wants to merge
99
commits into
main
Choose a base branch
from
cal/content-tab-rewrite-hosting
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Frontend previewsLast deployed commit is eb5a8358ed394e82fe150ba2fd09abf7fee3f06d
|
54f0a60 to
e70cd2c
Compare
Signed-off-by: Calum H. <calum@modrinth.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
ContentPageLayoutcomponent used by both the app frontend (Mods.vue) and hosting frontend (content.vue), eliminating duplicated UI codeContentManagerContextdependency injection provider that decouples platform-specific API logic from the shared layoutuseV1ContentTabAPIfeature flag, allowing the old v0 file-based API to remain as the default for nowContent page layout (
ContentPageLayout.vue)Previously, the app's
Mods.vueand hosting'scontent.vueeach maintained their own implementations of the content management UI (search, filters, sorting, bulk actions, modpack card, empty states, confirmation modals, etc.). This PR extracts all of that into a singleContentPageLayoutcomponent in@modrinth/ui(~774 lines).The layout consumes its data and actions entirely through dependency injection rather than props, so platform-specific pages only need to provide their handlers via
provideContentManager()and then render<ContentPageLayout />.Shared composables were also extracted into
packages/ui/src/composables/content/:useContentSearch- fuzzy search via Fuse.jsuseContentFilters- dynamic filter pills (by type, updates, disabled)useContentSelection- multi-select stateuseBulkOperation- progress tracking with navigation guardsuseChangingItems- per-item loading statesDependency injection (
ContentManagerContext)A new DI provider at
packages/ui/src/providers/content-manager.tsdefines the contract betweenContentPageLayoutand its platform-specific implementations. The context includes:items,loading,error,refresh,toggleEnabled,deleteItem,browse,uploadFiles,mapToTableItembulkDeleteItems,bulkEnableItems,bulkDisableItems(hosting v1 only),updateItem,bulkUpdateItem,hasUpdateSupport(app only),shareItems,getOverflowOptions,uploadState, modpack actionsThis means the app's
Mods.vueprovides Tauri-backed handlers with update/share/export support, while hosting'scontent.vueprovides API-backed handlers with optional bulk operations - all feeding into the same layout.Feature flags (v0/v1 content API)
A
useV1ContentTabAPIfeature flag inapps/frontend/src/composables/featureFlags.tscontrols which hosting content API is used:archon.content_v0- individual toggle/delete calls that rename files with.disabledsuffixarchon.content_v1- supports bulk enable/disable/delete endpoints, modpack unlinking, and the new addon modelThe hosting
content.vuepage maintains dual query instances (only one enabled at a time) and conditionally provides bulk operation handlers to the layout only when v1 is active. The flag is passed as a prop from the page wrapper:<ServersManageContentPage :use-v1-api="flags.useV1ContentTabAPI" />.