Commit graph

216 commits

Author SHA1 Message Date
1f3b903809 Move board export into the edit dialog and shorten supply types in the list
Some checks are pending
security-baseline / secrets (push) Waiting to run
security-baseline / node (push) Waiting to run
security-baseline / semgrep (push) Waiting to run
security-baseline / trivy (push) Waiting to run
The distribution-board export now sits in the board's edit dialog next to
copying instead of in every list row. The board list shows only the
supply-type code (AV, SV, EV, USV, MSR, SiBe) with the full name as a
tooltip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 09:03:29 +01:00
084002bea9 Add AUTH_DEV_AUTOLOGIN to switch off the login on development instances
With AUTH_DEV_AUTOLOGIN=<username>, every /api request without a valid
session runs as that existing, active user and skips the forced password
change. Unset keeps the normal login; unknown or deactivated users still
get 401, real sessions take precedence, the CSRF application header stays
mandatory and the API logs a warning at startup. The switch is not
limited to localhost because the development instance is reached from
other machines and through a reverse proxy (THREATMODEL D2/R15). It must
never be set on an instance with real project data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 09:03:29 +01:00
d0bd4fe7e0 Export and import single distribution boards as JSON
A board with its complete circuit list can be downloaded as a
leistungsbilanz.distribution-board file and imported into any project as
a new board. The import reuses distribution-board.insert-subtree, so it
is one revision with restart-safe Undo/Redo. All ids are new;
project-bound references (project devices with override metadata, room
ids, floor, logical feed, a disabled supply type and the Revit quantity
share) are dropped, circuit voltages follow the target project, and the
response lists these adjustments. The project page offers export per
board and import in the board card header.

Refs #26

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 07:38:28 +01:00
17a3945813 Add cell copy/paste, multi-row edits and a context menu to the circuit grid
Ctrl+C/Ctrl+V copy and paste grid cells without opening an editor, using
the document copy/paste events so it also works over plain HTTP in the
LAN. Protection and cable summaries copy the complete circuit record;
tab-separated blocks from Excel spread over visible rows and columns.
With a Ctrl/Shift multi-selection, typing, pasting and the protection
dialog apply to every selected row that can take the value, including
device power and GZF; other cells are skipped and reported.

All of these writes use the new circuit-list.bulk-update command. It
carries complete circuit.update, circuit-device-row.update and
circuit-protection.update commands, applies them with the single-command
rules in one transaction and stores the reversed inverses, so each edit
is one undo step. The single-command apply logic is extracted for reuse.

A right-click menu (also context-menu key / Shift+F10) offers copy,
paste, edit, protection, cable sizing, insert circuit below, add device
and delete. The protection summary is now selected by click and opened
by double click, Enter or F2. Existing numbers open in the inline editor
with a decimal comma, so confirming an unchanged decimal no longer fails.

Refs #26

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 07:38:28 +01:00
7222398628 Typecheck tests against current types
tsx runs tests without type checking and tsconfig.json covers only src,
so 71 type errors had accumulated unnoticed. tsconfig.tests.json now
checks every test and helper, and npm run typecheck includes it.

Fixtures gain the fields the DTOs have grown since they were written
(manualQuantity, circuit apparent power/cos phi, downstream board loads,
section totals, building, cover and board info fields). Repository
lookups that return "row ?? null" now declare the null in their type,
which their callers already handle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 13:17:45 +01:00
Grovy311
0ee9e4dd38 docs(security): R6 behoben, LAN-Port 3090 geschlossen
Some checks failed
security-baseline / secrets (push) Has been cancelled
security-baseline / node (push) Has been cancelled
security-baseline / semgrep (push) Has been cancelled
security-baseline / trivy (push) Has been cancelled
Deploy auf cj-ki: Web-Container nur noch 127.0.0.1:3090, Caddy über das Docker-Netz,
COOKIE_SECURE=true geprüft.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:13:18 +02:00
Grovy311
e51752f3e1 docs(security): Design-Entscheidung D1 (Projekte teamweit geteilt) eintragen
Some checks are pending
security-baseline / secrets (push) Waiting to run
security-baseline / node (push) Waiting to run
security-baseline / semgrep (push) Waiting to run
security-baseline / trivy (push) Waiting to run
Julian hat am 17.10.2026 bestaetigt: die Software laeuft nur im eigenen
Team, alle Nutzer sehen alle Projekte. Bevor Externe Konten bekommen, wird
Besitz/Freigabe pro Projekt eingefuehrt. R3 (ASVS-light B1/B2) damit nicht
anwendbar; idorGap-Kommentar und AGENTS.md verweisen auf D1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 12:56:23 +02:00
Grovy311
1cf406d216 docs(security): Threat-Model anlegen, Entscheidung zu geteilten Projekten offen
Some checks are pending
security-baseline / secrets (push) Waiting to run
security-baseline / node (push) Waiting to run
security-baseline / semgrep (push) Waiting to run
security-baseline / trivy (push) Waiting to run
docs/THREATMODEL.md (threat-model-light): System, Assets, Angreifer,
Vertrauensgrenzen, Risiken R1-R14 mit Beleg. R3 (ASVS-light B1/B2) bleibt
offen, bis Julian E1 (Projekte teamweit geteilt) bestaetigt. idorGap-
Kommentar und AGENTS.md verweisen darauf.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 12:40:43 +02:00
Grovy311
ee117958b3 fix(security): stamp.py schreibt kein __pycache__ mehr
Ohne passende .gitignore machte der Cache den Arbeitsbaum unsauber, kein
Prüfstempel war gültig.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 11:10:44 +02:00
Grovy311
e2cc00dccc chore(security): Baseline-Update Prüfstempel und release-checks
Makefile und scripts/security/stamp.py aus cj/security-baseline, leere
docs/RELEASE-AUSNAHMEN.md, AGENTS.md-Abschnitt zu Stempeln und Release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 10:46:29 +02:00
4ff01b2ccd Harden Linear XLSX end to end 2026-09-30 21:02:20 +02:00
2581beee3c Add Linear XLSX follow-up import 2026-09-30 20:40:40 +02:00
1a4c8cad8c Add Revit return workbook export 2026-09-30 15:15:17 +02:00
77d775fde1 Complete Revit object editor assignments 2026-09-30 14:35:14 +02:00
4ac32e103d Add virtualized Revit object planning 2026-09-30 10:03:36 +02:00
bfdd048269 Add Linear XLSX initial import 2026-09-30 09:50:58 +02:00
c633e78cd4 Add Revit XLSX settings page 2026-09-30 09:02:52 +02:00
1cfeb06ec7 Replace Revit CSV backend with Linear XLSX 2026-09-30 08:46:07 +02:00
52d3b1a270 Add Linear Excel transport 2026-09-30 07:42:16 +02:00
d4803a18d2 Document Linear Excel integration 2026-09-29 22:28:16 +02:00
ae318a51ac Audit Linear Excel integration 2026-09-29 21:57:40 +02:00
3670f02ccd Document authenticated deployment 2026-09-28 22:42:11 +02:00
73579d1e79 Merge branch 'main' into feature/user-management 2026-09-28 22:32:48 +02:00
9165b8238c Compact single-board feeder circuit rows 2026-09-28 22:14:39 +02:00
Grovy311
728132e52a Warn at startup when no user exists and no bootstrap admin is configured
Also document that Sec-Fetch-Site is only sent over HTTPS, so plain-HTTP
LAN access relies on SameSite=Lax alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 21:47:30 +02:00
Grovy311
95bfba2f67 Merge origin/main into feature/user-management
Renumber the users migration to 0013_users so it follows the upstream
0012_good_gateway (logical board feeds); AGENTS.md deferred-work list keeps
both the new feed items and the auth items.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 21:46:21 +02:00
Grovy311
5073d9342a Harden authentication and put filter toggle and fields in one row
Security: per-username login throttling, constant-time unknown-user check,
Sec-Fetch-Site CSRF guard for writes, session rotation on login and
password change, absolute session lifetime, sessions ended on reset and
deactivation, last-admin protection, input length caps, ASCII usernames,
clickjacking headers. Covered by tests/authentication.test.ts.

Filter panel: toggle, fields and count share one row to save space.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 21:30:30 +02:00
b74b495fab Update print view and documentation for logical feeds 2026-09-28 20:57:58 +02:00
Grovy311
c56cfb30ad Add login-required user management (admin/user roles, Config->Benutzer)
No self-signup: admins create every account in Config -> Benutzer with a
typed start password; a forced password change gates first use. Session-
cookie auth protects all /api/* routes; /api/users additionally requires
the admin role. See docs/authentication.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-28 19:51:47 +02:00
b50c00c0ac Bring documentation in line with integrated features
List the building structure, room areas, rough power balance and cable
sizing in the README and documentation map, add an architecture section
for the rough power balance, correct stale snapshot schema references and
record the integrated contributor features in the backlog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 20:36:43 +02:00
dce31ee143 Add optional room areas 2026-09-27 20:00:03 +02:00
a6500e2b26 Add estimate row project device handoff 2026-09-27 18:36:48 +02:00
5cbbd3a84a Align cable sizing with DIN VDE 0298-4 2026-09-27 17:01:23 +02:00
598003554a Merge remote-tracking branch 'origin/main' into feature/cable-sizing 2026-09-27 16:54:12 +02:00
060a203425 Merge rough estimate balance 2026-09-27 12:38:32 +02:00
573487666c Integrate rough estimate balance 2026-09-27 12:37:59 +02:00
57a62b7e4a Record the confirmed building structure decisions
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 11:17:24 +02:00
b9462e61c5 Defer Revit work and remove Dynamo scripts
Further Revit exchange will use the CSV export/import of the Linear
plugin instead of Dynamo, as preferred by the internal Revit/CAD
steering committee. Mark the Revit documentation as deferred and remove
the Dynamo diagnostic scripts, which stay reachable through the tag
archive/dynamo-vorueberlegungen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 10:51:13 +02:00
92da72bf14 Archive the Revit Dynamo integration concept
Keep the earlier Dynamo/API considerations as historical reference only.
Further Revit exchange will use CSV via the Linear plugin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 10:50:23 +02:00
868f48e7ac Integrate project building structure 2026-09-27 10:45:10 +02:00
4643c8d11a Integrate print view and document branding 2026-09-27 10:32:07 +02:00
3ffa50be4c Integrate consistent card styling
Document the shared card appearance. Validation: 431 tests, API/web builds, scripts and Next typechecks passed. GUI retest waived by the user.
2026-09-26 21:18:53 +02:00
2e223be8b4 Integrate project overview filters and icon actions
Document filter combinations, reset and browser persistence. Keep the search hint applicable before board information fields are introduced.

Validation: 20 focused tests, 431 total tests, API/web builds, scripts and Next typechecks, and diff checks passed. GUI retest skipped as authorized based on the colleague's prior testing.
2026-09-26 21:16:48 +02:00
641513c2ef Integrate circuit list navigation and AMEV cell picker
Preserve the ID fallback and compact editor controls. Add dialog keyboard focus, Tab containment and Escape handling; document navigation and picker behavior.

Validation: 418 tests, API/web builds, scripts and Next typechecks, isolated AMEV dialog checks and diff checks passed. Full GUI retest waived by the user based on the colleague's prior testing; the keyboard follow-up was checked in isolation.
2026-09-26 21:14:20 +02:00
203757b92c Integrate compact editor actions and fix header units 2026-09-26 21:07:36 +02:00
0a17da2b8e Align runtime and editor documentation with current implementation 2026-09-26 21:02:48 +02:00
Grovy311
72189d23a5 Offer supply suggestions, drop the circuit column, center cells
The Versorgung field suggests ELT and MSR (plus values already used in
the balance) through a datalist and still accepts free text. The circuit
number column is not needed in early design phases; it is removed from
the data model, the regenerated migration 0010, the editor and the
print. All cells are centered except "Verbraucher / Flächen", group
titles and total labels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 17:56:53 +02:00
Grovy311
37a70b6b36 Add the rough power balance module for early design phases
In LPH 2/3 there are no circuits yet, but the office needs a power
balance by DIN 276 cost group, as in the Excel template "Leistungsbilanz -
KG400": each trade enters consumers by piece or by area (W/m²) with GLF
and cos phi; the balance sums AV and SV per cost group, adds a reserve and
derives the maximum current.

The module is separate from the circuit structure: own tables
(migration 0010), own folder src/estimate-balance and an import-free
shared calculation used by API and UI. Writes go through project commands
(estimate-balance.insert/.update/.delete with complete documents), so
revision checks and Undo/Redo apply; it is not part of project snapshots
or transfer yet. A comparison endpoint sums the device rows of all circuit
lists by cost group (longest prefix) against the estimate.

The UI adds a sidebar entry, a list of Stände (template KG 400, empty or
copy) and a spreadsheet-like editor with autosave, AMEV picker for the
GLF, totals, reserve, maximum current, comparison table and print layout.
The tests reproduce the template example exactly (143.24 kW, 148.48 kVA,
157.56 kW / 163.33 kVA with 10 % reserve, 235.75 A). See
docs/estimate-balance.md and issue #7.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 17:39:28 +02:00
Grovy311
837b29c7c5 Add icon actions and collapsible filters to the project overview
The overview now uses the same icon buttons as the circuit list editor:
row actions are icon-only IconButtons (Pencil, Link2, Library, Trash2),
card-header and panel actions show icon plus text, and the circuit-list
link uses the new IconLink. The version history uses Undo2/Redo2, a
chevron toggle and a RotateCcw restore action. Page-header buttons stay
Bootstrap buttons with a lucide icon so the upcoming "Seitenansicht"
button of feature/print-view merges without conflicts and matches them.

The Verteilungen and Projektgeräte cards get a PM-style filter bar:
search plus MultiSelectDropdown (checkbox list with "Alle", closes on
outside click and Escape) and "Zurücksetzen" while a filter is active.
Only the bar collapses; the state is kept per card in localStorage and a
collapsed active filter shows "Filter aktiv". The header row shows
"x von y", and an empty-state row explains when filters hide everything.
The filter logic is a pure module (overview-filters.ts) with node tests;
selections that are no longer offered (deleted floor) are ignored.

IconButton now imports React explicitly like the other components that
are rendered in node tests with the classic JSX runtime.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 13:01:31 +02:00
Grovy311
cd89c4a499 Add buildings above floors and a building structure page
Projects with several buildings could not be structured: floors and rooms
hung directly off the project. Floors can now belong to a building
(migration 0009: table buildings, nullable floors.building_id). Rooms and
distribution boards keep their floor; their building follows from it.
Existing floors stay without a building.

Buildings use the location-structure command store with
project-building.insert/.update/.delete, inverses and persistent Undo/Redo;
deleting a building with assigned floors is rejected. Floor commands carry
buildingId since command version 2. Version 1 floor commands from existing
history predate buildings and are upgraded with buildingId = null before
they are executed and persisted, so forward and inverse keep one version.

Project snapshot schema 7 stores buildings and floor.buildingId; versions
1-6 are upgraded without buildings. Restore and portable transfer include
buildings, and the transfer remaps building ids.

Buildings, floors and rooms move from the project overview to their own
page /projects/:id/struktur with three columns (Gebäude -> Etagen -> Räume)
that filter each other, and a sidebar entry. Floor selects in the board and
room dialogs are grouped by building. Unchanged dialogs close without a
command. Details in docs/building-structure.md; see issue #6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 12:52:34 +02:00