Commit Graph

44 Commits

Author SHA1 Message Date
Lucio Lelii 1270bf7ea7 Improve execution group management 2026-09-23 12:09:57 +02:00
Lucio Lelii 3755081e0f Add a live activity panel to the admin area
Answers one question - is it safe to restart the server - so it answers that
first: a single verdict line, then the two lists behind it. A run in flight
outranks a connected user however many there are, because a person loses an
unsaved edit and comes back while a run is simply gone.

Refreshes itself every fifteen seconds, the page being worthless the moment it
is stale. A failed refresh keeps the last known answer rather than emptying the
page: blank would read as "nobody is connected", the one wrong conclusion
somebody could restart the server on.

PresenceService sends a heartbeat a minute, and only while the tab is visible.
Every authenticated request already counts as a sign of life, but the editor is
quiet - someone reading a flow or typing a prompt makes none for minutes, and
they are the person a restart interrupts worst. A backgrounded tab is not
someone using the application, and counting one would turn the panel into a list
of forgotten tabs, which is the failure the server's own session column already
has.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 10:11:39 +02:00
Lucio Lelii 5787a6fe44 Add the SPDX licence header to every source file
Mechanical: three comment lines at the top of every .ts, .html and .css
under src, and nothing else. Split out from the licence commit so the
files that carry an actual change stay readable in the history, and kept
to its own commit because it moves the blame line on 390 files.

The short SPDX form rather than the full GNU notice - it is
machine-readable under REUSE, it satisfies the requirement to keep the
licence notice intact, and it points at LICENSE-ADDENDUM instead of
restating the attribution term in every file.

The template and stylesheet headers do not reach the bundle: Angular
discards template comments and the production build strips CSS ones. The
one in index.html survives, since that file is served as written, which is
no loss.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-16 12:10:18 +02:00
Lucio Lelii eb6618044d Import a flow from a JSON file
"From JSON" in the New menu picks a file and creates the flow from it. The name
is de-duplicated the way "Empty flow" already does it, so importing the same
file twice gives two flows you can tell apart, and the result opens in the editor
- which is where the import's real failure mode shows: a flow can save and still
not be executable here.

The type check before the request is the part that matters. A typeName this
server does not know makes the backend validator dereference a null and answer
500; an unknown configuration id fails inside Jackson with a raw 400. Both are
unreadable, so the file is refused up front with the offending names. The check
honours the two type names the server has renamed, or it would reject files the
server would have accepted.

A bare graph is accepted as well as an envelope: the backend hands whole graphs
around in that shape, so a JSON copied from the container import or out of the
database still works.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-04 16:50:51 +02:00
Lucio Lelii 0b706ea95c Group the flows list by project, with shared context and project runs
Projects group the flow list in place: no new page or tab, the existing sidebar
list gains collapsible per-project sections plus a project filter. Everything is
behind PROJECTS_ENABLED in shared/feature-flags, and with no projects the list
renders exactly as it did before - flows-list.spec guards that.

FlowsList stays the single owner of the load, filter, sort and list state; the
grouping is extracted into a pure flow-grouping.ts and a presentational
flows-group component. A wrapper rendering N flows lists would have re-registered
the same list state and re-triggered the load N times. The group chrome mirrors
tasks-executions-list, which already implements collapsible groups, so the two
sidebars read as one product.

toFlowCreateRequest deliberately still carries no project. It builds the
full-replace PUT the editor issues on every save, so a project sent there would
be silently dropped each time; membership changes only through
assignFlowToProject. flow-mapper.spec guards it.

Deleting a project destroys its flows, so it gets its own dialog rather than a
wider ConfirmDialogService: it names the count, lists the flows, says that
finalized flows go too - which the flow list otherwise forbids - and requires the
project name to be typed. Widening the shared confirm service for one destructive
caller would have rippled through every other call site.

Moving a flow between projects is a menu item, not drag-and-drop: the sidebar is
320px with its own scroll, and the whole card is already a click target, so a
drag gesture would fight the open-flow gesture. Flow order inside a project uses
up/down arrows for the same reason.

Shared context is edited in a dialog modelled on the Global Inputs panel, which
is the mental model users already have for ${{global.x}}; the title toolbar shows
the inherited values read-only, because that is where prompts are written.

"Run project" creates and starts a run - creating alone would look like nothing
happened. Runs come back BLOCKED or STOPPED when a step needs inputs or failed,
and the UI says so instead of claiming progress. Project runs surface in /tasks
as sibling groups labelled with a project chip, derived in tasks-executor: no
second nesting level and no backend change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 07:53:42 +02:00
Lucio Lelii abf21b1c24 Add fullscreen mode, wider zoom-out, and draggable execution graph positions
- Lower rete editor min zoom (0.35 -> 0.1) so wide flows fit on screen.
- Remove the Export action from the read-only subflow preview dialog,
  since it's only ever opened from the execution view.
- Add a fullscreen toggle to the flow editor and task execution viewer,
  placed next to the title; disables the "flows" sidebar tab and hides
  the right assistant/validation panel while the flow editor is
  fullscreen, and collapses the left sidebar if it was open.
- Allow dragging nodes in the read-only execution graph and persist
  custom positions client-side in sessionStorage, keyed by execution id,
  restored on reload/refresh.
2026-09-02 20:00:34 +02:00
Lucio Lelii 760202090d feat: edit container subflows from flow editor 2026-07-27 17:07:46 +02:00
Lucio Lelii af246dab65 fix: correct real bugs and remove dead code found in a full-project quality review
Bugs:
- blocks.ts/containers.ts: reset toInit on a failed initial catalog load so
  the next call retries instead of leaving the catalog permanently empty.
- task-step-node.ts: align isEmptyDisplayValue with generic-node's
  isMissingValue so a field renders consistently between the editor and the
  execution view for the same schema.
- flows-call.fake.ts/assistant-call.fake.ts: wrap synchronous throws in
  defer() so catchError() on the caller side actually intercepts them.
- utilities/rete-editor.ts: remove a no-op ternary and a leftover debug log.
- stores/flow-editor.ts: save() now returns a handled error instead of
  crashing on a non-null assertion when no flow is loaded.
- Removed leftover console.log statements (title-toolbar, flow-item,
  editor-sidebar).

Dead code removed: the unused admin-users page, editor-sidebar's unused
createNewBlock(), rete-editor's unused flowChanged output, and the broken,
uncalled ListStateViewHolder.create().

Refactors (duplication called out by the same review):
- New session-guard.ts factory backing authGuard/adminGuard.
- tasks-executor's formatDuration now reuses the shared util.
- New services/shared/http-error.util.ts replacing the duplicated
  extractHttpErrorMessage/toHttpError in admin-call.ts and authorization-call.ts.
- New services/bias/bias-error.util.ts unifying the three different ad hoc
  error-message extractions across the bias-* dialogs.
- New pages/admin/admin-access.util.ts and utilities/temporary-signal.ts
  replacing the duplicated redirectOnAdminAccessDenied and auto-dismiss-toast
  patterns.
- New shared ModalShellComponent adopted by the three bias-* dialogs (their
  backdrop/header/footer CSS was already byte-identical); new
  password-form-validators.ts and a shared password-dialog-chrome.css
  collapsing admin-reset-password-dialog and change-password-dialog, which
  duplicated their entire validation logic and CSS.
- New services/shared/{catalog-store,empty-node-cache,pending-sync-counter,
  deep-clone,flow-node-mapping}.ts: BlocksService/ContainersService and their
  *-call.ts mappers were near line-for-line duplicates (which is exactly how
  the toInit bug ended up in both).
- New shared/nodes/node-focus-modal-controller.ts: generic-node.ts and
  container-node.ts had ~150 identical lines of focus-modal/body-scroll-lock
  plumbing.

Confirm-dialog, node-settings-dialog, human-interaction-dialog and
subflow-preview-dialog were deliberately left out of the modal-shell
extraction: each has a meaningfully different structure and no way to verify
visually here, so forcing them into a shared shell was judged higher risk
than the cosmetic-only bias-*/password dialogs, whose CSS was already
byte-identical.

61 test files / 230 tests passing; `ng build` and `ng test` green throughout.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-21 14:27:34 +02:00
Lucio Lelii 5a8d44d644 Feature: prompt conferma su creazione nuovo flow se ci sono modifiche non salvate (editor-sidebar) 2026-05-18 12:35:28 +02:00
Lucio Lelii 175059de79 feat(assistant): add AI flow creation modal and robust session mapping 2026-05-13 12:17:35 +02:00
Lucio Lelii a4e78cb269 Replace flow creation plus icon with New button 2026-04-24 12:18:31 +02:00
Lucio Lelii c87596fea1 Strengthen frontend spec coverage 2026-04-21 12:39:33 +02:00
Lucio Lelii e6f6cda845 Unify password policy and fix conditional dynamic fields 2026-04-15 12:11:29 +02:00
Lucio Lelii 52333b8601 Split admin services from authorization and add session checks 2026-04-15 12:10:36 +02:00
Lucio Lelii 5f405b69a0 solved problem on container import 2026-04-10 10:08:17 +02:00
Lucio Lelii de6e86d53a refactor: code quality improvements (tasks 1-15)
- Fix memory leak in task-executions polling (DestroyRef)
- Fix race condition in flows service (error recovery)
- Add centralized NotificationService + GlobalNotificationComponent
- Convert main routes to lazy loading (loadComponent)
- Remove static state from auth interceptor
- Write real unit tests (guards, stores, services)
- Strengthen HFNodeData types (explicit properties)
- Extract pure functions from TaskExecutionViewer into utils
- Add console.warn logging to guards on access denied
- Expand runtime config (apiUrl, assistantEnabled, tourModeAlwaysOn, turnstileEnabled)
- Document FormUtility and ListStateViewHolder base classes
- Remove unused lucide-angular dependency
- Replace ngModel with signal bindings in flows-list/blocks-list
- Use :where() for global mat-form-field override
- Document design system tokens in styles.css
2026-04-09 14:53:02 +02:00
Lucio Lelii 7028ac0c53 feat: improve auth flow and task execution UX 2026-04-09 14:01:56 +02:00
Lucio Lelii a904bd7951 turnstile siteKey added with a env var 2026-03-26 13:51:31 +01:00
Lucio Lelii 3e56f6db41 Add admin operations dashboard and flow publication controls 2026-03-26 13:01:16 +01:00
Lucio Lelii a34b72eb2b administration page added 2026-03-26 09:59:11 +01:00
Lucio Lelii 518fff6de2 change password added 2026-03-25 09:21:38 +01:00
Lucio Lelii fad93a3eca Add suspended execution resume support and production Docker setup 2026-03-22 10:35:30 +01:00
Lucio Lelii 19b0dadacc Improve schema-driven nodes and interactive execution chat 2026-03-19 15:18:09 +01:00
Lucio Lelii 08d83863a1 guided tour added for editor part 2026-03-17 09:54:40 +01:00
Lucio Lelii 8a8978937f Refine container handling and readonly flow behavior 2026-03-16 15:41:08 +01:00
Lucio Lelii 533a1e7f43 Split containers into dedicated services and sidebar list 2026-03-15 06:07:10 +01:00
Lucio Lelii 856d3e0893 Polish block sidebar interactions 2026-03-13 16:51:58 +01:00
Lucio Lelii d6e3a2a534 Migrate core UI areas to Angular Material 2026-03-12 15:30:31 +01:00
Lucio Lelii 376234539e Add block example caching and structural refresh UX 2026-03-09 14:39:58 +01:00
Lucio Lelii e13e06d858 Align flow save API integration and add editor save/create feedback 2026-03-09 11:37:01 +01:00
Lucio Lelii a2f7152202 Improve auth error handling and session expiration behavior 2026-03-09 11:36:50 +01:00
Lucio Lelii 4504ec0087 added task layout 2026-03-03 20:01:03 +01:00
Lucio Lelii 79b85e2bd5 added field retriever service
improved node design
2026-03-02 15:58:05 +01:00
Lucio Lelii 68635649f8 modified node structure and parameter 2026-02-27 21:56:06 +01:00
Lucio Lelii 5213e2bdfa improved height managing 2026-01-23 10:39:58 +01:00
Lucio Lelii e51d9a2fac added rete.js 2026-01-19 17:15:58 +01:00
Lucio Lelii 240de8a6e2 added state to filters 2026-01-19 12:50:41 +01:00
Lucio Lelii 76e7806d3d order added to flows 2026-01-16 17:15:57 +01:00
Lucio Lelii 958d3210c5 fixed bug on item list 2026-01-16 12:05:52 +01:00
Lucio Lelii 8e6084c32a added details to flows 2026-01-13 12:21:32 +01:00
Lucio Lelii 0fbe49f0f3 added flow service 2026-01-12 17:23:44 +01:00
Lucio Lelii fbd34a0882 added store state for editor 2026-01-09 17:20:27 +01:00
Lucio Lelii bab3a9797d first commit 2026-01-07 16:07:33 +01:00
Lucio Lelii c6aea28105 first commit 2025-12-11 17:52:01 +01:00