Skip to content

Add HTML dashboard report with name masking and skipped-rows CSV - #2

Merged
royalpriest merged 1 commit into
mainfrom
claude/project-thread-q90zvi
Nov 7, 2026
Merged

royalpriest merged 1 commit into
mainfrom
claude/project-thread-q90zvi

Conversation

@royalpriest

Copy link
Copy Markdown
Owner

Requested by Royal · project thread

What changed

Follow-up to #1. This builds the dashboard from the mockups. report-tool bookings.xlsx now writes one self-contained HTML file by default. It has no server and no external assets, so it opens offline in any browser.

  • Summary first: tiles for net revenue, confirmed tickets (with average), cancellation rate and loyalty share.
  • Data-quality warning: shown when rows were skipped, with a count per reason and a link to a skipped-rows table. The same list is saved as ..._skipped_rows.csv.
  • Charts: confirmed vs cancelled by route (sorted busiest first), confirmed tickets by class, and net revenue by week. All are drawn as inline SVG/CSS with geometry computed in report_tool/charts.py, so there's no charting library. Axes use whole-number steps, and every chart has a legend or direct labels, so color is never the only cue.
  • Bookings table: filter by status, search, sticky header, Export CSV of the visible rows, and Print / Save PDF.
  • Light and dark mode follow the system setting. The layout stacks on phones.
  • Privacy by default: passenger names are masked (M. G•••••••) in both HTML and text output. Full names are never written to the file unless --show-names is passed.
  • Safety: Jinja2 autoescaping, so spreadsheet text can't inject HTML or script. Cells that could run as spreadsheet formulas are neutralised in both CSV outputs.
  • New CLI options: --format html|txt|both (default html) and --show-names. The footer shows the source file's sha256 for traceability.
  • Adds the jinja2 dependency. Version bumped to 1.1.0.

Behaviour change

The default output is now HTML instead of .txt, and names are masked in the text report too. Use --format txt --show-names to get the old text output with full names.

How I checked

  • pytest: 44 passed. New tests cover HTML escaping, masking, the skipped-rows banner, the weekly series (gap filling, ignoring cancellations), chart geometry, axis ticks, the CSV formula guard, and the --format / --show-names options.
  • ruff check . and ruff format --check .: clean.
  • Rendered samples/bookings_sample.xlsx in Chromium at desktop (light and dark) and phone widths. There were no console errors. The status filter and search worked: "Cancelled" showed 8 of 60 rows, and searching "kingston" with Cancelled still selected showed 1.
  • Built a wheel and confirmed the template is packaged.

Generated by Claude Code

- New default output: one self-contained HTML file (Jinja2, inline CSS/SVG,
  no external assets) with KPI tiles, skipped-rows warning, route and class
  bar charts, weekly net revenue line, and a filterable, searchable table
- Export CSV and Print / Save PDF buttons; light and dark mode; phone layout
- Passenger names masked by default in HTML and text; --show-names opts in
- Skipped rows also saved as ..._skipped_rows.csv; formula-like cells neutralised
- --format html|txt|both; source file sha256 shown in the report footer
- Tests for escaping, masking, chart geometry and the new CLI options

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016gtNTGbmvq2DdoGC4air5K
@royalpriest royalpriest self-assigned this Nov 7, 2026
@royalpriest
royalpriest merged commit dcaa38d into main Nov 7, 2026
3 checks passed
royalpriest added a commit that referenced this pull request Nov 19, 2026
Add HTML dashboard report with name masking and skipped-rows CSV
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.

2 participants