Skip to content

Commit 3dad6b3

Browse files
ProspectorGaming32AlexTMjugador
authored
MR App 0.9.5 - Big bugfix update (#3585)
* Add launcher_feature_version to Profile * Misc fixes - Add typing to theme and settings stuff - Push instance route on creation from installing a modpack - Fixed servers not reloading properly when first added * Make old instances scan the logs folder for joined servers on launcher startup * Create AttachedWorldData * Change AttachedWorldData interface * Rename WorldType::World to WorldType::Singleplayer * Implement world display status system * Fix Minecraft font * Fix set_world_display_status Tauri error * Add 'Play instance' option * Add option to disable worlds showing in Home * Fixes - Fix available server filter only showing if there are some available - Fixed server and singleplayer filters sometimes showing when there are only servers or singleplayer worlds - Fixed new worlds not being automatically added when detected - Rephrased Jump back into worlds option description * Fixed sometimes more than 6 items showing up in Jump back in * Fix servers.dat issue with instances you haven't played before * Fix too large of bulk requests being made, limit max to 800 #3430 * Add hiding from home page, add types to Mods.vue * Make recent worlds go into grid when display is huge * Fix lint * Remove redundant media query * Fix protocol version on home page, and home page being blocked by pinging servers * Clippy fix * More Clippy fixes * Fix Prettier lints * Undo `from_string` changes --------- Co-authored-by: Josiah Glosson <soujournme@gmail.com> Co-authored-by: Alejandro González <me@alegon.dev>
1 parent 4a2605b commit 3dad6b3

File tree

123 files changed

+1600
-722
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+1600
-722
lines changed

Cargo.lock

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/app-frontend/src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { useLoading, useTheming } from '@/store/state'
2424
import ModrinthAppLogo from '@/assets/modrinth_app.svg?component'
2525
import AccountsCard from '@/components/ui/AccountsCard.vue'
2626
import InstanceCreationModal from '@/components/ui/InstanceCreationModal.vue'
27-
import { get } from '@/helpers/settings'
27+
import { get } from '@/helpers/settings.ts'
2828
import Breadcrumbs from '@/components/ui/Breadcrumbs.vue'
2929
import RunningAppBar from '@/components/ui/RunningAppBar.vue'
3030
import SplashScreen from '@/components/ui/SplashScreen.vue'

apps/app-frontend/src/assets/stylesheets/global.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,31 @@
77
font-style: normal;
88
font-display: swap;
99
font-weight: 400;
10-
src: url('https://cdn.modrinth.com/fonts/minecraft/regular.otf') format('opentype');
10+
src: url('https://cdn-raw.modrinth.com/fonts/minecraft/regular.otf') format('opentype');
1111
}
1212

1313
@font-face {
1414
font-family: 'bundled-minecraft-font-mrapp';
1515
font-style: italic;
1616
font-display: swap;
1717
font-weight: 400;
18-
src: url('https://cdn.modrinth.com/fonts/minecraft/italic.otf') format('opentype');
18+
src: url('https://cdn-raw.modrinth.com/fonts/minecraft/italic.otf') format('opentype');
1919
}
2020

2121
@font-face {
2222
font-family: 'bundled-minecraft-font-mrapp';
2323
font-style: normal;
2424
font-display: swap;
2525
font-weight: 600;
26-
src: url('https://cdn.modrinth.com/fonts/minecraft/bold.otf') format('opentype');
26+
src: url('https://cdn-raw.modrinth.com/fonts/minecraft/bold.otf') format('opentype');
2727
}
2828

2929
@font-face {
3030
font-family: 'bundled-minecraft-font-mrapp';
3131
font-style: italic;
3232
font-display: swap;
3333
font-weight: 600;
34-
src: url('https://cdn.modrinth.com/fonts/minecraft/bold-italic.otf') format('opentype');
34+
src: url('https://cdn-raw.modrinth.com/fonts/minecraft/bold-italic.otf') format('opentype');
3535
}
3636

3737
.font-minecraft {

apps/app-frontend/src/components/ui/ErrorModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { ref, computed } from 'vue'
1414
import { login as login_flow, set_default_user } from '@/helpers/auth.js'
1515
import { handleError } from '@/store/notifications.js'
1616
import { handleSevereError } from '@/store/error.js'
17-
import { cancel_directory_change } from '@/helpers/settings.js'
17+
import { cancel_directory_change } from '@/helpers/settings.ts'
1818
import { install } from '@/helpers/profile.js'
1919
import { trackEvent } from '@/helpers/analytics'
2020
import ModalWrapper from '@/components/ui/modal/ModalWrapper.vue'

apps/app-frontend/src/components/ui/InstanceCreationModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<ModalWrapper ref="modal" header="Create instance">
2+
<ModalWrapper ref="modal" header="Creating an instance">
33
<div class="modal-header">
44
<Chips v-model="creationType" :items="['custom', 'from file', 'import from launcher']" />
55
</div>

apps/app-frontend/src/components/ui/SearchCard.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,11 @@ import dayjs from 'dayjs'
124124
import relativeTime from 'dayjs/plugin/relativeTime'
125125
import { ref, computed } from 'vue'
126126
import { install as installVersion } from '@/store/install.js'
127+
import { useRouter } from 'vue-router'
127128
dayjs.extend(relativeTime)
128129
130+
const router = useRouter()
131+
129132
const props = defineProps({
130133
backgroundImage: {
131134
type: String,
@@ -168,6 +171,9 @@ async function install() {
168171
installing.value = false
169172
emit('install', props.project.project_id ?? props.project.id)
170173
},
174+
(profile) => {
175+
router.push(`/instance/${profile}`)
176+
},
171177
)
172178
}
173179

apps/app-frontend/src/components/ui/install_flow/InstallConfirmModal.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,17 @@ const confirmModal = ref(null)
1313
const installing = ref(false)
1414
1515
const onInstall = ref(() => {})
16+
const onCreateInstance = ref(() => {})
1617
1718
defineExpose({
18-
show: (projectVal, versionIdVal, callback) => {
19+
show: (projectVal, versionIdVal, callback, createInstanceCallback) => {
1920
project.value = projectVal
2021
versionId.value = versionIdVal
2122
installing.value = false
2223
confirmModal.value.show()
2324
2425
onInstall.value = callback
26+
onCreateInstance.value = createInstanceCallback
2527
2628
trackEvent('PackInstallStart')
2729
},
@@ -36,6 +38,7 @@ async function install() {
3638
versionId.value,
3739
project.value.title,
3840
project.value.icon_url,
41+
onCreateInstance.value,
3942
).catch(handleError)
4043
trackEvent('PackInstall', {
4144
id: project.value.id,

apps/app-frontend/src/components/ui/instance_settings/HooksSettings.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Checkbox } from '@modrinth/ui'
33
import { computed, ref, watch } from 'vue'
44
import { handleError } from '@/store/notifications'
55
import { defineMessages, useVIntl } from '@vintl/vintl'
6-
import { get } from '@/helpers/settings'
6+
import { get } from '@/helpers/settings.ts'
77
import { edit } from '@/helpers/profile'
88
import type { InstanceSettingsTabProps, AppSettings, Hooks } from '../../../helpers/types'
99

apps/app-frontend/src/components/ui/instance_settings/JavaSettings.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { handleError } from '@/store/notifications'
77
import { defineMessages, useVIntl } from '@vintl/vintl'
88
import JavaSelector from '@/components/ui/JavaSelector.vue'
99
import { get_max_memory } from '@/helpers/jre'
10-
import { get } from '@/helpers/settings'
10+
import { get } from '@/helpers/settings.ts'
1111
import type { InstanceSettingsTabProps, AppSettings, MemorySettings } from '../../../helpers/types'
1212
1313
const { formatMessage } = useVIntl()

apps/app-frontend/src/components/ui/instance_settings/WindowSettings.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Checkbox, Toggle } from '@modrinth/ui'
33
import { computed, ref, type Ref, watch } from 'vue'
44
import { handleError } from '@/store/notifications'
55
import { defineMessages, useVIntl } from '@vintl/vintl'
6-
import { get } from '@/helpers/settings'
6+
import { get } from '@/helpers/settings.ts'
77
import { edit } from '@/helpers/profile'
88
import type { AppSettings, InstanceSettingsTabProps } from '../../../helpers/types'
99

apps/app-frontend/src/components/ui/modal/AppSettingsModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { version as getOsVersion, platform as getOsPlatform } from '@tauri-apps/
2222
import { useTheming } from '@/store/state'
2323
import FeatureFlagSettings from '@/components/ui/settings/FeatureFlagSettings.vue'
2424
import ModalWrapper from '@/components/ui/modal/ModalWrapper.vue'
25-
import { get, set } from '@/helpers/settings'
25+
import { get, set } from '@/helpers/settings.ts'
2626
2727
const themeStore = useTheming()
2828

apps/app-frontend/src/components/ui/modal/ConfirmModalWrapper.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { ref } from 'vue'
33
import { ConfirmModal } from '@modrinth/ui'
44
import { show_ads_window, hide_ads_window } from '@/helpers/ads.js'
5-
import { useTheming } from '@/store/theme.js'
5+
import { useTheming } from '@/store/theme.ts'
66
77
const themeStore = useTheming()
88

apps/app-frontend/src/components/ui/modal/ModalWrapper.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { ref } from 'vue'
33
import { NewModal as Modal } from '@modrinth/ui'
44
import { show_ads_window, hide_ads_window } from '@/helpers/ads.js'
5-
import { useTheming } from '@/store/theme.js'
5+
import { useTheming } from '@/store/theme.ts'
66
77
const themeStore = useTheming()
88

apps/app-frontend/src/components/ui/modal/ShareModalWrapper.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { ref } from 'vue'
33
import { ShareModal } from '@modrinth/ui'
44
import { show_ads_window, hide_ads_window } from '@/helpers/ads.js'
5-
import { useTheming } from '@/store/theme.js'
5+
import { useTheming } from '@/store/theme.ts'
66
77
const themeStore = useTheming()
88

apps/app-frontend/src/components/ui/settings/AppearanceSettings.vue

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<script setup lang="ts">
22
import { TeleportDropdownMenu, ThemeSelector, Toggle } from '@modrinth/ui'
33
import { useTheming } from '@/store/state'
4-
import { get, set } from '@/helpers/settings'
4+
import { get, set } from '@/helpers/settings.ts'
55
import { ref, watch } from 'vue'
66
import { getOS } from '@/helpers/utils'
7+
import type { ColorTheme } from '@/store/theme.ts'
78
89
const themeStore = useTheming()
910
@@ -24,13 +25,13 @@ watch(
2425

2526
<ThemeSelector
2627
:update-color-theme="
27-
(theme) => {
28+
(theme: ColorTheme) => {
2829
themeStore.setThemeState(theme)
2930
settings.theme = theme
3031
}
3132
"
3233
:current-theme="settings.theme"
33-
:theme-options="themeStore.themeOptions"
34+
:theme-options="themeStore.getThemeOptions()"
3435
system-theme-color="system"
3536
/>
3637

@@ -80,10 +81,28 @@ watch(
8081
id="opening-page"
8182
v-model="settings.default_page"
8283
name="Opening page dropdown"
84+
class="w-40"
8385
:options="['Home', 'Library']"
8486
/>
8587
</div>
8688

89+
<div class="mt-4 flex items-center justify-between">
90+
<div>
91+
<h2 class="m-0 text-lg font-extrabold text-contrast">Jump back into worlds</h2>
92+
<p class="m-0 mt-1">Includes recent worlds in the "Jump back in" section on the Home page.</p>
93+
</div>
94+
<Toggle
95+
:model-value="themeStore.getFeatureFlag('worlds_in_home')"
96+
@update:model-value="
97+
() => {
98+
const newValue = !themeStore.getFeatureFlag('worlds_in_home')
99+
themeStore.featureFlags['worlds_in_home'] = newValue
100+
settings.feature_flags['worlds_in_home'] = newValue
101+
}
102+
"
103+
/>
104+
</div>
105+
87106
<div class="mt-4 flex items-center justify-between">
88107
<div>
89108
<h2 class="m-0 text-lg font-extrabold text-contrast">Toggle sidebar</h2>

apps/app-frontend/src/components/ui/settings/DefaultInstanceSettings.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { get, set } from '@/helpers/settings'
2+
import { get, set } from '@/helpers/settings.ts'
33
import { ref, watch } from 'vue'
44
import { get_max_memory } from '@/helpers/jre'
55
import { handleError } from '@/store/notifications'

apps/app-frontend/src/components/ui/settings/FeatureFlagSettings.vue

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,23 @@
22
import { Toggle } from '@modrinth/ui'
33
import { useTheming } from '@/store/state'
44
import { ref, watch } from 'vue'
5-
import { get, set } from '@/helpers/settings'
5+
import { get as getSettings, set as setSettings } from '@/helpers/settings.ts'
6+
import { DEFAULT_FEATURE_FLAGS, type FeatureFlag } from '@/store/theme.ts'
67
78
const themeStore = useTheming()
89
9-
const settings = ref(await get())
10-
const options = ref(['project_background', 'page_path', 'worlds_tab'])
10+
const settings = ref(await getSettings())
11+
const options = ref<FeatureFlag[]>(Object.keys(DEFAULT_FEATURE_FLAGS))
1112
12-
function getStoreValue(key: string) {
13-
return themeStore.featureFlags[key] ?? false
14-
}
15-
16-
function setStoreValue(key: string, value: boolean) {
13+
function setFeatureFlag(key: string, value: boolean) {
1714
themeStore.featureFlags[key] = value
1815
settings.value.feature_flags[key] = value
1916
}
2017
2118
watch(
2219
settings,
2320
async () => {
24-
await set(settings.value)
21+
await setSettings(settings.value)
2522
},
2623
{ deep: true },
2724
)
@@ -36,8 +33,8 @@ watch(
3633

3734
<Toggle
3835
id="advanced-rendering"
39-
:model-value="getStoreValue(option)"
40-
@update:model-value="() => setStoreValue(option, !themeStore.featureFlags[option])"
36+
:model-value="themeStore.getFeatureFlag(option)"
37+
@update:model-value="() => setFeatureFlag(option, !themeStore.getFeatureFlag(option))"
4138
/>
4239
</div>
4340
</template>

apps/app-frontend/src/components/ui/settings/PrivacySettings.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import { ref, watch } from 'vue'
3-
import { get, set } from '@/helpers/settings'
3+
import { get, set } from '@/helpers/settings.ts'
44
import { Toggle } from '@modrinth/ui'
55
import { optInAnalytics, optOutAnalytics } from '@/helpers/analytics'
66

apps/app-frontend/src/components/ui/settings/ResourceManagementSettings.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup>
22
import { Button, Slider } from '@modrinth/ui'
33
import { ref, watch } from 'vue'
4-
import { get, set } from '@/helpers/settings.js'
4+
import { get, set } from '@/helpers/settings.ts'
55
import { purge_cache_types } from '@/helpers/cache.js'
66
import { handleError } from '@/store/notifications.js'
77
import { BoxIcon, FolderSearchIcon, TrashIcon } from '@modrinth/assets'

apps/app-frontend/src/components/ui/world/InstanceItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ onUnmounted(() => {
153153
154154
<span v-if="modpack" class="flex items-center gap-1 truncate text-secondary">
155155
<router-link
156-
class="inline-flex items-center gap-1 truncate hover:underline text-secondary"
156+
class="inline-flex items-center gap-1 truncate hover:underline text-secondary smart-clickable:allow-pointer-events"
157157
:to="`/project/${modpack.id}`"
158158
>
159159
<Avatar :src="modpack.icon_url" size="16px" class="shrink-0" />

0 commit comments

Comments
 (0)