Skip to content

fix(DesignerV2): Optimized useHandoffActionsForAgent hook, standalone improvement#8802

Merged
rllyy97 merged 2 commits intomainfrom
riley/useHandoffActionsForAgent-hook-optimization
Feb 10, 2026
Merged

fix(DesignerV2): Optimized useHandoffActionsForAgent hook, standalone improvement#8802
rllyy97 merged 2 commits intomainfrom
riley/useHandoffActionsForAgent-hook-optimization

Conversation

@rllyy97
Copy link
Contributor

@rllyy97 rllyy97 commented Feb 9, 2026

Commit Type

  • feature - New functionality
  • fix - Bug fix
  • refactor - Code restructuring without behavior change
  • perf - Performance improvement
  • docs - Documentation update
  • test - Test-related changes
  • chore - Maintenance/tooling

Risk Level

  • Low - Minor changes, limited scope
  • Medium - Moderate changes, some user impact
  • High - Major changes, significant user/system impact

What & Why

Optimized the useHandoffActionsForAgent to not cause as many rerenders
Also improved our standalone auto-saving to better mimic portal's implementation (this does not impact production, it only changes the behavior in standalone which is only used during development)

Impact of Change

  • Users: Fewer rerenders using the useHandoffActionsForAgent hook
  • Developers: N/A
  • System: N/A

Test Plan

  • Unit tests added/updated
  • E2E tests added/updated
  • Manual testing completed
  • Tested in:

(DesignerCommandBarV2.tsx does not need testing since it is a dev-only component)

Contributors

@rllyy97

Screenshots/Videos

N/A

Copilot AI review requested due to automatic review settings February 9, 2026 23:39
@github-actions
Copy link

github-actions bot commented Feb 9, 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(DesignerV2): Optimized useHandoffActionsForAgent hook, standalone improvement
  • Issue: The title is generally descriptive but is doing two distinct things (hook optimization in core library + standalone autosave UX/behavior). That can make it harder for reviewers to understand scope at-a-glance and for release notes to categorize the change.
  • Recommendation: Either keep but make it slightly more explicit (and keep both scopes) or split into two PRs if possible. Example recommendation:
    • fix(DesignerV2): Optimize useHandoffActionsForAgent selector to avoid extra rerenders
    • fix(Standalone): improve standalone auto-save throttling and status UI

Commit Type

  • Properly selected (fix).
  • Note: Only one commit type is selected (correct).

⚠️ Risk Level

  • The PR has the risk:low label and the PR body selects Low.
  • Assessment: I recommend raising the risk level to Medium.
    • Rationale: while parts of this PR are standalone/dev-only (DesignerCommandBarV2 adjustments), the changes also modify core library code (libs/designer-v2) — specifically the useHandoffActionsForAgent selector — which affects runtime selection logic used by consumers. The autosave changes (even if targeted at standalone) touch saving logic paths and introduce new throttling/auto-save behavior; these can have subtle production impacts. Because the diff spans both a core selector and autosave logic, Medium is a safer advised level.
  • Recommendation: Update the PR body Risk Level and/or labels from Low to Medium and add a short justification explaining why (mention core selector changes and autosave behavior changes). If you believe it truly is Low, add more tests and manual verification notes showing why production behavior is unaffected.

What & Why

  • Current: "Optimized the useHandoffActionsForAgent to not cause as many rerenders\nAlso improved our standalone auto-saving to better mimic portal's implementation (this does not impact production, it only changes the behavior in standalone which is only used during development)"
  • Issue: This is a concise explanation, but it could be expanded slightly to explain the user-visible effect or the internal cause (e.g., selector memoization / moving inputParameters lookup to correct selector) and the intended autosave behavior change (throttle interval, when it triggers, error handling).
  • Recommendation: Add one or two sentences clarifying the primary changes and expected behavior (e.g., "Selector now uses a memoized selector to avoid re-computation per render; standalone auto-save now triggers every 5s when changes are detected, with better error display").

⚠️ Impact of Change

  • The Impact section exists but is minimal. It lists Users: fewer rerenders; Developers/System: N/A.
  • Issue: Because the PR modifies libs/designer-v2 selectors and standalone autosave logic, it would be helpful to explicitly note who/what could be impacted (consumers of the selector, components that rely on the selector shape, and dev environment autosave behavior).
  • Recommendation:
    • Users: Fewer rerenders for flows using the agent handoff actions; no direct end-user visible behavior change expected from the selector itself.
    • Developers: Consumers of useHandoffActionsForAgent may notice different memoization behavior; add notes if selector shape or returned object changed (it appears unchanged but confirm).
    • System: Autosave cadence changed in standalone; note risk of increased save attempts or suppressed saves if throttling logic is incorrect. Consider adding a short note about error reporting (autosave now surfaces errors via an inline badge).

Test Plan

  • Test plan claims: Unit tests added, Manual testing completed.
  • Assessment: ✅ Verified a new unit test file was added: libs/designer-v2/src/lib/ui/panel/workflowParametersPanel/test/workflowParametersPanel.spec.tsx. That matches the claim that unit tests were added.
  • Recommendation: Consider adding a small unit test that covers useHandoffActionsForAgent behavior (since that was a targeted optimization in libs/designer-v2). If you believe manual testing suffices for the autosave behavior, expand the Test Plan to list the manual steps you used and environments tested (e.g., "Standalone app in local dev: made N changes, autosave triggered within 5s, last-saved badge updated, error shown when save fails").

Contributors

  • Contributors listed: @rllyy97 — OK.
  • Note: If more people contributed (PM/Design/Review), consider adding them here for attribution, but this is optional.

⚠️ Screenshots/Videos

  • Screenshots: N/A — acceptable for non-visual or minor UI updates.
  • Recommendation: For the autosave UI change (Badge + Tooltip), consider adding one screenshot (or short GIF) so reviewers can quickly confirm visual/UX changes.

Summary Table

Section Status Recommendation
Title ⚠️ Make title more specific or split into two PRs if feasible
Commit Type No changes needed
Risk Level ⚠️ Update to Medium in PR body/labels and add justification
What & Why Expand slightly to clarify intended behavior and cause
Impact of Change ⚠️ Expand impact to include developers & system notes
Test Plan Good — add unit test for useHandoffActionsForAgent or manual test steps for autosave
Contributors OK (optional: add more names if applicable)
Screenshots/Videos ⚠️ Consider adding a screenshot of the autosave badge/error tooltip

Final message
Please update the PR body to state the Risk Level as Medium (or justify Low with additional tests / reasoning), and expand the What & Why and Impact sections slightly. If possible, either split the changes into two PRs (selector fix in libs and standalone autosave in apps) or make the title explicitly mention both scopes as you have now but consider the suggested title format for clarity.

Suggested next steps:

  • Change risk selection and label to Medium and add 1-2 sentence justification (core selector + autosave behavior touches).
  • Add/mention a unit test for useHandoffActionsForAgent (or provide a manual test checklist demonstrating no consumer breakage).
  • Optionally add a screenshot for the new autosave badge/error tooltip.

After these small updates, this PR should be good to merge. Thank you for the clear PR body and for adding unit tests — that makes review much easier!


Last updated: Tue, 10 Feb 2026 17:08:58 GMT

Copy link
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

This PR optimizes Designer V2 re-render behavior by memoizing selector outputs/callbacks (notably useHandoffActionsForAgent) and updates the Standalone designer’s draft auto-save UX/behavior to be more portal-like.

Changes:

  • Memoize useHandoffActionsForAgent selector creation to reduce unnecessary re-renders.
  • Optimize WorkflowParametersPanel by memoizing mapped parameters and stabilizing dispatch callbacks; add unit tests for the panel.
  • Rework Standalone draft auto-save cadence/notification UI (throttled saves, relative-time badge, error display).

Reviewed changes

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

File Description
libs/designer-v2/src/lib/ui/panel/workflowParametersPanel/workflowParametersPanel.tsx Memoizes parameter mapping and action handlers; currently introduces an any cast for validationErrors.
libs/designer-v2/src/lib/ui/panel/workflowParametersPanel/test/workflowParametersPanel.spec.tsx Adds unit coverage for prop wiring and dispatch handlers (with one assertion gap noted).
libs/designer-v2/src/lib/core/state/workflow/workflowSelectors.ts Optimizes useHandoffActionsForAgent selector memoization by avoiding unstable combined-state selectors.
apps/Standalone/src/designer/app/AzureLogicAppsDesigner/DesignerCommandBarV2.tsx Changes draft auto-save behavior and adds a status badge with relative time + error tooltip.

@github-actions
Copy link

github-actions bot commented Feb 9, 2026

📊 Coverage check completed. See workflow run for details.

@rllyy97 rllyy97 added the risk:low Low risk change with minimal impact label Feb 10, 2026
@rllyy97 rllyy97 changed the title fix(DesignerV2): Optimized useHandoffActionsForAgent hook fix(DesignerV2): Optimized useHandoffActionsForAgent hook, standalone improvement Feb 10, 2026
@rllyy97 rllyy97 enabled auto-merge (squash) February 10, 2026 17:16
@github-actions
Copy link

📊 Coverage check completed. See workflow run for details.

@rllyy97 rllyy97 merged commit f232b9e into main Feb 10, 2026
13 checks passed
@rllyy97 rllyy97 deleted the riley/useHandoffActionsForAgent-hook-optimization branch February 10, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-validated risk:low Low risk change with minimal impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants