SUBTASK #49: Scan screen (1.3.1, 1.3.2) and message display (SH-5)
I maintainer di solito rispondono entro 1 giorno
@Solo-Her0 ci sta già lavorando.
Dal 26/10/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
What to do
The page where a user starts a scan and watches it run: a scope field and a Start Scan button (1.3.1), and a live view of the scan's progress and outcome (1.3.2). Also the shared pieces every later screen will reuse: one way to call the API (BB-7) and one way to show messages (SH-5).
Built as the product's React app (Vite), in its own project at frontend/app/. This is separate from the dev-only CRUD page in frontend/crud-react/, which is not part of the product and should not be imported from.
Background
- Spec: NFR-01, WF-01, FR-13, OUT-04 (a rejection comes with a reason), OUT-06 (scan status and errors), CM-09, CM-11 and CM-15 (see that a scan is running and who started it)
- System design: 1.3.1 Capture Scan Request, 1.3.2 Show Scan Status ("display running or finished state, who started it, and errors"), SH-5 Display Message (confirmations, rejections, conflict notices, errors), BB-7 Service Request Client; section 3 tier rules (the UI only talks to the API)
- The API and its JSON: SUBTASK #49: Scan and device API endpoints #51 (the shapes there are the contract)
- Rules are in Minimal Application Controller, Scan API and Screens (2.0, 1.3, 1.2.1) #49
- The React + Vite setup follows the CRUD page (
frontend/crud-react/): same Vite version,/apiproxy, oxlint
Steps
Project setup
-
frontend/app/: a new Vite + React project (npm create vite@latest, React, JavaScript), plusreact-router-dom -
vite.config.js: proxy/apito #50's app (use the port #50 settles on; it must differ from the CRUD server's 5000 if both are to run at once) - Routes:
/scansis this screen,/redirects to it,/devicesis a placeholder that subtask 4 fills in -
npm run lintpasses with no warnings; add oxlint'sreact/no-dangerrule as an error (see the XSS step) -
frontend/app/README.md: how to install, run in dev, and build (Node 20.19+);node_modules/anddist/are git-ignored
Shared pieces (every screen will use these)
-
src/components/api.js, BB-7 Service Request Client: oneapi(path, { method, body })function for every API call. Sends and receives JSON, and turns any failure into one error shape, anApiErrorwithstatusandmessage: the server's{"error": ...}text, or "Can't reach the server" (andunreachable: true) when the app is down - Sample mode: with
VITE_USE_SAMPLES=trueinfrontend/app/.env.local,api()returns the sample JSON from #51 (insrc/samples/) instead of calling the server, so the screen can be built before the API exists -
src/components/Messages.jsx, SH-5 Display Message: aMessageProvideraround the app, auseMessages()hook givingshowMessage(kind, text)with kindssuccess,warning(for example, a refusal) anderror, and one<MessageArea />that shows them the same way on every screen. Success and warning messages are in anaria-live="polite"region, errors inrole="alert", so screen readers announce them -
src/styles/app.css: shared styles for the page, messages, progress bar and tables (subtask 4 uses them too)
The scan screen: src/views/scans/ScanScreen.jsx (plus small components and hooks beside it as needed)
- When the page opens, ask
GET /api/scans/status:- A scan is running (maybe someone else's): show its progress and start following it (CM-15)
- Otherwise: show the last scan's outcome, and pre-fill the scope with the last scan's scope
- 1.3.1, start a scan: a scope field and a Start Scan button
-
POST /api/scans. 202: start following the scan. 409: show the refusal as a warning ("A scan started by sam at 14:03 is still running") and start following that scan. 400: show the reason as an error - The scope is checked by the server (SH-1); the page only stops an empty submit
- The button is disabled while a scan runs
-
- 1.3.2, follow a scan: a
useScanStatus()hook pollsGET /api/scans/statusevery 2 seconds while a scan runs, and the screen shows:- Who started it, when, and the scope
- The phase in plain words ("Finding devices", "Saving results") with a progress bar for done / total ("120 of 254")
- Errors so far, as a list
- When it ends: stop polling; show the outcome (success as a confirmation, partial as a warning with its reasons, failed as an error) and a link to the device list (
/devices) - If the server can't be reached, show it once (not every 2 seconds) and keep trying every 5 seconds; clear the message when it answers again
- The polling timer is cleared when the screen closes or the scan ends (an effect cleanup), so no requests keep running after leaving the page. Check it still behaves under React StrictMode, which runs effects twice in development
- Cross-site scripting: text from the server is only ever rendered as
{text}in JSX, which React escapes. NeverdangerouslySetInnerHTML. Error messages and, later, device names come from the network and could contain markup. Thereact/no-dangerlint rule enforces this
Serving it
- Development:
npm run devinfrontend/app/(http://localhost:5173), with #50's app running for the API - The real app and the demo:
npm run buildcreatesfrontend/app/dist/; #50's app serves those files at/, and sendsindex.htmlfor any non-/apipath so/scansand/deviceswork on refresh. Node is needed to build, not to run - A
dev.pycommand for the build (e.g..\dev build-ui), or a note in the README, so nobody demos a stale build
Testing
- Build against the sample JSON from #51 first (sample mode above), then point it at the real API
- Optional: Vitest unit tests for
api.js(server error, unreachable, 204) and for the status-to-text mapping (phases, outcomes) - A manual test checklist in the PR: start a scan; open a second browser tab and click Start (refusal shown, progress followed); stop MAMP mid-scan (failed outcome shown); stop the app (unreachable message once, recovers when restarted); refresh on
/scanswith the built app (still loads)
Where
frontend/app/ (new Vite project): src/components/api.js, src/components/Messages.jsx, src/styles/app.css, src/views/scans/ScanScreen.jsx (+ its hook and components), vite.config.js, README.md. The empty frontend/components/, frontend/views/ and frontend/styles/ placeholder folders can be removed.
Done when
- A scan can be started from the browser, and its progress followed to the end
- A second tab clicking Start sees the refusal naming who started the running scan, and then that scan's progress
- Partial and failed outcomes show their reasons
- The built app, served by #50 at
/, works in a current Chrome, Edge and Firefox -
npm run lintpasses with no warnings
Depends on
- #51 Scan and device API endpoints (the JSON shapes; samples first, then the real API)
- #50 Application entry point and Application Controller (the port, and serving
dist/at/)
- Lingua principale
- Python
- Stelle
- 1
- Fork
- 1
- Merge medio
- 9h 31m
- PR unite (30g)
- 36
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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Bearkat-Professionals/Software-Engineering-Project
-
SUBTASK #86: Password hashing (BB-5)Forse già presa @Edgeless6 l’ha presa 2 giorni fa. Apertabackend Low Priority subtask
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Bearkat-Professionals/Software-Engineering-Project#87 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Enhancement: Regression tests for Validate Input crash fixes (SH-1)Forse già presa @yoshi301 l’ha presa 1 giorno fa. Apertabackend Low Priority
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
Bearkat-Professionals/Software-Engineering-Project#59 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
SUBTASK #86: Manage user accounts (admin)Forse già presa @Edgeless6 l’ha presa 2 giorni fa. Apertabackend Low Priority subtask
Difficoltà 4/5 Più di una settimana Idoneità per principianti 20/100
Bearkat-Professionals/Software-Engineering-Project#92 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
SUBTASK #86: Login screen and signed-in layoutForse già presa @Solo-Her0 l’ha presa 2 giorni fa. Apertafrontend Low Priority subtask
Difficoltà 4/5 3-5 giorni Idoneità per principianti 28/100
Bearkat-Professionals/Software-Engineering-Project#91 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
SUBTASK #86: Sessions and route protection in the Application Controller (2.0)Forse già presa @javi120467 l’ha presa 2 giorni fa. Apertabackend Low Priority security subtask
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
Bearkat-Professionals/Software-Engineering-Project#90 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Bearkat-Professionals/Software-Engineering-Project
Issue simili
-
Server mode OAuth2: 'NoneType' object is not subscriptable on every request after re-submitting the OAuth2 login while already logged inForse già presa @Rarasinhoo l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
pgadmin-org/pgadmin4#10733 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
aws-samples/sample-per-model-bedrock#752 ·
I maintainer di solito rispondono entro 1 giorno
-
lesson-submission pending-review
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
Ikalus1988/MisakaNet#4452 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OCHA-DAP/topo-tools#250 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno