From 1cfbefff021c8e526c40a4401f3a4fda1597754d Mon Sep 17 00:00:00 2001 From: "Calum H." Date: Tue, 17 Mar 2026 21:49:46 +0000 Subject: [PATCH] fix: various fixes related to content tab on app and panel (#5605) * fix: content filtering client only * fix: browse content bug Fixes #5570 * fix: Applying Mods & Updates filters at the same time doesn't work Fixes #5602 * fix: Browsing content: going back resets filters and installed state Fixes #5598 * fix: Mod tile background flickers when toggling enabled/disabled state Fixes #5600 * fix: Overhaul of "Content" tab on instances broke a lot Fixes #5567 * fix: Latest App update replacing all mods icons with a datapack/rescourcepack Fixes #5556 * fix: billing page api-client ditch useBaseFetch * fix: remove org icon from project card items * fix: lint --- apps/app-frontend/src/pages/Browse.vue | 19 ++++------- apps/app-frontend/src/pages/instance/Mods.vue | 24 ++++++++++---- .../frontend/src/pages/admin/billing/[id].vue | 28 +++++++++------- .../components/ContentCardItem.vue | 9 ++--- .../composables/content-filtering.ts | 33 ++++++++++++------- .../src/layouts/shared/content-tab/layout.vue | 1 + .../content-tab/providers/content-manager.ts | 3 ++ .../wrapped/hosting/manage/content.vue | 5 +-- 8 files changed, 72 insertions(+), 50 deletions(-) diff --git a/apps/app-frontend/src/pages/Browse.vue b/apps/app-frontend/src/pages/Browse.vue index fddfe84fd..ce2f8502e 100644 --- a/apps/app-frontend/src/pages/Browse.vue +++ b/apps/app-frontend/src/pages/Browse.vue @@ -109,6 +109,10 @@ const instanceHideInstalled = ref(false) const newlyInstalled = ref([]) const isServerInstance = ref(false) +const allInstalledIds = computed( + () => new Set([...newlyInstalled.value, ...(installedProjectIds.value ?? [])]), +) + const PERSISTENT_QUERY_PARAMS = ['i', 'ai'] await initInstanceContext() @@ -485,17 +489,8 @@ async function refreshSearch() { link: `/browse/${projectType.value}`, query: params, }) - const queryString = Object.entries(params) - .flatMap(([key, value]) => { - const values = Array.isArray(value) ? value : [value] - return values - .filter((v): v is string => v != null) - .map((v) => `${encodeURIComponent(key)}=${encodeURIComponent(v)}`) - }) - .join('&') - const newUrl = `${route.path}${queryString ? '?' + queryString : ''}` - debugLog('updating URL', newUrl) - window.history.replaceState(window.history.state, '', newUrl) + debugLog('updating URL', params) + router.replace({ path: route.path, query: params }) loading.value = false debugLog('refreshSearch complete', { version }) @@ -947,7 +942,7 @@ previousFilterState.value = JSON.stringify({ loader.supported_project_types?.includes(projectType), ), ]" - :installed="result.installed || newlyInstalled.includes(result.project_id || '')" + :installed="result.installed || allInstalledIds.has(result.project_id || '')" @install=" (id) => { newlyInstalled.push(id) diff --git a/apps/app-frontend/src/pages/instance/Mods.vue b/apps/app-frontend/src/pages/instance/Mods.vue index a6e331698..c3244a3ea 100644 --- a/apps/app-frontend/src/pages/instance/Mods.vue +++ b/apps/app-frontend/src/pages/instance/Mods.vue @@ -781,11 +781,17 @@ provideContentManager({ linkedModpackProject.value ? { project: linkedModpackProject.value, - projectLink: `/project/${linkedModpackProject.value.slug ?? linkedModpackProject.value.id}`, + projectLink: { + path: `/project/${linkedModpackProject.value.slug ?? linkedModpackProject.value.id}`, + query: { i: props.instance.path }, + }, version: linkedModpackVersion.value ?? undefined, versionLink: linkedModpackProject.value && linkedModpackVersion.value - ? `/project/${linkedModpackProject.value.slug ?? linkedModpackProject.value.id}/version/${linkedModpackVersion.value.id}` + ? { + path: `/project/${linkedModpackProject.value.slug ?? linkedModpackProject.value.id}/version/${linkedModpackVersion.value.id}`, + query: { i: props.instance.path }, + } : undefined, owner: linkedModpackOwner.value ? { @@ -808,7 +814,7 @@ provideContentManager({ isPackLocked, isBusy: isInstanceBusy, isBulkOperating, - getItemId: (item) => item.file_name, + getItemId: (item) => item.file_path ?? item.file_name, contentTypeLabel: ref(formatMessage(messages.contentTypeProject)), toggleEnabled: toggleDisableMod, bulkEnableItems: (items) => @@ -832,14 +838,16 @@ provideContentManager({ dismissContentHint, shareItems: handleShareItems, mapToTableItem: (item) => ({ - id: item.file_name, + id: item.file_path ?? item.file_name, project: item.project ?? { id: item.file_name, slug: null, title: item.file_name.replace('.disabled', ''), icon_url: null, }, - projectLink: item.project?.id ? `/project/${item.project.id}` : undefined, + projectLink: item.project?.id + ? { path: `/project/${item.project.id}`, query: { i: props.instance.path } } + : undefined, version: item.version ?? { id: item.file_name, version_number: formatMessage(messages.unknownVersion), @@ -847,7 +855,10 @@ provideContentManager({ }, versionLink: item.project?.id && item.version?.id - ? `/project/${item.project.id}/version/${item.version.id}` + ? { + path: `/project/${item.project.id}/version/${item.version.id}`, + query: { i: props.instance.path }, + } : undefined, owner: item.owner ? { @@ -857,6 +868,7 @@ provideContentManager({ : undefined, enabled: item.enabled, }), + filterPersistKey: props.instance.path, }) await initProjects() diff --git a/apps/frontend/src/pages/admin/billing/[id].vue b/apps/frontend/src/pages/admin/billing/[id].vue index 2b8387d63..98fafd551 100644 --- a/apps/frontend/src/pages/admin/billing/[id].vue +++ b/apps/frontend/src/pages/admin/billing/[id].vue @@ -137,12 +137,12 @@ class="mb-4 flex items-center justify-between border-0 border-b border-solid border-divider pb-4" >
- -

{{ user.username }}'s subscriptions

+ +

{{ user?.username }}'s subscriptions

- +