Skip to content

Conversation

@tdgao
Copy link
Contributor

@tdgao tdgao commented Nov 23, 2025

Feature:

  • New create version flow, located in project settings page

Added:

  • MultiStageModal component
  • DropzoneFileInput component
  • Versions labrinth type
  • Versions labrinth calls for api-client
  • folder-up icon
  • Tailwind preset (though only used by ui package for now)

@tdgao tdgao marked this pull request as ready for review December 8, 2025 09:23
Copy link
Member

@IMB11 IMB11 left a comment

Choose a reason for hiding this comment

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

Very good! Just a few nitpicks and changes that could be considered

import AddLoadersStage from './stages/AddLoadersStage.vue'
import AddMcVersionsStage from './stages/AddMcVersionsStage.vue'
const { newDraftVersion, draftVersion, detectedLoaders, detectedVersions, projectType } =
Copy link
Member

Choose a reason for hiding this comment

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

This might better suited for DI? - see creator-withdraw.ts for an example.

const modal = useTemplateRef<InstanceType<typeof MultiStageModal>>('modal')
provide('createVersionModal', modal)
Copy link
Member

Choose a reason for hiding this comment

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

Should go through our DI framework - could merge with the manage stuff

text: 'The version has been successfully added to your project.',
type: 'success',
})
// TODO: refetch versions here for project versions table
Copy link
Member

Choose a reason for hiding this comment

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

You can use tanstack mutations for this - https://tanstack.com/query/v5/docs/framework/vue/guides/mutations

window.addEventListener('keydown', handleKeyDown)
window.addEventListener('keyup', handleKeyUp)
})
onUnmounted(() => {
Copy link
Member

Choose a reason for hiding this comment

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

const searchLoading = ref(false)
const options = ref<DropdownOption<string>[]>([])
const client = injectModrinthClient()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const client = injectModrinthClient()
const { labrinth } = injectModrinthClient()

* const results = await client.labrinth.projects_v2.search({
* query: 'optimization',
* facets: [['categories:optimization'], ['project_type:mod']],
* facets: "[['categories:optimization'], ['project_type:mod']]",
Copy link
Member

Choose a reason for hiding this comment

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

see prev comment about typing this properly

}

/**
* Request data object for Modrinth “Create Version” API.
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: Sounds counter intuitive but we haven't usually done comments for these types because the backend has comments already/it'll probably go out of date over time

Copy link
Member

Choose a reason for hiding this comment

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

@aecsocket is working on slowly adding utoipa support on labrinth, like is already done for some internal services

@@ -0,0 +1,238 @@
import type { DraftVersion } from '../../../../../../apps/frontend/src/composables/versions/manage-version'
Copy link
Member

Choose a reason for hiding this comment

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

Dont do this - put DraftVersion into api-client types

import { useRoute, useRouter } from 'vue-router'
import { PlusIcon } from '@modrinth/assets'
import { ButtonStyled } from '@modrinth/ui'
Copy link
Member

Choose a reason for hiding this comment

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

Generally we try not to use @modrinth/ui self-imports because it can sometimes cause cyclic dependencies as some of the older components are exported a bit weirdly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, so instead better to import directly like this?

import ButtonStyled from '@modrinth/ui/src/components/base/ButtonStyled.vue'

Copy link
Member

Choose a reason for hiding this comment

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

no, import { ButtonStyled } from '@modrinth/ui' - was talking about the other import

@@ -0,0 +1,267 @@
module.exports = {
Copy link
Member

Choose a reason for hiding this comment

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

Very nice!

Copy link
Member

Choose a reason for hiding this comment

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

This should probably be in packages/tooling-config though.

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.

3 participants