Skip to content

feat(hub): port Learnings management - #225

Merged
alliscode merged 2 commits into
build/hub/newfrom
alliscode-learnings-ui-parity
Nov 13, 2026
Merged

alliscode merged 2 commits into
build/hub/newfrom
alliscode-learnings-ui-parity

Conversation

@alliscode

@alliscode alliscode commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Why

The new Hub already includes a Learnings page, but the page was still filled from temporary settings data. That made it difficult to review the real experience or connect the page to the learning backend. This change defines what the page needs and ports the existing Learnings management flow to the new Hub.

What changes

Repository administrators can now review suggested guidance together with the comments that support or disagree with it. They can accept a suggestion, edit its wording before accepting it, reject it with a reason, or retire guidance that no longer applies. The page also previews what an agent will receive and shows recent learning runs, Copilot usage, and failures.

The page handles the states people may encounter while managing learnings, including missing evidence, guidance that replaces an earlier learning, a suggestion that changed while it was being reviewed, denied access, a disconnected Copilot account, and a failed request. A failed form keeps the person's draft so they can correct or retry it.

The browser now has a dedicated contract for loading this page, requesting a learning run, and recording a decision. Local development uses the same contract with temporary in-browser data, so the stories and mock experience exercise the interface the backend will implement.

The backend still needs to provide these three repository-authorized endpoints:

  • GET /api/repositories/:repositoryId/learnings
  • POST /api/repositories/:repositoryId/learnings/runs
  • POST /api/repositories/:repositoryId/learnings/:learningId/decision

This PR does not add the learning store, review-comment import, background processing, or vision-model management.

Storybook screenshots

Hub/Pages/Learnings, dark theme, 1440 × 2400

Default

Hub Pages Learnings Default, dark theme, 1440 by 2400

Access Denied

Hub Pages Learnings Access Denied, dark theme, 1440 by 2400

Opposing Evidence

Hub Pages Learnings Opposing Evidence, dark theme, 1440 by 2400

First Visit

Hub Pages Learnings First Visit, dark theme, 1440 by 2400

Missing Metadata

Hub Pages Learnings Missing Metadata, dark theme, 1440 by 2400

Identity Revalidation

Hub Pages Learnings Identity Revalidation, dark theme, 1440 by 2400

Replacing Guidance

Hub Pages Learnings Replacing Guidance, dark theme, 1440 by 2400

Copilot Refused

Hub Pages Learnings Copilot Refused, dark theme, 1440 by 2400

Running

Hub Pages Learnings Running, dark theme, 1440 by 2400

Daily Run Waiting

Hub Pages Learnings Daily Run Waiting, dark theme, 1440 by 2400

Failed Run

Hub Pages Learnings Failed Run, dark theme, 1440 by 2400

Load Error

Hub Pages Learnings Load Error, dark theme, 1440 by 2400

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@alliscode
alliscode requested review from a team and nshki as code owners November 11, 2026 16:43
Copilot AI adaptive review requested due to automatic review settings November 11, 2026 16:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved digest-handling flaws can apply drafts to unreviewed suggestion versions and leave administrators repeatedly submitting stale data after conflicts.

8 open issues
What changed in this PR

Ports repository Learnings management from provisional settings records to a dedicated typed frontend API boundary. This remains a frontend/mock implementation; backend endpoints and persistence are not added.

Changes:

  • Adds dedicated read, run, and decision contracts and route handling.
  • Maps evidence, accepted guidance, recall, usage, permissions, and failure states into the retained page.
  • Adds local mock handlers and integration coverage, and updates stories and documentation.
File Description
hub/​docs/​frontend.md Documents Learnings endpoints and backend responsibilities.
hub/​client/​pages/​learnings-page/​types.ts Separates denied and authorized page data.
hub/​client/​pages/​learnings-page/​stories.tsx Updates access-denied and failed-run examples.
hub/​client/​pages/​learnings-page/​index.tsx Renders access denial separately from learning content.
hub/​client/​application/​hub/​view-models/​settings-learnings/​index.ts Maps the dedicated contract into page presentation.
hub/​client/​application/​hub/​settings-contracts/​types.ts Removes obsolete settings-based learning types.
hub/​client/​application/​hub/​settings-contracts/​index.ts Removes legacy learning schemas and operations.
hub/​client/​application/​hub/​screens/​settings-workspace-screen/​index.tsx Removes Learnings from the generic settings screen.
hub/​client/​application/​hub/​routes/​sidebar-consistency.test.tsx Adapts navigation coverage to the new endpoint.
hub/​client/​application/​hub/​routes/​settings-meta/​index.ts Removes generic Learnings metadata handling.
hub/​client/​application/​hub/​routes/​settings-learnings/​index.tsx Implements dedicated loading and decision submissions.
hub/​client/​application/​hub/​routes/​settings-form-operation/​index.tsx Removes legacy learning form translation.
hub/​client/​application/​hub/​routes/​settings-controller/​index.tsx Removes Learnings from shared settings loading.
hub/​client/​application/​hub/​routes/​route-naming.test.tsx Updates repository-scoped run and acceptance coverage.
hub/​client/​application/​hub/​routes/​learnings-flow.test.tsx Adds contract, decision, access, and failure coverage.
hub/​client/​application/​hub/​routes/​expanded-flows.test.tsx Migrates route wiring and removes superseded cases.
hub/​client/​application/​hub/​mocks/​create-settings-store/​index.ts Removes legacy learning state and exposes shared services.
hub/​client/​application/​hub/​mocks/​create-mock-store/​index.ts Initializes the dedicated learning store.
hub/​client/​application/​hub/​mocks/​create-mock-handlers/​index.ts Registers Learnings handlers.
hub/​client/​application/​hub/​mocks/​create-learnings-store/​index.ts Adds tab-lifetime learning state and mutations.
hub/​client/​application/​hub/​mocks/​create-learnings-handlers/​index.ts Implements the three mock HTTP endpoints.
hub/​client/​application/​hub/​learnings-contracts/​types.ts Defines response and decision types.
hub/​client/​application/​hub/​learnings-contracts/​index.ts Adds runtime response and input validation.
hub/​client/​application/​hub/​learnings-contracts/​index.test.ts Covers response shapes and decision validation.

Review effort: Max (auto)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alliscode
alliscode merged commit bc0171b into build/hub/new Nov 13, 2026
33 checks passed
@alliscode
alliscode deleted the alliscode-learnings-ui-parity branch November 13, 2026 15:54
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.

3 participants