Skip to content

feat: content tab rewrite for worlds#5136

Open
IMB11 wants to merge 146 commits intomainfrom
cal/content-tab-rewrite-hosting
Open

feat: content tab rewrite for worlds#5136
IMB11 wants to merge 146 commits intomainfrom
cal/content-tab-rewrite-hosting

Conversation

@IMB11
Copy link
Member

@IMB11 IMB11 commented Jan 16, 2026

Summary

  • Standardizes the content management layout into a single shared ContentPageLayout component used by both the app frontend (Mods.vue) and hosting frontend (content.vue), eliminating duplicated UI code
  • Introduces a ContentManagerContext dependency injection provider that decouples platform-specific API logic from the shared layout
  • Fully migrates hosting from the v0 content API to v1, including the discover page's server install flow
  • Removes all v0 content API code (module, types, and dead ContentVersionEditModal)
  • Adds creation flow modals for server onboarding

Content page layout (ContentPageLayout.vue)

Previously, the app's Mods.vue and hosting's content.vue each 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 single ContentPageLayout component in @modrinth/ui.

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.js
  • useContentFilters - dynamic filter pills (by type, updates, disabled)
  • useContentSelection - multi-select state
  • useBulkOperation - progress tracking with navigation guards
  • useChangingItems - per-item loading states

Dependency injection (ContentManagerContext)

A new DI provider at packages/ui/src/providers/content-manager.ts defines the contract between ContentPageLayout and its platform-specific implementations. The context includes:

  • Required: items, loading, error, refresh, toggleEnabled, deleteItem, browse, uploadFiles, mapToTableItem
  • Optional (platform-specific): bulkDeleteItems, bulkEnableItems, bulkDisableItems (hosting v1 only), updateItem, bulkUpdateItem, hasUpdateSupport (app only), shareItems, getOverflowOptions, uploadState, modpack actions

This means the app's Mods.vue provides Tauri-backed handlers with update/share/export support, while hosting's content.vue provides API-backed handlers with optional bulk operations — all feeding into the same layout.

v0 → v1 content API migration

  • Hosting content.vue uses v1 endpoints (getAddons, addAddon, deleteAddon, enableAddon, disableAddon, bulk variants, unlinkModpack, updateAddon, updateModpack) with worldId support
  • Discover page (discover/[type]/index.vue) migrated from content_v0.list() / content_v0.install() to content_v1.getAddons() / content_v1.addAddon(), with worldId passed as a query param (wid) for SSR compatibility
  • Deleted ArchonContentV0Module, Archon.Content.v0 types, and the unused ContentVersionEditModal.vue (version editing is handled by InstallationSettingsLayout)
  • The v1 API is much more in-line with how we handle content in the app.

Other changes

  • New CreationFlowModal for server onboarding with loader/modpack selection
  • InstallationSettingsLayout extracted as a shared component for loader/startup configuration
  • Loader and startup options pages rewritten to use the shared layout
  • Server onboarding page (onboarding.vue) added with setup wizard flow

@IMB11 IMB11 requested a review from a team January 16, 2026 10:38
@IMB11 IMB11 added website Relates to Modrinth.com web frontend frontend Involves work from the frontend team labels Jan 16, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

@IMB11 IMB11 force-pushed the cal/content-tab-rewrite-hosting branch 5 times, most recently from 54f0a60 to e70cd2c Compare January 29, 2026 18:00
IMB11 and others added 30 commits February 27, 2026 14:36
…d client-only indicators

   Upload cancellation and navigation guard:
   - Add ConfirmLeaveModal that prompts when navigating away during upload
   - Cancel in-flight XHR uploads when user confirms leaving the page
   - Add beforeunload handler to warn on browser/tab close during upload
   - Track uploadedBytes/totalBytes in UploadState for progress display
   - Replace Collapsible with Transition for upload progress admonition
   - Show byte progress and percentage in upload banner
   - Clamp upload progress to prevent exceeding 100%

   Installation settings (server.properties):
   - Add KnownPropertiesFields and PropertiesFields types to Archon types
   - Add buildProperties() to creation flow context to collect gamemode,
     difficulty, seed, world type, structures, and generator settings
   - Pass properties through installContent on onboarding, discovery, and
     ServerSetupModal flows

   Server setup and discovery flow improvements:
   - Migrate ServerSetupModal from servers_v0.reinstall to content_v1.installContent
   - Replace loaderApiNames lookup with toApiLoader() helper
   - Remove eraseDataOnInstall toggle — always use soft_override: false
   - Simplify modpack install on discovery page to use first available version
     and route through creation flow modal for both onboarding and non-onboarding
   - Differentiate post-install navigation: content page for onboarding,
     loader options for existing servers

   Modpack update flow:
   - Replace updateModpack() call with installContent() using soft_override: true
     to support version selection in the content updater modal

   Client-only mod indicators:
   - Add environment field to AddonVersion (reuses Labrinth.Projects.v3.Environment)
   - Add environment to ContentItem and isClientOnly to ContentCardTableItem
   - Show orange TriangleAlertIcon with tooltip on client-only mods in content table
   - Add "Client-only" filter pill to content filtering (controlled via
     showClientOnlyFilter on ContentManagerContext)
   - Apply client-only indicators in both ContentPageLayout and ModpackContentModal

   Misc:
   - Add CLAUDE.md note about using prepr commands for lint checks
   - Export ConfirmLeaveModal from instances barrel
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

Labels

frontend Involves work from the frontend team website Relates to Modrinth.com web frontend

Development

Successfully merging this pull request may close these issues.

2 participants