Phase 8: Project Management, find bar, presence and motion
The Project Management screen (/pm, view only) with Overview, Projects & units, Bottlenecks & aging, Hours vs target, Quality & issues and Find jobs, the period picker, health per unit and per project, drill down, Excel (CSV) per table and for all, and the PESCO production status report PDF with the controlled-copy stamp; every export logged as "report exported". The find bar on every home screen: the full search set, the dropdowns, quick flags with Mine, the flag kinds, Board and List with sorts, filters saved per browser; every filter applied by the server on the list and the boards, with facets. Presence in packets with role, lock and revoke drop; the motion switch with reduced motion honoured, card glides, glow and count-up; Back restores the scroll spot; sheet placement and the iPad layout pass. The data book compared page by page with the old build and six layout differences fixed. Tests for the PM aggregates, search, filters, presence and exports; Playwright scenarios for the PM screen, the find bar and presence at desktop and iPad viewports. Docs updated; PLAN.md questions 38 to 42. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
@@ -6,7 +6,7 @@ from fastapi import APIRouter, Query, Request
|
||||
from fastapi.responses import StreamingResponse
|
||||
from starlette.concurrency import run_in_threadpool
|
||||
|
||||
from ..auth.groups import SCREENS
|
||||
from ..auth.groups import SCREEN_LABELS, SCREENS, role_label
|
||||
from ..events import EventHub, stream
|
||||
from .deps import resolve_standalone, settings_of
|
||||
|
||||
@@ -22,16 +22,21 @@ async def events(
|
||||
packet_id: int | None = Query(None, ge=1, le=2**62),
|
||||
) -> StreamingResponse:
|
||||
"""The event stream. `packet_id` is the packet the page has open; presence carries it, so the packet page can
|
||||
show who else is looking at the same packet. The client reopens the stream when the open packet changes."""
|
||||
show who else is looking at the same packet. The client reopens the stream when the open packet changes.
|
||||
Presence names the person with the label of the screen they have open (a screen their roles allow), else their
|
||||
primary role. A locked session is left out of presence until it unlocks."""
|
||||
# The session check runs on its own pooled connection, returned before the stream starts
|
||||
p = await run_in_threadpool(resolve_standalone, request)
|
||||
hub: EventHub = request.app.state.events
|
||||
open_screen = screen if screen in SCREENS and screen in p.screens else None
|
||||
sub = hub.subscribe(
|
||||
session_id=p.session_id,
|
||||
user_id=p.user_id,
|
||||
display_name=p.user["display_name"],
|
||||
screen=screen if screen in SCREENS and screen in p.screens else None,
|
||||
screen=open_screen,
|
||||
packet_id=packet_id,
|
||||
role=SCREEN_LABELS[open_screen] if open_screen else role_label(p.roles),
|
||||
locked=p.locked,
|
||||
)
|
||||
hello = {"session_id": str(p.session_id), "build": settings_of(request).ps_build}
|
||||
return StreamingResponse(
|
||||
|
||||
Reference in New Issue
Block a user