Add daily report calendar to the header

This commit is contained in:
Wyndham ARR committed 2026-10-09 13:20:13 +08:00
1 parent 2a54838d59
commit 4356160cc9
11 files changed
+735 -28

No files matched your search

@@ -0,0 +1,66 @@
# Task: 顶部报表日历与有效日报日期展示
## Identity
- Task ID: 20261009-report-calendar-d19a
- Mode: Feature
- Branch: codex/20261009-report-calendar-d19a-report-calendar
- Worktree: /Users/chillishark/.codex/worktrees/arr-report-calendar
- Base commit: 2a54838d59466139c41a9c7fe79593242d6da982
- Owner: codex
- Status: Ready for Integration
## Scope
- Replace the daily header processing-duration card with an always-visible report calendar after ARRIVAL DATE and NO. OF ROOM. Default to current business month, distinguish effective generated/ungenerated dates, support month browsing and selecting a date without acquiring/processing data.
## Intent And Constraints
- Preserve current blue/white product style, shared XML/OHIP business rules, valid daily-version identity, authenticated read-only APIs and original tasks/data. Only an actual current effective daily report counts as generated; historical/deleted/pending-only records do not. Pending replacement retains generated status if a current daily exists. Month/date viewing never submits acquisition. Preserve unsaved review decisions and concurrency guards. No Oracle calls or actual report mutation. Safely activate only with no active task; prior repository publication authorization persists.
## Outcome
- Header now presents automatic download, XML upload, ARRIVAL DATE, NO. OF ROOM and Reports in that order. The header duration card is removed; daily history duration remains available.
- The calendar defaults to the Bangkok business month, browses months, shows full-month effective report coverage and selects a date for read-only overview/list viewing. Current accepted/succeeded, non-retired reports count as generated even with zero rooms or a pending replacement; pending-only, historical and deleted-only versions do not. Loading/error states remain unknown, with retry.
- Three locales, visible status labels, keyboard month/date navigation, focus/selected/today states and responsive layouts are implemented. Independent calendar loading does not depend on daily-list pagination or add a polling timer.
- Date selection is protected against unsaved prices, active submissions/reviews, stale month responses and same-date environment changes. XML upload and price/field review completion restore calendar availability immediately. Independent review found and verified fixes for two concurrency/busy-state defects before activation.
- Local 8875 now runs this retained worktree. Activation changed only the launcher/project paths, with a cold backup at /Users/chillishark/Library/Application Support/ARR2.0/report-calendar-backup-20261009-051154. Schema remains 008-022, with no business-data mutation or Oracle query. Repository publication is authorized to arr0918/main; the final push receipt is stored privately after publication.
## Verification
- 132 JavaScript UI tests passed, including 27 new calendar cases for effective coverage, empty/leap months, incomplete/error/late responses, safe selection, unsaved prices, environment changes, refresh after generation/deletion, XML upload and review completion/cancellation/failure.
- 15 relevant daily visual/price-review static checks passed; 4 readonly preview tests passed. JavaScript syntax and git diff --check passed.
- Independent readonly review closed both identified defects and reconfirmed GET-only selection, current-report authority, and unchanged XML/OHIP/monthly processing rules.
- Browser proof: isolated readonly synthetic fixtures confirmed default October, September current/pending/history differences, calendar/list date synchronization, English/Thai Gregorian labels, keyboard crossing October31 to November1 and a complete empty month. Actual CSS widths 375, 767 (near768), 1024 and1440 had no page horizontal overflow; mobile day targets were approximately44px.
- Actual 8875 proof: October7 generated, September16/17 generated, September13/15 ungenerated. Selecting September17 shows 2026/09/17 and43 rooms and switches the daily list to September, while both existing field-review dates remain. Saved live-report-calendar.png privately under report-calendar-validation-20261009; no report download, acquisition, review submission or deletion was performed.
- Before/after private comparison preserved all27 table fingerprints, 3 current report pointers, 4896 source files, monthly workbook/API records and queue statuses. Pending field-review dates remain September15 and13; retirement audit unchanged.
- An additional existing history/task-log/BI static group has 3 stale source-string assertions already inconsistent with base2a54838 (history direct expression, old renderJobs signature, single openTaskLog call). They are not introduced by this feature; files remain unchanged. This is not a blanket full-suite success claim.
## Follow-ups
- No product work remains. Keep this worktree because the local service runs from it. Canonical memory reconciliation remains a separate serialized integration task.
## Promotion Candidates
- Target: current-state.md and portal architecture/domain memory. Proposal: record effective-report month coverage, header order without duration, read-only calendar selection, and separate viewed date/review context. Evidence: explicit user instructions, 132 JS/15 UI checks and actual8875 preservation/browser proof. Future impact: prevents historical or pending tasks from being shown as generated, and prevents future view controls from submitting acquisition. No semantic conflict with accepted processing rules; user approval of this product behavior already supplied. Feature mode records this candidate without canonical writes.
## Concurrent Task Gate
- Passed: task_context.py start exited0 and isolated task20261009-report-calendar-d19a, feature/codex, branchcodex/20261009-report-calendar-d19a-report-calendar, managed worktree/Users/chillishark/.codex/worktrees/arr-report-calendar, base2a54838d59466139c41a9c7fe79593242d6da982. status confirms ownership and peer scopes. production-review and daily-lifecycle tasks Ready for Integration, inspected read-only; current8875 runs daily-lifecycle checkout. No write overlap; dirty primary checkout untouched.
## Project Context Loaded
- Read: entry/planning gate, own task record, memory-index, positioning, current-state, decision-index, system-overview, ADR007, domain/success-criteria, evidence/commitments/stale context and both peer task Scope/Constraints/Promotion Candidates.
- Project goal: finance operator XML/OHIP inputs processed by shared deterministic rules into effective daily facts and automatically updated monthly workbooks.
- Current focus: report coverage visible as a compact header month calendar and consistent selected-date overview.
- Constraints/decisions: effective current daily pointer is authoritative; source/history/audit remain retained. Only successful new version replaces current; no changes to business scope/price/review/Finance/monthly processing. View actions remain GET-only.
- Evidence/conflicts: canonical September state is stale versus direct user instructions and completed October9 lifecycle task (hotel57106, processor4.4.0, schema022, multiple agents allowed). This task extends that completed base and does not modify canonical memory. User explicitly approved calendar direction and requested continuation.
- Modules: static index/styles/i18n/app, existing authenticated GET /api/daily-reports month list and exact-day overview, synthetic JS/readonly preview verification, private8875 launcher path.
- Unknowns: desktop card density, small-screen layout and asynchronous month/date refresh require implementation/browser proof; no business decision blocks work.
- Gate: Passed.
## Plan
1. Implement header order and accessible calendar with independent month state, whole-month effective-day reads and safe date selection.
2. Verify empty/partial months, pending/replaced/deleted days, month/year transitions, late responses and no automatic acquisition; check desktop and narrow layouts.
3. Safely update local code path while preserving current schema/data, capture browser proof, commit and push to approved repository.