feat: refine web analytics and history views

This commit is contained in:
Wyndham ARR
2026-08-02 12:56:22 +08:00
parent a891c0ae7a
commit 7e7470821b
37 changed files with 2088 additions and 361 deletions

View File

@@ -12,8 +12,34 @@ or historical C/O period can be generated from the current committed Finance sna
blocked. A not-yet-ended period keeps its fixed C/O cutoff and must be rerun after later source facts arrive if the final
workbook needs those facts.
## Completed On 2026-08-02
- Restored cross-month history visibility for Daily Report, monthly processing and company-channel generation history.
Each list now has an independent previous/month/next/`本月` navigator and defaults to its latest non-empty month using
authenticated read-only `GET /api/history-months`. Counts and empty states name the active month and can jump to the
latest month with records. Company `生成月份` is now visibly labeled and independent from history `查看月份`; monthly
polling follows the viewing month without changing generation contracts. A guarded live read returns July counts of
30 daily and four monthly records, while company state retains four July jobs. The full 356-test suite passes with 10
skips, and isolated Chinese/English/Thai browser QA at 1440/900/390 pixels found no page overflow. Port 8766 was
restarted under detached Screen and is `ready`; no upload, report generation, source activation or business-data write
occurred.
## Completed On 2026-07-31
- Refined the Channel BI utility surface in preserve mode: removed the visible BI panel heading and ready-state
`数据库已连接` copy while retaining the navigation label, browser metadata and semantic status dot. Compressed the
month selector to a compact control on desktop/H5, and changed task-log/logout utilities from button chrome to
low-emphasis accessible links without changing their behavior. JavaScript syntax plus focused BI, daily visual,
task-log and auth tests pass; no API or business data changed.
- Tightened the Channel BI panel's top rhythm after the heading removal: the desktop panel now starts 20px higher
relative to the shared 38px page padding, while the responsive desktop shell keeps a 10px mobile-only adjustment.
The four-tab bar, panel content and BI data behavior are unchanged; focused Web regression remains green.
- Refined the Channel BI presentation and data-range contract. Removed the BI-only CHANNEL PERFORMANCE, snapshot
watermark copy and visible TOTAL PRICE labels on desktop and H5, and added a localized 数据范围 line below the
company-sales title. The read-only analytics payload now supplies the minimum and maximum ARRIVAL coverage dates
from one repeatable-read current-version snapshot; no Finance/report business data changed. JavaScript syntax and
focused analytics/Web/UI tests pass.
- Implemented the ARR Web Chinese/English/Thai presentation layer. Desktop, H5 and login now share `arr_web/static/i18n.js` with locale selectors, localStorage/cookie preference, `html.lang`, dynamic prompt/API-error translation, Bangkok/Gregorian/Latin-digit date/number formatting and locale-aware duration/money display. The runtime preserves original source strings so switching back to Chinese is safe. `ARR Report`, operational proper nouns, business/API behavior and XLSX/monthly/company report output contracts remain unchanged. Scoped Web regression passed 61/61; full discovery still has only the pre-existing environment errors for missing `httpx`/unavailable OSS client.
- Rotated both ARR Web operator credential values in separate macOS Keychain items without recording either value in
source, launcher arguments, logs or project memory. The exact port-8766 listener was stopped by controlled SIGINT and replaced at
15:30 +08 under one detached `arr2-web-8766` Screen session. Live acceptance rejects the prior pair, accepts the new
@@ -36,8 +62,9 @@ workbook needs those facts.
API version metadata remains intact. JavaScript/HTML checks, 28 focused Web/company tests and targeted deduplication
execution pass.
- Rebuilt the company-channel report setup as a dense four-card desktop row: `上传 Excel 报表` followed by the first,
second and third C/O periods. The `报表月份` picker is a compact visually unlabeled control in the large setup
card's upper-right corner, and all period CTAs now read `生成` with responsive card-sized widths. Replaced the
second and third C/O periods. At that point the `报表月份` picker was a compact visually unlabeled control in the large
setup card's upper-right corner; the 2026-08-02 history repair later labeled it `生成月份` and moved history filtering
to its own control. All period CTAs read `生成` with responsive card-sized widths. Replaced the
browser-native generation confirm with an in-page accessible dialog showing month/period context; cancel, backdrop
and Escape dismiss without submitting, while explicit confirmation preserves the existing payload, generation polling
and business behavior. JavaScript/HTML checks, 28 focused Web/company tests, 348-test discovery and isolated
@@ -45,8 +72,9 @@ workbook needs those facts.
14:36:45 +08 and its `/healthz` endpoint returns `ready`.
- Rebalanced the company-channel setup surface for the current Finance workflow. The fixed five-company scope now sits
beside `公司渠道明细` as pale helper text, the Excel upload action is bounded to a 760px desktop rail and remains
full-width/single-column on mobile, and `刷新任务` exposes a read-only scope tooltip. `报表月份` remains the C/O
report-month selector because it drives period completeness state, history filtering and the generation payload; no report,
full-width/single-column on mobile, and `刷新任务` exposes a read-only scope tooltip. The generation month remains the
C/O report-month selector for period completeness and the generation payload; its former history-filter role was
removed by the 2026-08-02 cross-month history repair. No report,
upload or database behavior changed. JavaScript/HTML checks, 28 focused Web/company tests, 348-test discovery and
isolated 1280x720/390x844 browser QA pass with no overflow or console warnings. Port 8766 was not mutated by QA.
- Compressed the daily overview row to a compact equal-height desktop treatment. The upload card now uses a horizontal
@@ -189,9 +217,9 @@ workbook needs those facts.
four-second cadence. The current API now lists V04 active above those versions; ARR2 Web remains green and the worker
remains separate.
- ARR2 Web is active on all local interfaces at port 8766 under detached Screen session `arr2-web-8766`. The current
trusted-Wi-Fi entry is `http://192.168.3.48:8766/`; anonymous root redirects to login and `/login` plus `/healthz`
return HTTP 200. The current process restarted at 2026-07-31 15:30:04 +08 after a Keychain-only credential rotation
and loads the Booking bulk-review
trusted-Wi-Fi entry is `http://192.168.3.103:8766/`; anonymous root redirects to login and `/login` plus `/healthz`
return HTTP 200. The current process restarted at 2026-07-31 19:27:42 +08 to load the Web i18n static resources
after the source implementation; it loads the Booking bulk-review
composition; the public health check returns `ready`.
Authenticated acceptance reports database, processing, monthly reports, downloads, company reports and company-source
upload ready. At the earlier 11:30 acceptance the draft endpoint returned no open draft; this later UI task did not
@@ -235,6 +263,7 @@ workbook needs those facts.
## Verification Status
- The 2026-07-31 Web i18n implementation passed JavaScript syntax checks, a DOM/runtime locale smoke (Chinese → English → Thai → Chinese), and 61 focused ARR Web tests. A full 298-test discovery was attempted; eight import/runtime errors are environment-only (`httpx` absent and OSS client unavailable), with no i18n-related failure.
- Migration 012 passed transaction-only up/down probes, including a synthetic active publication followed by rollback.
- The 38-test monthly/migration/Web regression set passed, including real XLSX build/reopen checks.
- A clean full-suite rerun with the optional ARR1 compatibility dependency installed passed 291 tests in 108.2 seconds

View File

@@ -4,6 +4,12 @@
| Date | Task | Outcome | Docs Updated |
|---|---|---|---|
| 2026-08-02 | Restore prior-month history across Daily Report, monthly processing and company-channel detail | Added a read-only merged history-month count endpoint and three independent month navigators with latest-non-empty defaults, month-aware empty/pagination states and Chinese/English/Thai responsive copy. Company generation/history months are separate and monthly polling follows only the viewing month. A live read confirms July 30/4/4 records, 356 tests pass, isolated 1440/900/390 QA is overflow-free, and the restarted 8766 runtime is ready without business writes | Current state/history, history-visibility evidence/index, stale item, scoped planning record |
| 2026-08-02 | Diagnose missing prior-month history and design its display | Proved the data was retained: July has 30 daily jobs, 4 monthly publications and 4 company jobs, while the August-default frontend view is empty. Daily/monthly loaders hard-code the Bangkok current month; company history hides its month filtering inside generation setup. Proposed visible per-history month navigation, recent-record empty states and separation of company generation/history months; no product code, runtime or business data changed | History-visibility evidence/index, stale item, scoped planning record |
| 2026-07-31 | Tighten Channel BI top spacing | Raised the desktop BI panel by 20px toward the four-tab bar and applied a lighter 10px mobile adjustment. Other panels, tab behavior and BI data are unchanged; JavaScript syntax and 39 focused Web tests pass | Current state/history, Channel BI utility evidence |
| 2026-07-31 | Quiet the Channel BI header utilities | Removed the visible BI page heading and ready-state `数据库已连接` copy, compressed the desktop/H5 month selector, and restyled task-log/logout as low-emphasis links while preserving click behavior. JavaScript syntax plus focused BI/daily/task-log/auth tests pass; no API or business data changed | Current state/history, Channel BI utility evidence/index |
| 2026-07-31 | Remove BI labels and add actual data coverage | Removed CHANNEL PERFORMANCE, the BI snapshot watermark and visible BI TOTAL PRICE labels on desktop/H5. Added localized 数据范围 below each company-sales title, backed by additive min_arrival_date plus existing max_arrival_date values from the same read-only analytics snapshot. JavaScript syntax and focused analytics/Web/UI tests pass; no Finance/report business data changed | Current state/history, Channel BI evidence/index, channel-analytics README |
| 2026-07-31 | Restart ARR Web after Web i18n implementation | Replaced the stale port-8766 process under detached Screen `arr2-web-8766` with the current source launcher at 19:27:42 +08. Loopback and current LAN `192.168.3.103` return the expected anonymous root redirect, `/login` 200, `/healthz` 200 and `/assets/i18n.js` 200; the prior `.48` address is no longer assigned to this workstation. No upload, report generation, download or business-data mutation occurred | Current state/history, i18n implementation evidence/index, stale-items |
| 2026-07-31 | Rotate the ARR Web login credentials | Updated the two existing macOS Keychain-backed runtime values without storing them in source or process arguments, normalized the password item's account metadata and performed one controlled port-8766 restart under detached Screen. The prior pair returns 401, the new pair passes session/cookie/CSRF/logout plus desktop/H5 and all six readiness flags, and loopback/current LAN health return 200. Two read-only snapshots stayed at 30 daily jobs, 4 monthly versions and 4 company jobs; latest business records predate restart, nine focused tests pass and literal/process scans are clean. The requested password still equals the username, so the strength follow-up remains open | Current state/history, login-runtime evidence/index, stale items, commitments, scoped planning record |
| 2026-07-31 | Allow early company-channel report generation and rename period states | Removed the old time-release gate from company-channel generation. Current-month incomplete periods now generate from the current committed Finance snapshot with the existing fixed C/O cutoff; historical months can rerun, while future months remain blocked. Replaced the permission-oriented state copy with `周期未结束` / `周期已结束` and added a confirmation warning that later data requires rerun. `node --check`, Python compilation, HTML parsing, 28 focused tests and the project-venv full discovery of 348 tests with 10 skips pass; no report or business data was generated | Business rules, current state/history, evidence topic/index, scoped planning record |
| 2026-07-31 | Simplify company-channel period card labels | Removed the visible `第一期`/`第二期`/`第三期` copy and changed the three card headlines to `C/O:01-10`, `C/O:11-20`, plus a month-aware final range (`C/O:21-30` or `C/O:21-31`). Release status and opening time remain visible; internal period keys and generation requests are unchanged. JavaScript/HTML checks, 28 focused tests, 348-test discovery and isolated 1280×720/390×844 browser QA pass with no overflow or page-console warnings | Current state/history, module map, company-period evidence/index |