Skip to content

feat(designerv2): Adding support for knowledge hub editor in designer - #9603

Merged
preetriti1 merged 16 commits into
mainfrom
priti/knowledgev2
Sep 12, 2026
Merged

feat(designerv2): Adding support for knowledge hub editor in designer#9603
preetriti1 merged 16 commits into
mainfrom
priti/knowledgev2

Conversation

@preetriti1

@preetriti1 preetriti1 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

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

Adding knowledge hub editor in v2 designer, just copied over the implementation with minor changes on styling since this is v2. This feature was present in v1 for few months now.

Impact of Change

  • Users: New knowledge hub editor available in the v2 designer for configuring hubs, artifacts, and OpenAI/Cosmos DB connections.
  • Developers: New knowledge utils/state (connection.ts, helper.ts, queries.ts, slices), new resourceService in ServiceOptions, and CustomConnectionParameterEditorServiceV2
  • System: Adds Resource Service init and new management API calls (knowledgeHubs PUT/DELETE); draft connection persistence via connections-draft.json

Test Plan

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

Screenshot

knowledgev2

Copilot AI balanced review requested due to automatic review settings September 4, 2026 20:38
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🤖 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: feat(designerv2): Adding support for knowledge hub editor in designer
  • Issue: None — valid feat: prefix with scope and a descriptive summary.
  • Recommendation: No change needed.

Commit Type

  • Exactly one type selected (feature - New functionality).
  • Note: The label reads feature; the canonical template value is feat. Cosmetic only — not blocking.

Risk Level

  • Declared Medium (body) and risk:medium label agree, and this matches the advised estimate. New designer-v2 runtime code, state/slice additions, new Resource Service init, and new management API calls (knowledgeHubs PUT/DELETE) with draft connection persistence are moderate-impact, feature-gated additions — Medium is correct.

What & Why

  • Current: Clear explanation that the knowledge hub editor is ported from v1 to v2 with minor styling changes.
  • Issue: None.
  • Recommendation: No change needed.

Impact of Change

  • All three dimensions filled (Users, Developers, System).
  • Recommendation:
    • Users: Already covered — new knowledge hub editor in v2 designer.
    • Developers: Already covered — new utils/state, resourceService, editor service.
    • System: Already covered — Resource Service init and new management API calls.

Test Plan

  • Unit tests added/updated (confirmed in diff: connection.spec.ts, helper.spec.ts, queries.spec.ts, plus updated builtintools/initialize specs). Manual testing also checked. Satisfies CHECK TESTS.

⚠️ Contributors

  • Section is blank. Consider crediting any PMs/designers involved. Not blocking.

Screenshots/Videos

  • Visual change in designer-v2/designer-ui, and a screenshot (knowledgev2) is provided. Requirement met.

Summary Table

Section Status Recommendation
Title No change needed
Commit Type Optionally use feat label wording
Risk Level Medium is correct
What & Why No change needed
Impact of Change No change needed
Test Plan Unit tests + manual present
Contributors ⚠️ Credit PMs/designers if any
Screenshots/Videos Screenshot provided

All required checks pass. This PR is compliant and cleared to merge. Address the Contributors nudge if applicable.


Powered by: Copilot CLI (claude-opus-4.8) | Last updated: Sat, 12 Sep 2026 04:05:00 GMT

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

Moderate issues remain in cache scoping, validation, upload behavior, filename state, cancellation, and notification wiring.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Ports the Knowledge Hub editor to Designer v2, including connection setup, file management, state, service integration, and tests.

Changes:

  • Adds Knowledge Hub editor dialogs and workflows.
  • Adds connection, query, upload, and Redux infrastructure.
  • Enables Knowledge Hub services in Standalone Designer v2.
File summaries
File Description
libs/designer/src/lib/ui/knowledge/editor/styles.ts Adjusts editor spacing.
libs/designer-v2/src/lib/ui/knowledge/panel/styles.ts Adds panel styles.
libs/designer-v2/src/lib/ui/knowledge/panel/files/useFileHooks.tsx Manages file-upload state and actions.
libs/designer-v2/src/lib/ui/knowledge/panel/files/uploadfile.tsx Implements file and group selection.
libs/designer-v2/src/lib/ui/knowledge/panel/files/filelist.tsx Implements file metadata editing.
libs/designer-v2/src/lib/ui/knowledge/panel/connection/usepaneltabs.tsx Coordinates connection setup tabs.
libs/designer-v2/src/lib/ui/knowledge/panel/connection/tabs/model.tsx Adds model configuration.
libs/designer-v2/src/lib/ui/knowledge/panel/connection/tabs/basics.tsx Adds basic connection configuration.
libs/designer-v2/src/lib/ui/knowledge/panel/connection/__test__/usepaneltabs.spec.tsx Tests connection tab orchestration.
libs/designer-v2/src/lib/ui/knowledge/panel/connection/__test__/model.spec.tsx Tests model configuration.
libs/designer-v2/src/lib/ui/knowledge/panel/connection/__test__/basics.spec.tsx Tests basic configuration.
libs/designer-v2/src/lib/ui/knowledge/modals/styles.ts Adds modal styles.
libs/designer-v2/src/lib/ui/knowledge/modals/creategroup.tsx Implements group creation.
libs/designer-v2/src/lib/ui/knowledge/modals/__test__/creategroup.spec.tsx Tests group creation.
libs/designer-v2/src/lib/ui/knowledge/editor/styles.ts Styles the Knowledge Hub editor.
libs/designer-v2/src/lib/ui/knowledge/editor/index.tsx Implements the main editor.
libs/designer-v2/src/lib/ui/knowledge/editor/files.tsx Adds the upload dialog.
libs/designer-v2/src/lib/ui/knowledge/editor/connection.tsx Adds the connection dialog.
libs/designer-v2/src/lib/ui/knowledge/editor/__test__/files.spec.tsx Tests upload dialog behavior.
libs/designer-v2/src/lib/ui/knowledge/editor/__test__/connection.spec.tsx Tests connection dialog behavior.
libs/designer-v2/src/lib/ui/DesignerDialog.tsx Hosts designer dialogs.
libs/designer-v2/src/lib/ui/Designer.tsx Mounts the dialog host.
libs/designer-v2/src/lib/core/utils/parameters/helper.ts Registers the Knowledge Hub editor.
libs/designer-v2/src/lib/core/utils/parameters/__test__/helper-agentParams.spec.ts Tests feature-gated parameters.
libs/designer-v2/src/lib/core/state/modal/modalSlice.ts Adds connection-modal state.
libs/designer-v2/src/lib/core/state/knowledge/store.ts Defines the knowledge store.
libs/designer-v2/src/lib/core/state/knowledge/panelSlice.ts Adds knowledge panel state.
libs/designer-v2/src/lib/core/state/knowledge/optionsSlice.ts Adds options and notification state.
libs/designer-v2/src/lib/core/state/designerOptions/designerOptionsSlice.ts Initializes the resource service.
libs/designer-v2/src/lib/core/state/designerOptions/designerOptionsInterfaces.ts Exposes resource-service configuration.
libs/designer-v2/src/lib/core/knowledge/utils/queries.ts Adds hub and connection queries.
libs/designer-v2/src/lib/core/knowledge/utils/helper.ts Adds hub and artifact helpers.
libs/designer-v2/src/lib/core/knowledge/utils/connection.ts Defines knowledge connection parameters.
libs/designer-v2/src/lib/core/knowledge/utils/__test__/queries.spec.ts Tests knowledge queries.
libs/designer-v2/src/lib/core/knowledge/utils/__test__/helper.spec.ts Tests helpers and validation.
libs/designer-v2/src/lib/core/knowledge/utils/__test__/connection.spec.ts Tests connection utilities.
libs/designer-v2/src/lib/core/actions/bjsworkflow/knowledge.ts Initializes knowledge services.
libs/designer-v2/src/lib/common/constants.ts Adds editor and tab constants.
apps/Standalone/src/designer/app/AzureLogicAppsDesigner/laDesignerV2.tsx Configures Knowledge Hub services.
Review details

Suppressed comments (9)

libs/designer-v2/src/lib/core/knowledge/utils/connection.ts:25

  • These authentication labels are rendered to users but bypass intl.formatMessage, so they cannot be extracted or translated. This file already follows the localized pattern for comparable labels at connection.ts:49-63; apply it to these literals (and the corresponding hardcoded account/auth labels later in this factory).
        displayName: 'Authentication type',
        description: 'Authentication type',

libs/designer-v2/src/lib/core/knowledge/utils/connection.ts:38

  • The Cosmos DB account display name, description, and tooltip are user-visible but hardcoded, unlike the localized parameters at connection.ts:49-63. Wrap these strings with intl.formatMessage so they are included in localization extraction.
        displayName: 'Azure Cosmos DB Service Account',
        description: 'Select the Azure Cosmos DB Service Account to use for this connection',
        tooltip: 'Select the Azure Cosmos DB Service Account to use for this connection',

libs/designer-v2/src/lib/core/knowledge/utils/connection.ts:101

  • This OpenAI authentication label and description are user-visible hardcoded strings. Use intl.formatMessage, consistent with the localized connection labels at connection.ts:125-139, so non-English locales do not receive English-only text.
        displayName: 'Authentication type',
        description: 'Authentication type',

libs/designer-v2/src/lib/core/knowledge/utils/connection.ts:114

  • The Cognitive Service account display name, description, and tooltip bypass localization, while comparable labels at connection.ts:125-139 use intl.formatMessage. Localize these strings so the new editor remains usable in supported non-English locales.
        displayName: 'Azure Cognitive Service Account',
        description: 'Select the Azure Cognitive Service Account to use for this connection',
        tooltip: 'Select the Azure Cognitive Service Account to use for this connection',

libs/designer-v2/src/lib/ui/knowledge/editor/index.tsx:139

  • selectedHub is initialized from the controlled value only once. If the parameter changes later through undo/redo, workflow reload, or an external state update while this editor remains mounted, the dropdown continues displaying the old hub. Keep this state synchronized with hubName, or derive the selection directly from value.
  const [selectedHub, setSelectedHub] = useState<string>(hubName ?? '');

libs/designer-v2/src/lib/ui/knowledge/editor/index.tsx:173

  • While useConnection is still loading, connection is undefined and this enabled Create button is rendered. A quick click can open a creation flow even when an existing knowledge connection is about to load, allowing a duplicate creation attempt. Disable the button until the connection query settles.
          <Button className={styles.createButton} icon={<Add20Regular style={{ width: '18px' }} />} onClick={handleOpenConnectionModal}>

libs/designer-v2/src/lib/ui/knowledge/editor/index.tsx:171

  • This displays the connection resource key rather than the display name entered in the creation form. Knowledge connections store that value in properties.displayName (see logic-apps-shared/.../standard/connection.ts:771-794), while name is the fixed/generated connection key. Show the display name first, with the resource name only as a fallback.
        {connection ? (
          <Input id="connection-input" value={connection?.name ?? ''} disabled={true} aria-label={INTL_TEXT.connectionSectionLabel} />

libs/designer-v2/src/lib/ui/knowledge/panel/connection/usepaneltabs.tsx:95

  • The Create button is disabled only while a request is already running. No required OpenAI model/auth parameters are checked, so an empty Model step can call createOrUpdateConnection with an incomplete payload. Derive this disabled state from the active model parameter set's required fields before allowing creation.
    libs/designer-v2/src/lib/ui/knowledge/panel/connection/usepaneltabs.tsx:30
  • These factories return new parameter-set objects on every render, so both tab useMemos are invalidated and the returned tabs array is rebuilt even on unrelated parent rerenders. Memoize both factory calls by intl; the current memoization test masks this because its factory mocks return stable objects.
  • Files reviewed: 40/40 changed files
  • Comments generated: 6
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread libs/designer-v2/src/lib/core/knowledge/utils/queries.ts
Comment thread libs/designer-v2/src/lib/ui/knowledge/editor/index.tsx Outdated
Comment thread libs/designer-v2/src/lib/ui/knowledge/panel/connection/usepaneltabs.tsx Outdated
Comment thread libs/designer-v2/src/lib/ui/knowledge/panel/files/filelist.tsx Outdated
Comment thread libs/designer-v2/src/lib/ui/knowledge/panel/files/uploadfile.tsx
Comment thread libs/designer-v2/src/lib/ui/knowledge/panel/files/useFileHooks.tsx
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage Check

The following changed files need attention:

⚠️ libs/designer-v2/src/lib/core/actions/bjsworkflow/knowledge.ts - 12% covered (needs improvement)
⚠️ libs/designer-v2/src/lib/core/state/knowledge/optionsSlice.ts - 62% covered (needs improvement)
⚠️ libs/designer-v2/src/lib/ui/knowledge/editor/files.tsx - 75% covered (needs improvement)
⚠️ libs/designer-v2/src/lib/ui/knowledge/notification.tsx - 16% covered (needs improvement)
⚠️ libs/designer-v2/src/lib/ui/knowledge/panel/files/filelist.tsx - 8% covered (needs improvement)
⚠️ libs/designer-v2/src/lib/ui/knowledge/panel/files/uploadfile.tsx - 2% covered (needs improvement)
⚠️ libs/designer-v2/src/lib/ui/panel/connectionsPanel/createConnection/custom/cosmosConnector.tsx - 53% covered (needs improvement)
⚠️ libs/designer-v2/src/lib/core/state/designerOptions/designerOptionsSlice.ts - 28% covered (needs improvement)
⚠️ libs/designer-v2/src/lib/core/state/modal/modalSlice.ts - 73% covered (needs improvement)
⚠️ libs/designer-v2/src/lib/core/store.ts - 40% covered (needs improvement)
⚠️ libs/designer-v2/src/lib/core/utils/parameters/helper.ts - 54% covered (needs improvement)
⚠️ libs/designer-v2/src/lib/ui/panel/connectionsPanel/createConnection/custom/useCognitiveService.ts - 18% covered (needs improvement)
⚠️ libs/logic-apps-shared/src/designer-client-services/lib/standard/connection.ts - 44% covered (needs improvement)
⚠️ libs/designer-v2/src/lib/ui/Designer.tsx - 59% covered (needs improvement)
⚠️ libs/designer-v2/src/lib/ui/panel/connectionsPanel/createConnection/formInputs/connectionMultiAuth.tsx - 20% covered (needs improvement)
⚠️ libs/designer-v2/src/lib/ui/panel/connectionsPanel/createConnection/formInputs/universalConnectionParameter.tsx - 2% covered (needs improvement)
⚠️ libs/designer-v2/src/lib/ui/settings/settingsection.tsx - 18% covered (needs improvement)

Please add tests for the uncovered files before merging.

@preetriti1 preetriti1 added the risk:high High risk change requiring careful review label Sep 10, 2026
@preetriti1 preetriti1 added risk:medium Medium risk change with potential impact and removed risk:high High risk change requiring careful review labels Sep 10, 2026
@preetriti1
preetriti1 enabled auto-merge (squash) September 11, 2026 21:28
@preetriti1
preetriti1 merged commit f1dec48 into main Sep 12, 2026
38 checks passed
@preetriti1
preetriti1 deleted the priti/knowledgev2 branch September 12, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-validated risk:medium Medium risk change with potential impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants