Skip to content

feat(ui): relative time display — timeAgo helper across lists (v1.17 B) - #42

Merged
argszero merged 1 commit into
mainfrom
feat/ui-ue-deep-polish-2-timeago
Aug 17, 2026
Merged

argszero merged 1 commit into
mainfrom
feat/ui-ue-deep-polish-2-timeago

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Rant 2026-08-17T16:57:17 (UI/UE 多角度深化优化), item B — 相对时间显示: replace absolute MM-DD HH:mm timestamps with relative time across all lists, with the full absolute time available on hover (title attribute).

Changes

  • New helpers in ui/js/app.js:
    • timeAgo(s) — formats 刚刚 / N 分钟前 / N 小时前 / 昨天 / MM-DD; supports MM-DD HH:mm (assumes current year) and YYYY-MM-DD[ HH:mm]; non-standard input returned as-is;
    • timeCell(s) — outputs a .timeago cell with title = full absolute time (hover).
  • Applied uniformly (rant B: 交易列表、申请列表、共享列表):
    • Transactions table 时间 column → timeCell
    • Raise-request (加额申请) list time → timeCell
    • Sharing list: new 上架时间 column (added time field to SHARINGS mock data; header + empty-state row count updated)
    • API Key 最近使用时间 (last) → timeCell (same absolute-time pattern, unified)
  • CSS: .timeago { white-space: nowrap; cursor: help; }
  • Docs: docs/user-stories.md v1.17 changelog adds item B; ui/README.md 时间显示约定 section.

Acceptance

Relative time visible in all three named lists; hover shows full time via title.

Tests

  • node --check on app.js + data.js — syntax OK
  • 13 unit cases for timeAgo (刚刚/分钟/小时/昨天/MM-DD, both date formats, bad input) — all PASS
  • DOM-stub smoke init — no ReferenceError
  • cargo test — 1 passed
  • cargo fmt --check — clean

@argszero
argszero merged commit 738d526 into main Aug 17, 2026
1 check passed
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.

1 participant