Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/components/IdleView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { FEATURES } from '@/config/features'
import FreePlayPicker from '@/components/FreePlayPicker.vue'
import SubStageProgressBar from '@/components/SubStageProgressBar.vue'
import TheoryModal from '@/components/TheoryModal.vue'
import { formatQualityLabel, isChordSymbolQuality } from '@/music/display'
import type { ChordQuality } from '@/music/data/chords'
import type { ScaleMode } from '@/music/data/scales'
import type { IntervalGroup } from '@/music/data/intervals'
Expand All @@ -33,6 +34,11 @@ const quality = computed(() => progressStore.currentLearningQuality() ?? 'major'

const progressRatio = computed(() => progressStore.progressRatio(quality.value))

const qualityLabel = computed(() => {
const label = formatQualityLabel(quality.value)
return isChordSymbolQuality(quality.value) ? label : label.replace(/\b\w/g, (c) => c.toUpperCase())
})

function setMode(mode: 'learn' | 'freePlay'): void {
progressStore.setIdleMode(mode)
}
Expand Down Expand Up @@ -98,7 +104,7 @@ function onStageOpen(stageIndex: number): void {
<template v-if="idleMode === 'learn'">
<div class="learning-position">{{ stageName }}</div>
<div class="quality-label">
<span>Quality: {{ quality }}</span>
<span>Quality: {{ qualityLabel }}</span>
<button
v-if="FEATURES.THEORY_MODAL"
class="info-btn"
Expand Down Expand Up @@ -235,7 +241,6 @@ function onStageOpen(stageIndex: number): void {
gap: 0.5rem;
font-size: 1rem;
font-weight: 600;
text-transform: capitalize;
}

.info-btn {
Expand Down
11 changes: 9 additions & 2 deletions src/components/__tests__/IdleView.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,22 @@ describe('IdleView', () => {
it('shows quality matching current learning position', () => {
const wrapper = mountView()
// Default position is stage 1, subStage 1 → 'seconds' (Interval Basics SS-1)
expect(wrapper.text()).toContain('seconds')
expect(wrapper.text()).toContain('Seconds')
})

it('shows updated quality when learning position advances', async () => {
const progress = useProgressStore()
progress.state.learning = { stage: 1, subStage: 2 }
const wrapper = mountView()
// stage 1, subStage 2 → 'thirds' (Interval Basics SS-2)
expect(wrapper.text()).toContain('thirds')
expect(wrapper.text()).toContain('Thirds')
})

it('keeps minor tetrad symbols lowercase in the quality label (m7b5)', () => {
const progress = useProgressStore()
progress.state.learning = { stage: 3, subStage: 5 }
const wrapper = mountView()
expect(wrapper.text()).toContain('Quality: ø7')
})

it('reflects accumulatedScore progress in the progress bar', async () => {
Expand Down