Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.

Comments

feat: use list for example prompts#2117

Merged
DavidSpriggs merged 1 commit intomasterfrom
t/14684-use-list-for-example-prompts
Nov 12, 2025
Merged

feat: use list for example prompts#2117
DavidSpriggs merged 1 commit intomasterfrom
t/14684-use-list-for-example-prompts

Conversation

@DavidSpriggs
Copy link
Contributor

@DavidSpriggs DavidSpriggs commented Nov 11, 2025

Description:

This pull request updates how example prompts are managed in the Hub Assistant configuration, switching from a simple array of strings to a list of keyed objects with labels. This enables more flexible editing and better UI support. The changes include schema updates, transformation logic in the HubSite class, UI schema adjustments, and new tests to ensure correct behavior.

Hub Assistant example prompts improvements

  • Updated the HubItemEntitySchema so that assistant.examplePrompts is now an array of objects, each with a key and a label, instead of an array of strings. (packages/common/src/core/schemas/shared/HubItemEntitySchema.ts)
  • Added transformation logic in HubSite.toEditor and HubSite.fromEditor to convert between string arrays and object arrays for examplePrompts, ensuring compatibility between storage and editing formats. (packages/common/src/sites/HubSite.ts)

Testing and coverage

  • Added and updated tests to verify the transformation between string arrays and object arrays for examplePrompts, ensuring round-trip integrity. (packages/common/test/sites/HubSite.spec.ts, packages/common/test/sites/_internal/SiteUiSchemaAssistant.spec.ts)

Instructions for testing:

Closes Issues: # (if appropriate)

  1. Updated meaningful TSDoc to methods including Parameters and Returns, see Documentation Guide

  2. Either ran npm run changeset or this change does not require a release.

  3. These changes have been verified by QA using a ?uiVersion that includes a PR-Preview of this branch and the v_req label has been applied to the issue.

  4. OD-UI E2E tests pass against these changes using a ?uiVersion that includes a PR-Preview of this branch

@changeset-bot
Copy link

changeset-bot bot commented Nov 11, 2025

🦋 Changeset detected

Latest commit: 01bf3ac

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

This PR includes changesets to release 1 package
Name Type
@esri/hub-common 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

Copy link
Member

@tomwayson tomwayson left a comment

Choose a reason for hiding this comment

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

LGTM

@DavidSpriggs DavidSpriggs merged commit 7a41594 into master Nov 12, 2025
3 checks passed
@DavidSpriggs DavidSpriggs deleted the t/14684-use-list-for-example-prompts branch November 12, 2025 15:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants