feat: integrate StarLight updates and improve font settings and skin editor loading
Some checks failed
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled
Some checks failed
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled
This commit is contained in:
@ -12,6 +12,15 @@ import SettingsSection from './SettingsSection.vue'
|
||||
const { formatMessage } = useVIntl()
|
||||
|
||||
const messages = defineMessages({
|
||||
forceUnicodeFont: {
|
||||
id: 'app.settings.defaults.force-unicode-font',
|
||||
defaultMessage: 'Force Unicode font',
|
||||
},
|
||||
forceUnicodeFontDescription: {
|
||||
id: 'app.settings.defaults.force-unicode-font-description',
|
||||
defaultMessage:
|
||||
'Use the Unicode font when initializing a new instance. Off by default; existing font settings are preserved.',
|
||||
},
|
||||
fullscreen: { id: 'app.settings.defaults.fullscreen', defaultMessage: 'Fullscreen' },
|
||||
fullscreenDescription: {
|
||||
id: 'app.settings.defaults.fullscreen-description',
|
||||
@ -205,6 +214,24 @@ watch(
|
||||
</SettingsRow>
|
||||
</SettingsSection>
|
||||
|
||||
<SettingsSection>
|
||||
<SettingsRow>
|
||||
<template #label>
|
||||
<span id="settings-target-defaults-unicode-font" tabindex="-1">
|
||||
{{ formatMessage(messages.forceUnicodeFont) }}
|
||||
</span>
|
||||
</template>
|
||||
<template #description>{{ formatMessage(messages.forceUnicodeFontDescription) }}</template>
|
||||
<template #control>
|
||||
<Toggle
|
||||
id="force-unicode-font"
|
||||
v-model="settings.force_unicode_font"
|
||||
:aria-label="formatMessage(messages.forceUnicodeFont)"
|
||||
/>
|
||||
</template>
|
||||
</SettingsRow>
|
||||
</SettingsSection>
|
||||
|
||||
<SettingsSection>
|
||||
<SettingsRow stacked>
|
||||
<template #label>
|
||||
|
||||
@ -294,7 +294,9 @@ async function loadLatestChannelVersions() {
|
||||
const versions = await Promise.all(
|
||||
(['release', 'beta'] as const).map(async (channel) => {
|
||||
try {
|
||||
const response = await tauriFetch(`https://update.axlmc.org/latest?channel=${channel}`)
|
||||
const response = await tauriFetch(
|
||||
`https://skin.starlight.cool/starlight/launcher/latest?channel=${channel}`,
|
||||
)
|
||||
if (!response.ok) return [channel, undefined] as const
|
||||
const payload = (await response.json()) as { version?: string }
|
||||
return [channel, payload.version] as const
|
||||
|
||||
@ -254,6 +254,16 @@ export const settingsSearchEntries: SettingsSearchEntry[] = [
|
||||
targetId: 'settings-target-defaults-environment',
|
||||
label: message('app.settings.defaults.environment-variables', 'Environment variables'),
|
||||
},
|
||||
{
|
||||
id: 'defaults-unicode-font',
|
||||
categoryId: 'launch-defaults',
|
||||
targetId: 'settings-target-defaults-unicode-font',
|
||||
label: message('app.settings.defaults.force-unicode-font', 'Force Unicode font'),
|
||||
description: message(
|
||||
'app.settings.defaults.force-unicode-font-description',
|
||||
'Use the Unicode font when initializing a new instance. Off by default; existing font settings are preserved.',
|
||||
),
|
||||
},
|
||||
{
|
||||
id: 'defaults-launch-hooks',
|
||||
categoryId: 'launch-defaults',
|
||||
|
||||
@ -104,6 +104,28 @@ test('settings search index has unique entries with categories', () => {
|
||||
assert.deepEqual(validateSettingsSearchEntries(), [])
|
||||
})
|
||||
|
||||
test('Unicode font is searchable in Chinese and English', () => {
|
||||
const entry = settingsSearchEntries.find((entry) => entry.id === 'defaults-unicode-font')!
|
||||
assert.equal(entry.categoryId, 'launch-defaults')
|
||||
assert.ok(
|
||||
readFileSync(new URL('./DefaultInstanceSettings.vue', import.meta.url), 'utf8').includes(
|
||||
`id="${getSettingsSearchTargetId(entry)}"`,
|
||||
),
|
||||
)
|
||||
for (const translated of [false, true]) {
|
||||
const documents = settingsSearchEntries.map((entry) => ({
|
||||
item: entry,
|
||||
text: translated
|
||||
? (chineseLocale[entry.label.id]?.message ?? entry.label.defaultMessage ?? '')
|
||||
: (entry.label.defaultMessage ?? ''),
|
||||
}))
|
||||
for (const query of translated ? ['字体', 'Unicode'] : ['font', 'Unicode']) {
|
||||
const matches = filterSettingsSearchDocuments(query, documents)
|
||||
assert.ok(matches.some(({ item }) => item.id === 'defaults-unicode-font'))
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
test('settings search keywords are valid message descriptors', () => {
|
||||
for (const entry of settingsSearchEntries) {
|
||||
for (const keyword of entry.keywords ?? []) {
|
||||
|
||||
Reference in New Issue
Block a user