diff --git a/frontend/src/MvpPanel.vue b/frontend/src/MvpPanel.vue
index 23b1d0a..13e2e21 100644
--- a/frontend/src/MvpPanel.vue
+++ b/frontend/src/MvpPanel.vue
@@ -390,7 +390,8 @@ onBeforeUnmount(() => {
- {{ h.name }}{{ habitProgressText(h) }}
+ {{ h.name }}
+ {{ habitProgressText(h) }}
{{ hideCompletedHabits && todayHabits.length ? '已完成的习惯已隐藏。' : '今天没有安排习惯,轻松一下吧。' }}
@@ -415,7 +416,8 @@ onBeforeUnmount(() => {
- {{ h.name }}{{ habitProgressText(h) }}
+ {{ h.name }}
+ {{ habitProgressText(h) }}
diff --git a/frontend/src/style.css b/frontend/src/style.css
index 59fce3e..591faf3 100644
--- a/frontend/src/style.css
+++ b/frontend/src/style.css
@@ -18,7 +18,7 @@ main{min-width:0;padding:27px 34px 50px;overflow:auto;background:linear-gradient
.habit-row.swipeable:not([style*="0px"]){transition:none}
.habit-main{flex:1;min-width:0;display:flex;align-items:center;justify-content:space-between;gap:10px;border:0;background:transparent;padding:13px 4px;text-align:left;border-radius:10px}
.habit-name{font-size:15px;font-weight:700;color:#3c372f;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
-.habit-main>span:first-child{display:grid;gap:3px}.habit-main small{font-size:11px;color:var(--muted)}
+.habit-progress{margin-left:auto;flex:0 0 auto;font-size:11px;color:var(--muted);white-space:nowrap}
.habit-row.done .habit-name{color:var(--accent);text-decoration:line-through;text-decoration-thickness:1.5px;text-decoration-color:#b99a89}
.habit-row .icon.ghost{color:#b3a795;margin-left:4px}
.habit-row .icon.ghost:hover{color:var(--danger)}
diff --git a/frontend/src/style.test.ts b/frontend/src/style.test.ts
index 385bdf2..1eab09b 100644
--- a/frontend/src/style.test.ts
+++ b/frontend/src/style.test.ts
@@ -114,6 +114,12 @@ describe('task and habit row decoration', () => {
expect(toggleBlock).not.toContain('await loadHabits()')
})
+ it('places numeric habit progress at the far right instead of under the title', () => {
+ expect(mvpPanel.match(//g)?.length).toBe(2)
+ expect(mvpPanel).not.toContain('{{ h.name }} {
expect(mvpPanel).toContain('const hideCompletedHabits = ref(false)')
expect(mvpPanel).toContain('const visibleTodayHabits = computed')