Skip to content

fix(designer-ui): Polish Foundry agent details, fix portal URL encoding, and add regression tests#9060

Merged
ccastrotrejo merged 4 commits intomainfrom
fix/foundry-agent-details-ui-polish
Apr 14, 2026
Merged

fix(designer-ui): Polish Foundry agent details, fix portal URL encoding, and add regression tests#9060
ccastrotrejo merged 4 commits intomainfrom
fix/foundry-agent-details-ui-polish

Conversation

@ccastrotrejo
Copy link
Copy Markdown
Contributor

@ccastrotrejo ccastrotrejo commented Apr 14, 2026

Commit Type

  • fix - Bug fix

Risk Level

  • Low - Minor changes, limited scope

What & Why

Polishes the Foundry Agent Details panel and fixes several bugs:

  1. Fix portal URL encoding — The "Edit in Foundry portal" link was generating broken URLs because the subscription GUID was passed raw instead of base64url-encoded. Added guidToBase64Url() to convert the subscription ID to the format the Foundry portal expects.
  2. Remove "Defined in Foundry" badge — The badge on the instructions label added visual noise without utility since the user already knows they selected a Foundry agent.
  3. Taller instructions textarea — Increased default height from 60px to 200px so users can read typical agent instructions without scrolling. Still resizable via resize="vertical".
  4. UI polish — Replaced solid border with subtle box-shadow for better depth on varied backgrounds. Increased row gap and padding for readability.
  5. Simplified component — Removed vestigial labelRow wrapper that no longer served a purpose after badge removal. Hoisted duplicate test fixtures to module scope.

Impact of Change

  • Users: Working "Edit in Foundry portal" links, cleaner agent editing UX with readable instructions and no redundant badge
  • Developers: guidToBase64Url exported from designer-ui for reuse. Regression tests prevent re-introduction of broken URL format and removed badge.
  • System: No architecture or state management changes

Test Plan

  • Unit tests added/updated
  • E2E tests added/updated
  • Manual testing completed
  • Tested in: Standalone designer with Foundry agent connection

New tests added (10)

  • guidToBase64Url — valid GUID encoding, uppercase handling, non-GUID fallback, URL-safe output
  • buildFoundryPortalUrl — real GUID subscription produces correct base64url segment, non-GUID passthrough
  • FoundryAgentDetails — "Defined in Foundry" badge not rendered, Instructions label present
  • filterFoundryManagedSettings — regression contract tests (designer + designer-v2) ensuring hideSystemInstructions is set

Contributors

@ccastrotrejo @copilot

ccastrotrejo and others added 2 commits April 14, 2026 10:53
- Remove "Defined in Foundry" badge from instructions label
- Increase instructions textarea default height to 200px
- Replace border with subtle box-shadow for better depth
- Increase row gap/padding for better breathing room
- Fix portal URL: base64url-encode subscription GUID to match
  Foundry portal expected format

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…URL, and add tests

- Hide user instructions for Foundry agent connections in both
  designer and designer-v2 (filterFoundryManagedSettings)
- Fix portal URL: base64url-encode subscription GUID to match
  Foundry portal expected format
- Export guidToBase64Url for testability with non-GUID fallback
- Remove "Defined in Foundry" badge from instructions label
- Add regression tests:
  - guidToBase64Url unit tests (GUID encoding, fallback, URL-safety)
  - Portal URL with real GUID subscription ID
  - Badge removal and Instructions label presence
  - Source-level contract tests ensuring both hideSystemInstructions
    and hideUserInstructions are set in filterFoundryManagedSettings

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 14, 2026 15:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Polishes the Foundry Agent Details experience and adjusts Foundry-managed parameter rendering, including fixing Foundry portal deep links by encoding subscription IDs correctly.

Changes:

  • Hide user instructions (and system instructions) when settings are Foundry-managed in both designer parameter tabs.
  • Update Foundry Agent Details UI styling (spacing, shadow, textarea height) and remove the “Defined in Foundry” badge.
  • Add guidToBase64Url and update buildFoundryPortalUrl to use base64url-encoded subscription IDs, with unit tests.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
libs/designer/src/lib/ui/panel/nodeDetailsPanel/tabs/parametersTab/index.tsx Hides user instructions along with system instructions for Foundry-managed settings.
libs/designer/src/lib/ui/panel/nodeDetailsPanel/tabs/parametersTab/test/helpers.spec.ts Adds a regression test to ensure Foundry-managed settings hide both instruction types.
libs/designer-v2/src/lib/ui/panel/nodeDetailsPanel/tabs/parametersTab/index.tsx Mirrors Foundry-managed instruction hiding behavior in v2.
libs/designer-v2/src/lib/ui/panel/nodeDetailsPanel/tabs/parametersTab/test/helpers.spec.ts Mirrors the regression test in v2.
libs/designer-ui/src/lib/foundryagentdetails/styles.ts UI polish: spacing/shadow updates and taller instructions textarea; removes badge styles.
libs/designer-ui/src/lib/foundryagentdetails/index.tsx Adds GUID→base64url conversion and updates portal URL builder; removes badge rendering.
libs/designer-ui/src/lib/foundryagentdetails/test/foundryAgentDetails.spec.tsx Adds tests for URL encoding + UI badge removal and guidToBase64Url.
Localize/lang/strings.json Removes the unused “Defined in Foundry” localization entries.

Comment thread libs/designer-ui/src/lib/foundryagentdetails/index.tsx Outdated
Comment thread libs/designer-ui/src/lib/foundryagentdetails/index.tsx
ccastrotrejo and others added 2 commits April 14, 2026 11:24
…nstructions visible

- Remove vestigial labelRow wrapper (single child after badge removal)
- Hoist duplicate baseAgent/baseModels test fixtures to module scope
- Revert hideUserInstructions — user instructions should remain
  visible but optional, not hidden entirely
- Update regression tests to match

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ion and regex-based tests

- Wrap guidToBase64Url output with encodeURIComponent for safe
  URL interpolation when subscription is not a GUID
- Replace fixed 800-char window with regex match in both designer
  and designer-v2 regression tests for robustness

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

❌ PR Validation Error

An error occurred while validating your PR. Please try again later or contact the maintainers.

Error: API request failed with status 503

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 14, 2026

📊 Coverage Check

No source files changed in this PR.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 14, 2026

🤖 AI PR Validation Report

PR Review Results

Thank you for your submission! Here's detailed feedback on your PR title and body compliance:

PR Title

  • Current: fix(designer-ui): Polish Foundry agent details, fix portal URL encoding, and add regression tests
  • Issue: None — title is descriptive, follows conventional commit style and summarizes the key changes.
  • Recommendation: None, looks good as-is.

Commit Type

  • Properly selected (fix)
  • Note: Only one option selected in the Commit Type section which is correct.

⚠️ Risk Level

  • Current PR body selection: Low
  • Issue: The PR labels on the GitHub PR do not include a risk label (e.g. risk:low, risk:medium, or risk:high). Every PR should have a risk label and it should match the Risk Level selected in the PR body.
  • Recommendation: Add a risk label to the PR that matches the body. Based on the code diff (changes across multiple libs, added URL encoding logic, and UI changes that affect portal link behavior), I advise raising the risk to Medium (label: risk:medium). Please either:
    • Add the risk:medium label to this PR, and update the PR Risk Level section to Medium, or
    • If you want to keep Low, add risk:low label and add a short justification in the PR body explaining why this remains low-risk despite the cross-library changes.

Note: I set advisedRiskLevel to risk:medium because the change introduces a new encoding function used in URL building (potential to break portal links if encoding/environment differs), modifies multiple modules, and removes localization key(s).

What & Why

  • Current: Polishes the Foundry Agent Details UI, fixes portal URL encoding (adds guidToBase64Url), removes a badge, enlarges instructions textarea, UI styling polish, and adds regression/unit tests.
  • Issue: None — the section is concise and explains the purpose of the change.
  • Recommendation: None required; well explained.

Impact of Change

  • Impact section present and clear.
  • Recommendation: Add a short note to explicitly confirm there are no consumers relying on the removed localization ID fZbvAd. If that key is used elsewhere (or in older branches), callers may break.
    • Users: Working "Edit in Foundry portal" links and cleaner UX
    • Developers: guidToBase64Url exported for reuse (ensure expected runtime availability)
    • System: No architecture/state changes

Test Plan

  • The PR claims unit tests were added/updated and the diff shows new unit/regression tests. This satisfies the Unit tests claim.
  • E2E tests were not added (marked unchecked) — acceptable, but because this change affects a portal URL and cross-library behavior, consider adding an E2E or integration smoke test (or QA sign-off) to validate the real portal link in staging.
  • Note: The tests include a new guidToBase64Url test set and regression contract tests that read source files — this is appropriate for preventing regressions.

Contributors

  • Contributors noted in PR body (@ccastrotrejo @Copilot) — good. If others contributed, add them.

⚠️ Screenshots/Videos

  • No screenshots provided (optional). For a UI polish change, adding a before/after screenshot is useful but not required. Marking as optional.

Summary Table

Section Status Recommendation
Title No change needed
Commit Type No change needed
Risk Level ⚠️ Add a risk:* label to the PR and consider risk:medium
What & Why No change needed
Impact of Change Confirm removed localization key isn't used elsewhere
Test Plan Consider adding E2E/integration smoke test or QA sign-off for portal URL behavior
Contributors No change needed
Screenshots/Videos ⚠️ Optional: add before/after screenshots for UI polish

Summary / Action Items (short):

  1. Add a risk label to the PR. Based on the diff I recommend risk:medium (the PR currently says Low in the body — please update either the label or the PR body to match). This is important for downstream reviewers and release gating.
  2. Confirm runtime compatibility of guidToBase64Url (use of btoa):
    • In Node test environments btoa may not be available. Consider using a cross-platform implementation (e.g. Buffer.from(hex, 'hex').toString('base64') then convert to base64url) or ensure a polyfill for environments that run tests or server-side rendering.
    • Example suggestion (not code-blocked here): use Buffer if available, fallback to btoa in browser. This avoids surprises in unit test environments.
  3. Verify that removing the localization key fZbvAd is safe (search repo for usage). If there are stale references in other branches or usages, either remove references or restore the key with an appropriate comment.
  4. (Optional) Add an E2E/integration smoke test or QA validation for the portal link to ensure the encoded subscription segment is accepted by the Foundry portal endpoint in staging.

Please update the label and consider the runtime-compatibility note for guid encoding. Once the label matches the PR body (or the body is updated to reflect the chosen label) and you confirm btoa compatibility or use a Node-safe approach, this PR looks ready to land.

Thank you for the clear PR description and tests — great work!


Last updated: Tue, 14 Apr 2026 17:34:17 GMT

@ccastrotrejo ccastrotrejo changed the title fix(designer-ui): Polish Foundry agent details UI, fix portal URL, and hide user instructions fix(designer-ui): Polish Foundry agent details, fix portal URL encoding, and add regression tests Apr 14, 2026
@ccastrotrejo ccastrotrejo merged commit 6fea987 into main Apr 14, 2026
15 of 16 checks passed
@ccastrotrejo ccastrotrejo deleted the fix/foundry-agent-details-ui-polish branch April 14, 2026 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants