Skip to content

items 续期历史表格:日期/金额/类型/备注列折行,尽量不换行 - #171

Merged
todosdev[bot] merged 1 commit into
mainfrom
tds/conv-01a1a5cc-66d4-7a32-a102-81647eb97f69
Nov 4, 2026
Merged

todosdev[bot] merged 1 commit into
mainfrom
tds/conv-01a1a5cc-66d4-7a32-a102-81647eb97f69

Conversation

@todosdev

@todosdev todosdev Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The item detail page's renewal-history table wrapped its date/amount/type/note cells because it lives in the narrow left column (592px), so six columns never fit on one line.
  • Those columns are now whitespace-nowrap and the table scrolls horizontally inside its card when space is tight.
  • The renewal-history card spans both grid columns on desktop, so all six columns fit without wrapping at normal desktop widths.

Changes

  • web/src/pages/items/ItemDetailPage.tsx
    • Date / amount / type / note: whitespace-nowrap on header cells and on both the read-only and inline-edit cells.
    • Table wrapper: overflow-hidden → overflow-x-auto, so narrow windows scroll instead of squeezing cells.
    • Renewal-history section lifted out of the left column to md:col-span-2; the delete button and the summary rail get explicit grid placement, and mobile keeps its previous section order and 32px spacing (mt-8 md:mt-0).
    • Scope note: nowrap alone still needed ~675–841px of table width, so even at 1440px it would always have scrolled. The user's ask allows widening the table ("可适当增加宽度"), so the card was widened rather than the table only.
  • Diff reading tip: most of the 546 changed lines are reindentation of the moved block; git diff -w shows the 14 substantive lines.

Untouched: mobile card list, inline-edit logic, API calls, and every other page.

Testing

  • pnpm lint — 2 findings, both pre-existing and unrelated (biome schema-version note, unused import in worker/src/routes/items.ts); pnpm format:check, pnpm typecheck, pnpm build, pnpm test (301/301) all pass.
  • Headless Chrome against the built app with fixture item/payments, measuring DOM line counts and overflow:
    • 1440 / 1366 / 1280: table 924px in a 924px card, 0 horizontal scroll, every header and cell on one line (before: 592px table with date, type and note on two lines).
    • 1100: fits with no scroll; 1024: 20px scroll inside the card (173px with a deliberately long 16-character note), still no cell wrapping and no page-level overflow.
    • Inline edit row at 1280/1024: nowrap cells, inputs fit, no page overflow.
    • Mobile 390px: desktop table hidden, 3 cards unchanged, section order 编辑 → 续费 → 续期历史 → 删除 → 摘要卡 with 32px gaps.
    • Summary rail sticky behaviour matched the pre-change build at the same scroll offsets.

Add nowrap to the date, amount, type and note columns and let the table
scroll horizontally in narrow windows. The renewal-history card now spans
both grid columns on desktop so all six columns fit without wrapping.

Checkpoint: 9RxgsnfPfSW8ZxG-RiAt7
@todosdev
todosdev Bot merged commit 0035014 into main Nov 4, 2026
1 check passed
@mapxn
mapxn deleted the tds/conv-01a1a5cc-66d4-7a32-a102-81647eb97f69 branch November 8, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants