refactor(setup): remove redundant media library step from wizard

The media library path is now taken directly from the downloader path
field, eliminating the unnecessary separate step.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Estrella Pan
2026-01-26 20:11:44 +01:00
parent 4488a89391
commit 2fb82a5a27
5 changed files with 2 additions and 125 deletions

View File

@@ -1,100 +0,0 @@
<script lang="ts" setup>
const { t } = useMyI18n();
const setupStore = useSetupStore();
const { mediaData } = storeToRefs(setupStore);
</script>
<template>
<ab-container :title="t('setup.media.title')" class="wizard-step">
<div class="step-content">
<p class="step-subtitle">{{ t('setup.media.subtitle') }}</p>
<div class="form-fields">
<ab-label :label="t('setup.media.path')">
<input
v-model="mediaData.path"
type="text"
placeholder="/downloads/Bangumi"
class="setup-input setup-input-wide"
/>
</ab-label>
</div>
<p class="path-hint">{{ t('setup.media.path_hint') }}</p>
<div class="wizard-actions">
<ab-button size="small" type="secondary" @click="setupStore.prevStep()">
{{ t('setup.nav.previous') }}
</ab-button>
<ab-button size="small" @click="setupStore.nextStep()">
{{ t('setup.nav.next') }}
</ab-button>
</div>
</div>
</ab-container>
</template>
<style lang="scss" scoped>
.wizard-step {
width: 100%;
}
.step-content {
display: flex;
flex-direction: column;
gap: 16px;
}
.step-subtitle {
font-size: 12px;
color: var(--color-text-muted);
margin: 0;
}
.form-fields {
display: flex;
flex-direction: column;
gap: 12px;
}
.setup-input {
outline: none;
min-width: 0;
width: 200px;
height: 28px;
padding: 0 12px;
font-size: 12px;
text-align: right;
border-radius: 6px;
border: 1px solid var(--color-border);
background: var(--color-surface);
color: var(--color-text);
transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
&:hover {
border-color: var(--color-primary);
}
&:focus {
border-color: var(--color-primary);
box-shadow: 0 0 0 2px rgba(108, 74, 182, 0.2);
}
}
.setup-input-wide {
width: 260px;
}
.path-hint {
font-size: 11px;
color: var(--color-text-muted);
margin: 0;
}
.wizard-actions {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 8px;
}
</style>

View File

@@ -1,7 +1,7 @@
<script lang="ts" setup>
const { t } = useMyI18n();
const setupStore = useSetupStore();
const { accountData, downloaderData, rssData, mediaData, notificationData, isLoading } =
const { accountData, downloaderData, rssData, notificationData, isLoading } =
storeToRefs(setupStore);
const router = useRouter();
const message = useMessage();
@@ -57,14 +57,6 @@ function maskPassword(pwd: string): string {
</div>
</div>
<div class="review-section">
<h4>{{ t('setup.media.title') }}</h4>
<div class="review-item">
<span class="review-label">{{ t('setup.media.path') }}</span>
<span class="review-value">{{ mediaData.path }}</span>
</div>
</div>
<div v-if="!rssData.skipped && rssData.url" class="review-section">
<h4>{{ t('setup.rss.title') }}</h4>
<div class="review-item">

View File

@@ -18,7 +18,6 @@ const { steps } = setupStore;
<wizard-step-account v-else-if="currentStep === 'account'" />
<wizard-step-downloader v-else-if="currentStep === 'downloader'" />
<wizard-step-rss v-else-if="currentStep === 'rss'" />
<wizard-step-media v-else-if="currentStep === 'media'" />
<wizard-step-notification v-else-if="currentStep === 'notification'" />
<wizard-step-review v-else-if="currentStep === 'review'" />
</wizard-container>

View File

@@ -6,7 +6,6 @@ export const useSetupStore = defineStore('setup', () => {
'account',
'downloader',
'rss',
'media',
'notification',
'review',
];
@@ -37,10 +36,6 @@ export const useSetupStore = defineStore('setup', () => {
skipped: false,
});
const mediaData = reactive({
path: '/downloads/Bangumi',
});
const notificationData = reactive({
enable: false,
type: 'telegram',
@@ -75,11 +70,6 @@ export const useSetupStore = defineStore('setup', () => {
}
}
// Sync media path with downloader path
function syncMediaPath() {
mediaData.path = downloaderData.path;
}
// Build final request
function buildCompleteRequest(): SetupCompleteRequest {
return {
@@ -89,7 +79,7 @@ export const useSetupStore = defineStore('setup', () => {
downloader_host: downloaderData.host,
downloader_username: downloaderData.username,
downloader_password: downloaderData.password,
downloader_path: mediaData.path,
downloader_path: downloaderData.path,
downloader_ssl: downloaderData.ssl,
rss_url: rssData.skipped ? '' : rssData.url,
rss_name: rssData.skipped ? '' : rssData.name,
@@ -113,7 +103,6 @@ export const useSetupStore = defineStore('setup', () => {
ssl: false,
});
Object.assign(rssData, { url: '', name: '', skipped: false });
Object.assign(mediaData, { path: '/downloads/Bangumi' });
Object.assign(notificationData, {
enable: false,
type: 'telegram',
@@ -136,13 +125,11 @@ export const useSetupStore = defineStore('setup', () => {
accountData,
downloaderData,
rssData,
mediaData,
notificationData,
validation,
nextStep,
prevStep,
goToStep,
syncMediaPath,
buildCompleteRequest,
$reset,
};

View File

@@ -51,6 +51,5 @@ export type WizardStep =
| 'account'
| 'downloader'
| 'rss'
| 'media'
| 'notification'
| 'review';