Commit Graph

120 Commits

Author SHA1 Message Date
Reese Norris
29d5356f85 web: tighten account page help copy
Drop redundant rating and multi-device session notes from the account forms.
2026-07-27 19:00:51 -04:00
Reese Norris
895dbd8fc8 web: allow Instructor1+ access to airport editor
Move airport-editor HTML routes and validate API from ADM to I1+, matching
sweatbox. Config editor stays Administrator-only. Nav/dashboard use
CanAccessAirportEditor; PE tests cover I1 shell, nav, and validate-apt.
2026-07-27 18:53:44 -04:00
Reese Norris
fbb242bd1c web: address review follow-ups for account self-service
Revalidate optionalSession on landing, harden PE assertions for CSRF
rotation and soft-delete cookie clear, add I1 sweatbox API + delete CSRF
tests, fix sweatbox manual/README authz copy, drop dead permanentDisabled
assignment and misleading CSRF re-issue after password change.
2026-07-27 18:44:41 -04:00
Reese Norris
7d4cdba6ae web: user dashboard self-service, authz realignment, session revalidation
- Account page: change password + soft-delete (optional hard-delete via env)
- Session revalidation + claims overlay on HTML and dual-accept API (KD-9)
- Authz: user editor SUP+, sweatbox I1+, config/airport ADM
- Fix pilot rating options: full scale for editors (no actor pilot ceiling)
- Refresh rejects inactive/suspended; DeleteUser for permanent self-delete
- Dashboard/nav as user home with Account + capability-gated tools
2026-07-27 18:36:41 -04:00
Reese Norris
d14dab8736 web: add site-wide dark mode with shared theme tokens
Bootstrap data-bs-theme + localStorage toggle in layout chrome; map
console CSS (users/sweatbox/airport editor) onto shared --ofs-console-*
tokens; swap OSM basemap for dark maps. Include PE and webjs coverage,
and the approved sweatbox TWRTrainer P2 command-parity design doc.
2026-07-27 17:59:01 -04:00
Reese Norris
9a547c8fa6 Merge airport editor undo/redo stack into dev 2026-07-27 17:34:26 -04:00
Reese Norris
9e5389ffbc web: add sweatbox instructor user manual
Serve a full HTML manual at /sweatbox/manual (Administrator, no FSD
dependency) and link it from the control panel titlebar in a new tab
without changing the dense operator layout.
2026-07-27 17:34:12 -04:00
Reese Norris
901b689d5e fix: address review feedback for airport-editor undo/redo wiring 2026-07-27 16:50:13 -04:00
Reese Norris
b590bc7d6b airport-editor: wire undo/redo (keyboard, gestures, all commits)
Wire history stack into main.js: record-before mutations, drag
gestures, draw push-on-success, bootstrap/Open/New hash seed,
keyboard Mod+Z/Y/Shift+Z when !inField. No toolbar buttons.
2026-07-27 16:50:13 -04:00
Reese Norris
9328d32380 fix: address review feedback for airport-editor pure history module
Harden createHistory maxDepth (floor then positive finite) and cover
redo-path undo stack trim in unit tests.
2026-07-27 16:50:12 -04:00
Reese Norris
7be290f709 airport-editor: add pure undo/redo history stack module
Pure history.js with snapshot stack, gesture coalescing, and dirty
baseline helpers. Node unit tests only; no main.js wiring.
2026-07-27 16:50:12 -04:00
Reese Norris
87b9a508f3 airport-editor: restore kind colors on vertex nodes
Vertex circleMarkers now use the surfaceStyle palette (taxi blue-gray,
runway near-black, hold orange, parking green) so types stay distinct
while keeping centered grab handles and drag behavior.
2026-07-27 15:51:48 -04:00
Reese Norris
d80023d634 airport-editor: stop status flash from scrolling the map on vertex grab
Vertex drag auto-selects a surface; the select tip unhid a banner and
reflowed the layout under the cursor. Skip the tip while dragging and keep
the status strip always one line tall so messages never shove the map.
2026-07-27 15:48:57 -04:00
Reese Norris
32386cb219 airport-editor: center vertex nodes with circleMarker
divIcon knobs were offset because CSS margin:0 !important wiped Leaflet
iconAnchor margins (marginLeft/Top), pinning the disc corner on the lat/lng.
Use L.circleMarker instead so the visual is always centered on the point.
2026-07-27 15:45:40 -04:00
Reese Norris
e33dab35eb airport-editor: always-on small vertices, grab without pre-select
Show 10px centered nodes on all surfaces in Select mode. Capture hit-test
finds the nearest vertex on any surface (no click-to-select first) and
auto-selects that surface. Fix knob offset via border-box + override of
leaflet-div-icon defaults; do not snap vertex to cursor on mousedown.
2026-07-27 15:33:27 -04:00
Reese Norris
e8c6965fe0 airport-editor: fix selection clearing on feature click (Leaflet _stopped)
Root cause: clicking a taxiway selected it (blue highlight) then the same
DOM click re-fired on the map and cleared selection, so handles never stayed
visible and vertex drag could not run.

Leaflet only stops map re-fire when originalEvent._stopped is set; native
stopPropagation alone does not set that flag. Set _stopped, disable path
bubblingMouseEvents, and gate map clicks after feature clicks. Disable boxZoom
(blue rectangle). Cache-bust static module URLs (assets are go:embed).
2026-07-27 15:22:44 -04:00
Reese Norris
1e5127874a airport-editor: fix vertex drag map-pan steal via capture hit-test
RCA: Leaflet Map.Drag listens for mousedown on the map container. Vertex
handle DOM hits were unreliable (pane pointer-events, non-interactive
stacking), so the container always received the gesture and panned the map.

Fix: capture-phase listener on the map container hit-tests selected-surface
vertices in pixel space; on hit, stopImmediatePropagation, disable map
dragging, and document-track the pointer while live-updating polyline
setLatLngs. Handles are visual-only. Pure findNearestVertexPx unit-tested.
2026-07-27 15:17:26 -04:00
Reese Norris
6bf6709250 airport-editor: make existing vertex drag reliable with live polylines
Replace fragile L.Marker.draggable divIcon handles with document-level
pointer capture, a dedicated high z-index vertex pane, and live
setLatLngs/setLatLng while dragging. Fix CSS that overrode Leaflet
marker position:absolute (which broke hit targets).
2026-07-27 15:12:52 -04:00
Reese Norris
c24220700a fix: address review feedback for airport-editor select-mode drag status tip
Clear stale surface-drag tip when selection is cleared or leaves a surface.
2026-07-27 14:53:01 -04:00
Reese Norris
e33ca238f6 airport-editor: select-mode drag status tip and design note
Surface selection shows a short tip to drag handles. Promote the vertex-drag
design doc and note rail-only vertex delete vs Del deleting the surface.
2026-07-27 14:53:01 -04:00
Reese Norris
f2dd5a609c airport-editor: fix vertex drag (live geometry, handles, click suppress)
Make selected surface vertices reliably draggable with live polyline/marker
updates, single aligned handles, and post-drag map-click suppress that does
not block full refresh on dragend.
2026-07-27 14:52:59 -04:00
Reese Norris
dd9f61a460 fix: address review feedback for cleanup program
Scrub residual classic dual-path godoc; assert PilotRating sticky on JWT
and PPL-success auth paths (incl. invalid rating → 0); log coalesce
outbound constructor errors before gnet.Close.
2026-07-27 14:14:16 -04:00
Reese Norris
49229b740a datafeed: export pilot rating and flight plan via online_users; stop fabricating QNH
Extend serviceapi pilot/ATC DTOs; store PilotRating on LoginData at auth;
populate online_users from session snapshot. Datafeed drops outer
PilotRating/TextATIS, maps info-section to FlightPlan object, zeros
military/QNH, and uses ConfigFsdServerIdent for server (fallback OPENFSD).
2026-07-27 13:58:10 -04:00
Reese Norris
b7fbae4577 server: remove classic FSD accept/event path; gnet only
Delete handleConn/eventLoop/readLoginPackets, runClassicFSD/listenLoop,
and Deps.Listen/ForceClassicFSD/Server.listen/useClassicFSD. Always run
gnet. Rewrite TestRunServiceHTTPAndListen to use FSDBound select
readiness. Convert verifyperf to gnet-only baseline. Keep shared auth,
broadcast, MOTD helpers and SenderWorker for sweatbox synthetics.
2026-07-27 13:53:18 -04:00
Reese Norris
a31aa38d8a hygiene: remove panics from web JWT helper and CoalesceOutbound
getJwtContext returns nil when missing/wrong type; requireJwtContext
aborts with 500 at every non-optional call site so handlers fail closed
without panic. NewCoalesceOutbound returns (*CoalesceOutbound, error)
instead of panicking on nil writeAsync. Tracks the cleanup design doc.
2026-07-27 13:45:19 -04:00
Reese Norris
7a2d5794e9 chore: track colocated memory DSN test and sweatbox stylesheet
Add missing main_test for normalizeColocatedMemoryDSN and the sweatbox
operator console CSS that was left untracked.
2026-07-23 21:17:32 -04:00
Reese Norris
287100acf8 fix(web): airport editor map size + drop no-JS text fallback
Pin the enhanced map host to a definite viewport height and invalidate
Leaflet size on layout changes so OSM tiles fill the pane. Remove the
bottom apt/air text backup forms to reclaim console space.
2026-07-23 21:17:32 -04:00
Reese Norris
f58157b113 merge: e2e CI flake fixes (ATC chat + beacon) onto dev
Bring in fix/ci-dev: harden TestE2E_ATCChatAndITRange and
TestE2E_BeaconAssignAndFPRequest against gnet cross-connection races.
2026-07-23 21:00:52 -04:00
Reese Norris
eac0b579e5 merge: users page refactor and pilot PPL gate onto dev
Merge refactor/users-page work: dense Users directory, instructor rating
adjust, pilot_rating VATSIM scale, and optional REQUIRE_PILOT_PPL.
2026-07-23 20:56:15 -04:00
Reese Norris
6f80c534d9 web: airport-editor validation UX and docs polish
Live client + server confirm validation panel, empty states, sweatbox
handoff copy, and residual docs.
2026-07-23 20:37:49 -04:00
Reese Norris
1726fbe751 merge: combine validate API (PR5) with editor edit modes (PR7) 2026-07-23 20:24:58 -04:00
Reese Norris
840c92b12b fix: JWT auth loads user for pilot PPL gate; unit test REQUIRE_PILOT_PPL
Populate user store in JWT auth tests and add TestAttemptAuth_RequirePilotPPL
covering pilot reject / ATC allow / PPL allow.
2026-07-23 20:17:30 -04:00
Reese Norris
ed32e93220 web: airport-editor draw/edit modes and Blob download
Full edit loop: draw park/taxi/rwy/hold/aircraft, vertex edit, Blob
download, dirty hash + Mark clean, Raw preview+Apply.
2026-07-23 20:16:51 -04:00
Reese Norris
3bc93e0101 feat: optional REQUIRE_PILOT_PPL gate for pilot FSD logins
Add config REQUIRE_PILOT_PPL (default false). When enabled, #AP pilot
connections need pilot_rating PPL or higher; ATC is unchanged. Exposed
in admin config editor and /api/v1/config.
2026-07-23 20:13:33 -04:00
Reese Norris
2df0ee6eb8 protocol: match VATSIM pilot rating IDs and names
Use the official pilot scale (0 P0, 1 PPL, 3 IR, 7 CMEL, 15 ATPL,
31 FI, 63 FE) for storage, UI labels, validation, and docs.
2026-07-23 20:05:54 -04:00
Reese Norris
660c135757 fix: address review feedback for airport-editor map layers
Tooltip XSS: bind textContent Element tooltips; escapeHtml unit-tested.
Toolbar-only basemap; list Enter/Space; dead branch; document blank-tile hook.
2026-07-23 20:00:15 -04:00
Reese Norris
cdb82fcc53 docs(web): document instructor vs supervisor user-admin privileges 2026-07-23 19:53:21 -04:00
Reese Norris
85e8e8880a web: instructor rating adjust; SUP+ full mutate; pilot_rating
I1–I3 may open the Users directory and set network/pilot ratings up to
their own ceilings on any certificate. Create and name/password remain
Supervisor+. Add users.pilot_rating (0–5) via migration.
2026-07-23 19:53:03 -04:00
Reese Norris
dd04b4c004 web: airport-editor map layers and surface/aircraft lists (read-only)
Load APT/AIR, render OSM map layers, select for inspector view, fit bounds.
Hard scope: no draw tools or Blob download yet.
2026-07-23 19:52:28 -04:00
Reese Norris
e67e1dc3d2 merge: combine airport-editor shell (PR3) with webjs modules (PR4) 2026-07-23 19:42:40 -04:00
Reese Norris
cbe41611dd fix: address review feedback for webjs parse-format modules 2026-07-23 19:42:28 -04:00
Reese Norris
4da89f3e20 web: read-only edit rail for higher-rated users
Supervisors can open Administrator accounts in the directory but see a
disabled view (no Update). Unauthorized POSTs still fail server-side.
2026-07-23 19:39:01 -04:00
Reese Norris
3a74a97a10 webjs: APT/AIR parse-format modules with parity tests
ES modules under static/airport-editor; Node tests in webjs/ import
via relative path; check-webjs.sh + CI Node 20.
2026-07-23 19:36:58 -04:00
Reese Norris
eecc145a45 web: Admin validate-apt/air JSON API via pkg/twrfiles
Stateless POST validators with Admin 403 JSON (never redirect).
APIV1 envelope; data.errors only; no geometry return.
2026-07-23 19:36:33 -04:00
Reese Norris
d5b1819f4a web: dense user directory with filterable list and rail forms
Replace the three-card user editor with an SSR directory plus create/edit
rail. Filters live in the URL, POST preserves them via dir_* fields, and
users.css provides a dense 16:9 layout. PE tests cover search, sort,
pagination, and rating-ceiling scoping.
2026-07-23 19:35:09 -04:00
Reese Norris
eb88d7a93a fix: address review feedback for db ListUsers CountUsers
Strengthen LIKE metachar and CountUsers tests: escapeLike unit table,
literal %/_/\ seed matches, CountUsers with Query and Limit/Offset ignored.
2026-07-23 19:32:55 -04:00
Reese Norris
d044980e6e db: add UserListFilter ListUsers and CountUsers
Add filterable list/count APIs with safe LIKE escaping, sort whitelist,
default limit 50 / cap 200, and list SELECT without password hashes.
2026-07-23 19:32:55 -04:00
Reese Norris
6695a3a63c fix: address review feedback for twrfiles extract
Docs point fixtures at pkg/twrfiles/testdata; export DefaultRegistration;
tighten coverage tests; drop dead legacy fixture paths; AGENTS wire checklist.
2026-07-23 19:16:40 -04:00
Reese Norris
a3e74fa6bd fix(e2e): harden ATC chat and beacon tests against gnet races
CI race runs failed intermittently on TestE2E_ATCChatAndITRange and
TestE2E_BeaconAssignAndFPRequest after security/gnet hardening.

- Wait for pilot $FP broadcast before SERVER:FP re-request so the plan is
  stored across event loops (empty plan skipped #PC beacon).
- Exchange ATC % positions until peers observe each other before @49999
  chat and @94835 IT range fan-out.
2026-07-23 19:15:08 -04:00
Reese Norris
7832aa18f4 fix: address review feedback for airport-editor shell
Parse form before CSRF so oversized bodies get size flash not 403;
add body-size and POST authz PE tests; slog.Debug; AIR attachment assert.
2026-07-23 19:14:00 -04:00