Skip to content

refactor: browse flow impl cleanup - #8392

Open
IMB11 wants to merge 4 commits into
cal/troubleshooting-tab-instance-settingsfrom
cal/browse-flow-refactoring
Open

IMB11 wants to merge 4 commits into
cal/troubleshooting-tab-instance-settingsfrom
cal/browse-flow-refactoring

Conversation

@IMB11

@IMB11 IMB11 commented Nov 19, 2026

Copy link
Copy Markdown
Member

No description provided.

@IMB11
IMB11 added this pull request to stack #8391 November 19, 2026 17:45
@github-actions

Copy link
Copy Markdown
Contributor

Pull request changelog

App

Added

Changed

Deprecated

Removed

Fixed

Security

Website

Added

Changed

Deprecated

Removed

Fixed

Security

Hosting

Added

Changed

Deprecated

Removed

Fixed

Security

@mergify

mergify Bot commented Nov 19, 2026

Copy link
Copy Markdown

Merge Protections

🔴 1 of 1 protections blocking · waiting on ⛓️ dependency

Protection Waiting on
🔴 ⛓️ Depends-On Requirements ⛓️ dependency

🔴 ⛓️ Depends-On Requirements

Waiting for

This rule is failing.

Requirement based on the presence of `Depends-On` in the body of the pull request

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Frontend previews

Last deployed commit is 55cec6487a7c76f6ab1e08e3d672d2fa45a4bd16

Persistent

Environment URL
staging https://pr-8392.frontend-staging.rinth.dev
production https://pr-8392.frontend.rinth.dev
storybook https://pr-8392-storybook.modrinth.workers.dev

Latest commit

Environment URL
staging https://7b25709d.frontend-staging.rinth.dev
production https://98b77bd6.frontend.rinth.dev

@IMB11
IMB11 marked this pull request as ready for review November 19, 2026 18:58
@mergify

mergify Bot commented Nov 19, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request once it meets the queue conditions

@greptile-apps

greptile-apps Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[High impact] The refactor reaches browsing and server-install workflows in both the website and desktop app.

Fix failed lookup handling and satisfy the folder requirement before merging; the tab-switch issue should also be corrected.

Summary

This PR splits browsing and installation into smaller shared pieces, moves search results into TanStack Query, and adds matching headers and route animations.

  • Website and app browse pages share search controls and result displays.
  • Server content installs use a shared queue and install flow.
  • Instance and server headers show playtime and clearer details.

Reviews (1) · Last reviewed commit: "fix: standards" · Reviewed by Greptile

Comment on lines +63 to +65
export async function settleQuery<TData, TError>(query: UseQueryReturnType<TData, TError>) {
if (query.data.value !== undefined) return
await query.suspense()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Failed lookups break browsing. When an uncached target lookup fails, settleQuery() lets the rejected suspense() call escape. This reaches the page's top-level await, so setup stops before useAppBrowseManager() provides the data needed to render browsing. A failed linked-project request or server-content request can therefore break the whole page, even though the error watchers show a notification. The old setup caught these failures. Catch them here or in ready() so the page can still render.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/app-frontend/src/platform/adapters/browse/query-options.ts
Line: 63-65

Comment:
**Failed lookups break browsing.** When an uncached target lookup fails, `settleQuery()` lets the rejected `suspense()` call escape. This reaches the page's top-level `await`, so setup stops before `useAppBrowseManager()` provides the data needed to render browsing. A failed linked-project request or server-content request can therefore break the whole page, even though the error watchers show a notification. The old setup caught these failures. Catch them here or in `ready()` so the page can still render.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +186 to +192
const type = projectType.value
const search = options.searchQuery(debouncedParams.value)
return {
queryKey: [...search.queryKey, type],
queryFn: async (): Promise<TypedSearchResults> => ({
...(await search.queryFn()),
projectType: type,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Tab switches show wrong results. projectType changes immediately, but debouncedParams still contains the previous tab's search for 200 ms. This starts a request with the old filters and labels its response with the new type. If it finishes within that window, currentResults accepts it and shows the wrong projects under the new tab, including while the correct request loads. Debounce the type and parameters together, or take both from the same saved search values.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/ui/src/layouts/shared/browse-tab/composables/use-browse-view-state.ts
Line: 186-192

Comment:
**Tab switches show wrong results.** `projectType` changes immediately, but `debouncedParams` still contains the previous tab's search for 200 ms. This starts a request with the old filters and labels its response with the new type. If it finishes within that window, `currentResults` accepts it and shows the wrong projects under the new tab, including while the correct request loads. Debounce the type and parameters together, or take both from the same saved search values.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +1 to +3
import { defineMessages, type useVIntl } from '@modrinth/ui'

export const playtimeMessages = defineMessages({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 New files bypass feature folders. The app guide requires new code to use the new folder structure, even when surrounding code remains in pages/. This formatter is a new instance-specific file under the old page tree. Move it into features/instances/ and update its imports. The new instance-metadata-items.vue has the same issue.

Context Used: apps/app-frontend/AGENTS.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/app-frontend/src/pages/instance/playtime.ts
Line: 1-3

Comment:
**New files bypass feature folders.** The app guide requires new code to use the new folder structure, even when surrounding code remains in `pages/`. This formatter is a new instance-specific file under the old page tree. Move it into `features/instances/` and update its imports. The new `instance-metadata-items.vue` has the same issue.

**Context Used:** apps/app-frontend/AGENTS.md ([source](https://github.com/modrinth/code/blob/main/apps/app-frontend/AGENTS.md))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant