M3 · Framework UI #119

Merged
Alby96 merged 9 commits from feat/25-interfaccia into main 2026-11-11 21:00:47 +01:00
Owner

Milestone M3 (v0.3.0): la finestra di Khaemhat e tutti i mattoni con cui si costruiranno le maschere da M4 in poi, provati su un documento di sviluppo.

Cosa c'è

  • Shell e temi (#25, #26): barra superiore, menu comprimibile con sottomenu a comparsa, schede tenute in vita (massimo 12), barra di stato; token, temi chiaro/scuro/alto contrasto, otto accenti, densità; uso da telefono con barra a sole icone.
  • Testi (#33): tutti i testi in Resources/it-IT/*.json, test che vietano i testi letterali.
  • Componenti Kh* (#27, #29): campi con numeri e date all'italiana e calcolo =…, toolbar a icone su una riga, intestazione documento, RecordPage/DocumentPage/MasterDataPage con comandi e scorciatoie standard (ADR 0024).
  • Griglie e radar (#28): ListQuery/ListFields (stessa richiesta in SQL o in memoria), KhGrid virtualizzata, KhRadar con filtri salvati, ricerca F4, KhLinesGrid per le righe.
  • Dashboard e preferenze (#30, #31): widget con layout per utente e per ruolo, Personalizza, company_settings; Il mio profilo con aspetto, pagina iniziale, dati personali, password e 2FA, sessioni (ADR 0020, 0022).
  • Ricerca, aiuto, notifiche (#32): ricerca globale a fornitori, aiuto F1 dalla copia della wiki nell'immagine, pannello notifiche con letture per utente (ADR 0023).
  • Allegati e stampa (#34): archivio su volume, versioni, cestino, scrittori PDF/CSV/XLSX/ZIP in casa, pannello allegati con anteprime, ZIP, Genera file, storico, anteprima di stampa A4, indirizzi /files con CSP propria per l'anteprima inline (ADR 0021).
  • Chiusura (#36): 15 screenshot reali in docs/wiki/img/, pagine wiki dell'interfaccia complete, CHANGELOG 0.3.0, STATUS. Il confronto con i mockup ha trovato e corretto tre difetti di layout (totale documento tagliato, schede dei temi in colonna, barra superiore su telefono).

Verifica

  • Build Release con warning come errori: verde; check-packages.sh: OK.
  • Test in locale: 368 verdi, 21 di PostgreSQL saltati (girano nel job PostgreSQL della CI).
  • Immagine Docker costruita in locale e avviata da zero con SQLite: /health pronto, versione 0.3.0.
  • Prova nel browser su localhost di tutte le funzioni sopra; screenshot presi su un'istanza nuova.

Non incluso

  • #35 (PNG ad alta risoluzione dei mockup) resta aperta in attesa del titolare, non blocca.
  • Schede Layout salvati e Notifiche del profilo, invio allegati per e-mail e scanner: con M4/M5, annotati in STATUS.

Dopo il merge: tag v0.3.0, immagine e release, poi chiusura di #36.

Closes #25
Closes #26
Closes #27
Closes #28
Closes #29
Closes #30
Closes #31
Closes #32
Closes #33
Closes #34

🤖 Generated with Claude Code

Milestone M3 (v0.3.0): la finestra di Khaemhat e tutti i mattoni con cui si costruiranno le maschere da M4 in poi, provati su un documento di sviluppo. ## Cosa c'è - **Shell e temi** (#25, #26): barra superiore, menu comprimibile con sottomenu a comparsa, schede tenute in vita (massimo 12), barra di stato; token, temi chiaro/scuro/alto contrasto, otto accenti, densità; uso da telefono con barra a sole icone. - **Testi** (#33): tutti i testi in `Resources/it-IT/*.json`, test che vietano i testi letterali. - **Componenti `Kh*`** (#27, #29): campi con numeri e date all'italiana e calcolo `=…`, toolbar a icone su una riga, intestazione documento, `RecordPage`/`DocumentPage`/`MasterDataPage` con comandi e scorciatoie standard (ADR 0024). - **Griglie e radar** (#28): `ListQuery`/`ListFields` (stessa richiesta in SQL o in memoria), `KhGrid` virtualizzata, `KhRadar` con filtri salvati, ricerca `F4`, `KhLinesGrid` per le righe. - **Dashboard e preferenze** (#30, #31): widget con layout per utente e per ruolo, *Personalizza*, `company_settings`; *Il mio profilo* con aspetto, pagina iniziale, dati personali, password e 2FA, sessioni (ADR 0020, 0022). - **Ricerca, aiuto, notifiche** (#32): ricerca globale a fornitori, aiuto F1 dalla copia della wiki nell'immagine, pannello notifiche con letture per utente (ADR 0023). - **Allegati e stampa** (#34): archivio su volume, versioni, cestino, scrittori PDF/CSV/XLSX/ZIP in casa, pannello allegati con anteprime, ZIP, *Genera file*, storico, anteprima di stampa A4, indirizzi `/files` con CSP propria per l'anteprima inline (ADR 0021). - **Chiusura** (#36): 15 screenshot reali in `docs/wiki/img/`, pagine wiki dell'interfaccia complete, CHANGELOG 0.3.0, STATUS. Il confronto con i mockup ha trovato e corretto tre difetti di layout (totale documento tagliato, schede dei temi in colonna, barra superiore su telefono). ## Verifica - Build Release con warning come errori: verde; `check-packages.sh`: OK. - Test in locale: 368 verdi, 21 di PostgreSQL saltati (girano nel job PostgreSQL della CI). - Immagine Docker costruita in locale e avviata da zero con SQLite: `/health` pronto, versione 0.3.0. - Prova nel browser su `localhost` di tutte le funzioni sopra; screenshot presi su un'istanza nuova. ## Non incluso - #35 (PNG ad alta risoluzione dei mockup) resta aperta in attesa del titolare, non blocca. - Schede *Layout salvati* e *Notifiche* del profilo, invio allegati per e-mail e scanner: con M4/M5, annotati in STATUS. Dopo il merge: tag `v0.3.0`, immagine e release, poi chiusura di #36. Closes #25 Closes #26 Closes #27 Closes #28 Closes #29 Closes #30 Closes #31 Closes #32 Closes #33 Closes #34 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Alby96 added this to the M3 — Framework UI · v0.3.0 milestone 2026-11-11 20:27:06 +01:00
Alby96 added 9 commits 2026-11-11 20:27:06 +01:00
The pages built so far now live inside the shell of the mockups instead of the
M0 placeholder, every interface text comes from Resources/it-IT, and each user
keeps their own look and start page.

- Shell: top bar, collapsible side menu with fly-out sub-menus, status bar and
  tabs that keep each page alive (page type and route values per tab, so a tab
  never shows another page); at most 12 tabs, least-used clean tab evicted.
- One shortcut table with Alt variants for the combinations browsers keep
  (Ctrl+W, Ctrl+Tab, Ctrl+N); command palette for pages and commands.
- ITexts over embedded JSON; tests forbid literal texts in .razor components
  and check that every key used exists.
- User settings in sys_user_settings / user_settings; theme written on the
  server; profile page with live preview, start page, sessions and shortcuts.
- Home, coming-soon pages for later milestones, localized sign-in and error
  pages; ADR 0020; wiki, CHANGELOG, STATUS and data model updated.

Refs #25 #26 #31 #33

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Documents need attachments and generated files (SPEC 9.4) before the UI of
M3 can show them, and the spec forbids external libraries for PDF and
spreadsheets.

- VolumeFileStore keeps files under <data>/files/<COMPANY>/<yyyy>/<guid>,
  writing a .part file in the same folder with size limit and SHA-256, then
  quota and scanner checks (IFileScanner hook, no-op by default).
- attachments table (migration 007) with kind, version series, lock, trash
  and the uploading user; AttachmentService uploads, adds generated files as
  the next version, lists, opens, zips, locks, trashes, restores and purges
  after 30 days (new system job system.attachments-trash).
- FileGenerationService runs IFileGenerator implementations into the store;
  three generators for the fictitious test document (PDF, CSV, XLSX).
- CsvWriter (Italian Excel defaults, formula-injection guard), XlsxWriter,
  ZipStreamWriter and PdfWriter (standard Type1 fonts, WinAnsi, AFM widths,
  JPEG, Flate, xref) only write asynchronously, so they can stream to an
  HTTP response.
- ADR 0021 records versioning, storage layout, PDF scope and CSV defaults.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds the building blocks every later screen uses, so modules are built from
one set of components instead of ad hoc markup:

- Form components (KhForm, KhTextBox, KhNumberBox, KhDateBox, KhSelect,
  KhCheck, KhSwitch, KhHotlink) with Italian number and date input, inline
  calculation (=10*3), field messages plus a summary that focuses the field,
  and service errors added by field name.
- Display and window components (panels, tiles, badges, chips, money, tabs
  with Alt+1..9, steps, dialog, side drawer and DrawerService).
- KhIconToolbar that keeps one line and moves less used commands into the
  "..." menu, KhDocHead, and the RecordPage/DocumentPage/MasterDataPage bases
  with standard commands, shortcuts and save/cancel/delete flow (#27, #29).
- Development-only component catalog and sample document page.
- Profile: personal data, password change that ends other sessions, TOTP
  enable/disable and recovery codes through ProfileService (#31).

Refs #27 #29 #31

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	src/Khaemhat.Web/Hosting/KhaemhatServices.cs
Lists need one component for the whole app (SPEC §10.6-§10.7): a list
query model that turns search, filters, sort and paging into SQL or runs
over rows in memory, a KhGrid that pages 100,000 rows while scrolling
(or in pages) with sort, selection, keyboard, inline edit, totals, row
menu, saved column layout and CSV/XLSX export, the KhRadar around it
with search, quick filters, a filter builder and saved filters, a radar
window for F4 lookups, and KhLinesGrid for document lines typed from the
keyboard.

Checked in the browser on the component catalog and the sample document.
Fixed on the way: the grid height lost to the flex basis, a new search
kept the old scroll position, Save of a filter needed a second click,
page shortcuts (Ctrl+Canc) reached the record behind a modal window,
Escape did nothing once focus left a dialog, totals did not follow an
inline edit, and amounts exported as 0 instead of 0,00.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The home page becomes the widget dashboard of mockups 004-006. Each user
switches widgets on and off, orders them (drag and drop or buttons that
also work from the keyboard), sizes them on the 12-column grid and picks
the start page; every change is saved at once. Whoever may change the
company settings sets a default layout per role, used by people who
never customized; Reset goes back to it.

Todo, Done and Deadlines collect lines from sources each module
registers, so later milestones fill them without touching the widgets;
a failing source is logged and skipped. M3 provides licence, unread
warnings and scheduled task runs. Notes, Shortcuts and System status
work now; widgets of modules still to come say which milestone brings
their data instead of showing fake numbers.

Role defaults live in the new company_settings table, written through
CompanySettingsService with company.settings.write (ADR 0022).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
F1 and "?" now open the wiki page of the screen inside the application
(/aiuto, mockup 011) from a copy of the wiki shipped next to the program,
so help works offline and always matches the installed version. Markdown
is converted in-house and fully encoded; images of the repository are
served from the copy. KHAEMHAT_HELP_URL sets the online wiki behind
"Apri nel wiki"; "Segnala un problema" opens a new issue of that repo.
A test checks that every page and menu entry has an existing wiki page.

The bell opens a notifications panel (mockup 010) with all/unread
filters and mark read. Broadcast notifications are now read per user
through sys_notification_reads / notification_reads instead of one
shared read_at.

The global search asks ISearchProvider implementations through
GlobalSearchService after a short pause; the first provider finds help
pages and sections, # and @ say which modules will fill them.

Escape also closes a side panel when the focus fell out of it.
Decisions in ADR 0023.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Documents need to show, upload and generate their files from the interface,
and users need to see who changed a record. This adds the attachment list
(upload, preview, download, lock, trash and restore, older versions, ZIP,
generate/regenerate), in-app previews for PDF, images, XML, text, CSV and
XLSX, an A4 print preview with "save as attachment", and an audit history
list read through a permission-checked AuditTrailService.

Files are served by /files endpoints that require a signed-in user and the
company permissions; only PDF and images open inline, with their own CSP
that allows framing by this site only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs: close M3 with real screenshots, ADR 0024 and the 0.3.0 changelog (#36)
CI / Build and test (SQLite) (pull_request) Successful in 1m36s
CI / PostgreSQL 16 integration (pull_request) Skipped
CI / PostgreSQL 17 integration (pull_request) Skipped
CI / YAML check (pull_request) Successful in 5s
CI / Docker image (pull_request) Successful in 1m13s
b4a2802bed
The milestone's Definition of Done asks for real screenshots, complete
wiki pages and a changelog for everything delivered. Fifteen screenshots
taken on a fresh instance now sit next to the mockups in the wiki;
Interfaccia, Dashboard, Preferenze, Design UI and Allegati are marked
complete, with the date-field shortcuts and the profile tabs that are not
built yet described as they really are. ADR 0024 records the Kh component
library, record pages and the shared list query, which shipped without
one, and the changelog gains its entries and a 0.3.0 section.

The visual check against the mockups found three layout bugs, fixed here:
the document total label took the timeline's .tl style and was cut, the
radar's .kh-choices class stacked the profile's theme cards in a column
(renamed .kh-radio-set), and on phones the top bar wrapped; it now keeps
icons only and the status bar shows only the live values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Alby96 merged commit 4ecf15b609 into main 2026-11-11 21:00:47 +01:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: BalboSoft/Khaemhat#119