Skip to content

fix(dev-portal): Fix context selector to display current context correctly - #5570

Open
eikeland wants to merge 2 commits into
mainfrom
agents/context-selector-current-context-fix
Open

eikeland wants to merge 2 commits into
mainfrom
agents/context-selector-current-context-fix

Conversation

@eikeland

Copy link
Copy Markdown
Contributor

This pull request addresses an issue in the dev portal's ContextSelector where the current context was not displayed correctly after being set with setCurrentContext. The following changes were made:

  • Removed the document-wide reset that was causing the internal display state to revert to "Select Context."
  • Updated the ContextSelector to pass both the selected context and the empty state through the preview prop.
  • Added a regression test to ensure the fix works as intended.

Additionally, all tests have been verified to pass, and the build process completed successfully. The changes ensure that the context is displayed correctly without requiring a refresh in the app's navigation flow.

@changeset-bot

changeset-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f62e305

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@equinor/fusion-framework-dev-portal Patch
@equinor/fusion-framework-cli Patch
@equinor/fusion-framework-vitest-plugin-react-app Patch
poc-portal Patch
portal-analytics Patch
portal Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@eikeland
eikeland marked this pull request as ready for review September 18, 2026 13:37
@eikeland
eikeland requested a review from a team as a code owner September 18, 2026 13:37
@eikeland
eikeland requested a lite review from Copilot September 18, 2026 13:39
@eikeland eikeland changed the title Fix context selector to display current context correctly fix(dev-portal): Fix context selector to display current context correctly Sep 18, 2026

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

Resolve the manifest/lockfile mismatch and add the requested README documentation.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Fixes the dev portal ContextSelector so application-driven context changes display correctly without a refresh.

Changes:

  • Synchronizes selected and empty preview states.
  • Removes document-wide reset behavior.
  • Adds regression coverage and updates Vitest configuration.
  • Adds the workspace dependency adjustment and patch changeset.
File summaries
File Summary
packages/dev-portal/vitest.config.ts Updates test dependency configuration.
packages/dev-portal/src/ContextSelector/ContextSelector.tsx Synchronizes context preview state. Nit: document the user-facing behavior in the package README.
packages/dev-portal/src/ContextSelector/ContextSelector.test.tsx Adds regression tests for updates, clearing, failures, and isolation.
packages/dev-portal/package.json Changes the workspace dependency specifier. Critical: the checked-in lockfile still has the previous specifier.
.changeset/dev-portal_current-context-preview.md Adds patch release notes.
Review details

Suppressed comments (1)

packages/dev-portal/src/ContextSelector/ContextSelector.tsx:28

  • Because this changes user-visible behavior of the published dev portal, please also update packages/dev-portal/README.md to document that application- and route-loader-driven context changes update the selector without a refresh. The repository contributor policy requires package README updates for user-facing changes, and the current README only says the selector is wired to the app context, so this behavior is not discoverable to consumers.
 * Programmatic context changes, including `setCurrentContextByIdAsync` in route
 * loaders, update the preview through the same prop as the empty state, avoiding
 * document-wide clear events that can overwrite newer previews.
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/dev-portal/package.json
@github-actions github-actions Bot added the 🐞 bug Something isn't working label Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants