feat(workflow): attention nudge when a launch workflow parks on a gate

Aperta
#115 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript, python
Ambito
backend, frontend

Direzione di ricerca

Start with the workflow runner and external event buffer in src/profiles/server/routes/workflow.py and src/profiles/server/routes/instance.py, then trace how the App polls /api/notifications and displays port handoff toasts. Add a gate event when a session newly enters a waiting state, and handle it in the web layer with deduplication and focus checks. Done means the gate draws attention through the requested cues without repeating for the same session and step; the issue names no test files.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Problem

When a launch triggers workflow hooks containing ask:/notify: gates, the session parks in waiting_ask/waiting_notify until the user answers. Users who trigger launches via barcode scans or keyboard shortcuts are frequently focused in another application when the gate appears — ProFiles sits in the background with the runner modal open and nothing draws them back. Interactive sessions are kept indefinitely (the TTL purge only drops terminal sessions), so a missed gate can block the rest of a workflow for as long as the app runs.

Evidence

  • The only way forward is the respond route; src/profiles/server/routes/workflow.py:397-643. The purge at src/profiles/server/routes/workflow.py:90-96 explicitly keeps interactive sessions (Drop terminal sessions past the TTL (interactive ones are kept)).
  • A general UI event poll channel already exists and is already polled by the app for port-handoff toasts: GET /api/notifications at src/profiles/server/routes/instance.py:74 (state.external_events_after(after)).
  • No event is recorded when a session enters a waiting state, and no OS-level attention mechanism (toast, document.title flash, notification) exists anywhere in the web layer today.

Proposed approach

  • Server: when the session runner parks on waiting_ask / waiting_notify / notice, push an event into the existing external-events buffer (same channel the port handoff uses), carrying session id + gate kind.
  • Web: the App-level notifications poll already runs — on a gate event, show a toast, flash document.title, and fire a Web Notification where the environment permits. Fire only when the gate is newly reached (dedupe per session+step), and skip when the document has focus.
  • Desktop (optional stretch): a pywebview-specific attention request kept inside profiles.desktop, per the AGENTS.md layering rules (presentation layer only).
  • Scope S-M. No breaking change — additive event + UI behaviour.

Alternatives considered

  1. Auto-timeout on gates — changes workflow semantics and could auto-launch or auto-skip against the user's intent; rejected.
  2. Sound-only cue — poor accessibility and lost on muted systems; toast + title flash is quieter, testable headlessly (vitest), and composes with the existing toast component.

Proposed during automated enhancement scan 2026-11-04

Lingua principale
Python
Stelle
1
Fork
1
Merge medio
4h 46m
PR unite (30g)
55

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di falbany/ProFiles

Tutte le issue di falbany/ProFiles

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.