Skip to content

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

Open
preetriti1 wants to merge 5 commits into
mainfrom
priti/knowledgev2
Open

feat(designerv2): Adding support for knowledge hub editor in designer#9603
preetriti1 wants to merge 5 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 — uses a valid feat(scope): prefix and is descriptive.
  • Recommendation: No change needed.

Commit Type

  • Exactly one type selected (feature/feat — New functionality), which matches the feat: title prefix.
  • Note: The label text says feature while the template uses feat; harmless, but consider aligning for consistency.

Risk Level

  • Exactly one box selected (Medium) and the risk:medium label matches the body. This also matches the advised estimate: the change introduces new runtime service init (BaseResourceService/InitResourceService), state management additions, new management API calls, and draft connection persistence — moderate, some user impact, but not security/auth or core shared-utility breaking. Medium is correct.

What & Why

  • Current: Explains that the knowledge hub editor is being added to the v2 designer, ported from v1 with minor styling changes.
  • Issue: None — provides clear context.
  • Recommendation: No change needed.

Impact of Change

  • All three audiences addressed (Users, Developers, System).
  • Recommendation:
    • Users: Clearly stated (new knowledge hub editor in v2 designer).
    • Developers: Clearly stated (new utils/state, resourceService, editor service V2).
    • System: Clearly stated (Resource Service init, new management API calls, draft persistence).

Test Plan

  • Unit tests added/updated is checked and confirmed in the diff (extensive new specs: connection.spec.ts, helper.spec.ts, queries.spec.ts, plus updated builtintools.spec.tsx). Manual testing also checked. Passes CHECK TESTS.

⚠️ Contributors

  • Section is blank. Not required, but consider crediting any PMs/designers who contributed.

Screenshots/Videos

  • This is a visual UI change (touches libs/designer-ui/src and libs/designer-v2/src), and a screenshot of the v2 knowledge hub editor is provided. Requirement satisfied.

Summary Table

Section Status Recommendation
Title No change needed
Commit Type Optionally align label text to feat
Risk Level Medium is correct and matches label/estimate
What & Why No change needed
Impact of Change No change needed
Test Plan Unit tests present and confirmed
Contributors ⚠️ Consider crediting PMs/designers
Screenshots/Videos Screenshot provided

All required checks pass. This PR is compliant and cleared to merge. Nice work including thorough unit tests and a screenshot!


Powered by: Copilot CLI (claude-opus-4.8) | Last updated: Thu, 10 Sep 2026 02:56:14 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 completed. See workflow run for details.

@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
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.

2 participants