Skip to content

Feature/ppi f03 ppi widget states - #504

Open
David-Tenni wants to merge 1480 commits into
thoth-tech:developmentfrom
ontrack-features-t2-2026:feature/PPI-F03-ppi-widget-states
Open

Feature/ppi f03 ppi widget states#504
David-Tenni wants to merge 1480 commits into
thoth-tech:developmentfrom
ontrack-features-t2-2026:feature/PPI-F03-ppi-widget-states

Conversation

@David-Tenni

Copy link
Copy Markdown

Description

Adds safe loading, hidden, unavailable, disabled, stale and error states to the peer progress indicator widget that renders inside the task description card. Built on top of Gurwinder's PPI data contract PR (#5, feature/ppi-data-contract) — this PR is what consumes that data contract for the first time in the UI.

The new f-ppi-widget component takes a Task and TaskDefinition, calls PeerProgressIndicatorService.getIndicator(), and routes the response through a pure resolvePeerProgressState() function into one of the eight UI states (loading / success / no-data / hidden / unavailable / disabled / stale / error). Plain-language messages for the "safe" states come from the API's unavailableMessage field so the widget never leaks why another student's data is hidden. Stale peer values never appear after an error, new request, or task switch — the state resolver only reads response data when the request is not loading and has no error, and the widget cancels in-flight requests before starting new ones.

Fixes PPI-F03.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • 21 unit tests total (11 on PpiWidgetComponent, 10 on resolvePeerProgressState) covering every state, loading→success and loading→error transitions, and cancellation of in-flight requests when the task changes.
  • Full local run: docker compose exec doubtfire-web npx ng test --watch=false → 21/21 of my tests pass, no regressions in other spec files.
  • Verified visually at localhost:4200 by hard-coding each mock state in the widget's load() method ('normal' / 'zero' / 'suppressed' / 'unavailable' / 'stale' / 'disabled') and screenshotting each — see below.

To reproduce locally: log in as student_1 / password, open any task in COS10001, and observe the widget beneath the task description. To preview each state, change the 4th argument of .getIndicator(...) in ppi-widget.component.ts to one of the six mock keys.

Testing Checklist:

  • Tested in latest Chrome
  • Tested in latest Firefox

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • [X ] I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have requested a review from @macite and @jakerenzella on the Pull Request

Blocker / next-step notes

  • Local test runner needed @vitest/browser-playwright, which isn't in package.json on the base branch. I installed it locally to get tests running but deliberately left the package.json / package-lock.json changes out of this PR since it's a dev-env issue and not part of PPI-F03. Flagging separately to Maple. Reviewers running tests locally will need npm install --save-dev @vitest/browser-playwright in the web container first.
  • The 4th argument to PeerProgressIndicatorService.getIndicator() is hardcoded to 'normal' — this is how PR migrate: bootstrap rating #5's mock service picks which state to return. This argument goes away entirely once a real backend replaces the mock.

b0ink and others added 30 commits July 6, 2026 10:47
…pm_and_yarn/postcss-8.5.16

chore(deps-dev): bump postcss from 8.5.15 to 8.5.16
…pm_and_yarn/tailwindcss/postcss-4.3.2

chore(deps): bump @tailwindcss/postcss from 4.3.1 to 4.3.2
…pm_and_yarn/typescript-eslint/parser-8.62.1

chore(deps-dev): bump @typescript-eslint/parser from 8.62.0 to 8.62.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants