Fetch-request source types, glass-pane create page, date formatting #18

Merged
aetos merged 6 commits from xlsx-statement-support into main 2026-08-24 20:28:19 +00:00
Owner

MR: Fetch-request source types, glass-pane create page, date formatting

Branch: xlsx-statement-supportmain
Commits: 1af0a6b231869d (6 commits)

Summary

Three related strands of UI work on the fetch-request flow, plus library-level improvements in react-openapi:

  1. Source types — the create form now offers Pdf / Xlsx / Csv / Email sources (spec-driven); legacy generic file is no longer offered for new fetch requests, and a per-request trust_fallback (amount | balance) can be set at creation.
  2. Create page redesign — the flat single-column form is now two equal-height frosted "glass" panes over a subtle brand-indigo gradient backdrop: Source & Account (account/bank above the expanding source field) and Window & Policy (start/end/pipeline/trusted). Recent fetch-request rows share the same glass recipe.
  3. Date formatting — all dates/datetimes across lists, details and display-format templates render as "24 Aug 2026" / "24 Aug 2026, 09:07" instead of raw ISO strings; datetime fields can opt into editing as a plain date picker while storing midnight.

Changes

react-openapi (library)

  • src/utils/datetime.ts (new) — zero-dep formatDate / formatDateTime (en-IN via Intl). Only ISO-shaped strings are rewritten; DD-MM-YYYY expense strings and non-dates pass through untouched. Exported from the package index.
  • Display wiring: ListCellRenderer catch-all + inline-dialog cells, InlineRefField, and applyDisplayFormat template interpolation (ISO-shaped values auto-format).
  • x-edit-as mechanism: new FieldConfig.editAs; DateField renders a date-time field with x-edit-as: date as a plain date input, normalizes inbound values to YYYY-MM-DD, and submits T00:00:00. Routing sites unchanged.

App

  • fetch-requests.models.ts: SourceType gains "csv", new CsvSource, create-side union drops FileSource.
  • FetchRequestCreate.tsx: two-pane grid layout (explicit field partitioning, grid stretch for equal heights), fixed backdrop layer, local GlassPanel helper, list rows restyled; created_at pinned right before row actions.
  • ReportList.tsx: generated date right-aligned before action buttons; outer row no longer wraps.
  • ReportViewer.tsx: header timestamp formatted via exported formatDateTime.

Verification

  • tsc -b clean at every commit.
  • Formatter behavior spot-checked: 2026-08-24T09:07:25.16800024 Aug 2026, 09:07; 01-05-2026 unchanged; Z-suffixed UTC converts to local wall time.

Deploy notes

  • Pairs with the khata-app MR (same branch name): backend supplies the Source oneOf (pdf/xlsx/csv/email), trust_fallback, and x-edit-as annotations consumed here.
  • No dependency changes; no API changes client-side beyond honoring existing spec extensions.
# MR: Fetch-request source types, glass-pane create page, date formatting **Branch:** `xlsx-statement-support` → `main` **Commits:** 1af0a6b → 231869d (6 commits) ## Summary Three related strands of UI work on the fetch-request flow, plus library-level improvements in `react-openapi`: 1. **Source types** — the create form now offers Pdf / Xlsx / Csv / Email sources (spec-driven); legacy generic `file` is no longer offered for new fetch requests, and a per-request `trust_fallback` (`amount` | `balance`) can be set at creation. 2. **Create page redesign** — the flat single-column form is now two equal-height frosted "glass" panes over a subtle brand-indigo gradient backdrop: *Source & Account* (account/bank above the expanding source field) and *Window & Policy* (start/end/pipeline/trusted). Recent fetch-request rows share the same glass recipe. 3. **Date formatting** — all dates/datetimes across lists, details and display-format templates render as `"24 Aug 2026"` / `"24 Aug 2026, 09:07"` instead of raw ISO strings; datetime fields can opt into editing as a plain date picker while storing midnight. ## Changes ### react-openapi (library) - **`src/utils/datetime.ts` (new)** — zero-dep `formatDate` / `formatDateTime` (en-IN via `Intl`). Only ISO-shaped strings are rewritten; DD-MM-YYYY expense strings and non-dates pass through untouched. Exported from the package index. - Display wiring: `ListCellRenderer` catch-all + inline-dialog cells, `InlineRefField`, and `applyDisplayFormat` template interpolation (ISO-shaped values auto-format). - **`x-edit-as` mechanism**: new `FieldConfig.editAs`; `DateField` renders a `date-time` field with `x-edit-as: date` as a plain date input, normalizes inbound values to `YYYY-MM-DD`, and submits `T00:00:00`. Routing sites unchanged. ### App - `fetch-requests.models.ts`: `SourceType` gains `"csv"`, new `CsvSource`, create-side union drops `FileSource`. - `FetchRequestCreate.tsx`: two-pane grid layout (explicit field partitioning, grid stretch for equal heights), fixed backdrop layer, local `GlassPanel` helper, list rows restyled; `created_at` pinned right before row actions. - `ReportList.tsx`: generated date right-aligned before action buttons; outer row no longer wraps. - `ReportViewer.tsx`: header timestamp formatted via exported `formatDateTime`. ## Verification - `tsc -b` clean at every commit. - Formatter behavior spot-checked: `2026-08-24T09:07:25.168000` → `24 Aug 2026, 09:07`; `01-05-2026` unchanged; `Z`-suffixed UTC converts to local wall time. ## Deploy notes - Pairs with the khata-app MR (same branch name): backend supplies the Source oneOf (pdf/xlsx/csv/email), `trust_fallback`, and `x-edit-as` annotations consumed here. - No dependency changes; no API changes client-side beyond honoring existing spec extensions.
aetos added 6 commits 2026-08-24 20:28:05 +00:00
- Source & Account / Window & Policy split into equal-height frosted panes (grid stretch, account/bank above source)
- fixed full-viewport brand-indigo gradient backdrop so blur(8px) reads as glass
- recent fetch-request rows adopt the same translucent recipe
- created_at pinned right before row actions in both lists; remaining cells wrap inside a shrinking area so the date never wraps to a left-aligned line
aetos merged commit 2dd7f64f2b into main 2026-08-24 20:28:19 +00:00
aetos deleted branch xlsx-statement-support 2026-08-24 20:28:19 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: apps/khata-ui#18
No description provided.