@gooddata/sdk-ui-gen-ai 11.53.0-alpha.4 → 11.53.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/esm/components/ConfigContext.d.ts.map +1 -1
  2. package/esm/components/ConfigContext.js +8 -15
  3. package/esm/components/GenAIChat.d.ts.map +1 -1
  4. package/esm/components/GenAIChat.js +5 -6
  5. package/esm/components/GenAIChatAgentDropdown.d.ts.map +1 -1
  6. package/esm/components/GenAIChatAgentDropdown.js +1 -0
  7. package/esm/components/GenAIChatReasoningMenu.d.ts.map +1 -1
  8. package/esm/components/GenAIChatReasoningMenu.js +1 -0
  9. package/esm/components/GenAiChatContextChooser.d.ts.map +1 -1
  10. package/esm/components/GenAiChatContextChooser.js +6 -5
  11. package/esm/components/GenAiChatContextChooserBody.d.ts +3 -1
  12. package/esm/components/GenAiChatContextChooserBody.d.ts.map +1 -1
  13. package/esm/components/GenAiChatContextChooserBody.js +19 -20
  14. package/esm/components/GenAiStore.d.ts +6 -1
  15. package/esm/components/GenAiStore.d.ts.map +1 -1
  16. package/esm/components/GenAiStore.js +20 -3
  17. package/esm/components/hooks/useContextItems.d.ts +2 -0
  18. package/esm/components/hooks/useContextItems.d.ts.map +1 -1
  19. package/esm/components/hooks/useContextItems.js +65 -21
  20. package/esm/context/addContextReference.d.ts.map +1 -1
  21. package/esm/context/addContextReference.js +5 -2
  22. package/esm/context/collectContextReferences.d.ts.map +1 -1
  23. package/esm/context/collectContextReferences.js +2 -0
  24. package/esm/context/removeContextReference.d.ts +8 -2
  25. package/esm/context/removeContextReference.d.ts.map +1 -1
  26. package/esm/context/removeContextReference.js +44 -4
  27. package/esm/hooks/useGenAIStore.d.ts +2 -1
  28. package/esm/hooks/useGenAIStore.d.ts.map +1 -1
  29. package/esm/hooks/useGenAIStore.js +17 -3
  30. package/esm/sdk-ui-gen-ai.d.ts +5 -0
  31. package/esm/store/chatWindow/chatWindowSelectors.d.ts +3 -2
  32. package/esm/store/chatWindow/chatWindowSelectors.d.ts.map +1 -1
  33. package/esm/store/chatWindow/chatWindowSelectors.js +2 -1
  34. package/esm/store/chatWindow/chatWindowSlice.d.ts +23 -9
  35. package/esm/store/chatWindow/chatWindowSlice.d.ts.map +1 -1
  36. package/esm/store/chatWindow/chatWindowSlice.js +44 -30
  37. package/esm/store/options.d.ts +6 -1
  38. package/esm/store/options.d.ts.map +1 -1
  39. package/esm/store/options.js +23 -1
  40. package/esm/store/sideEffects/index.d.ts.map +1 -1
  41. package/esm/store/sideEffects/index.js +5 -4
  42. package/esm/store/sideEffects/loadContextObjects.d.ts +22 -0
  43. package/esm/store/sideEffects/loadContextObjects.d.ts.map +1 -0
  44. package/esm/store/sideEffects/loadContextObjects.js +122 -0
  45. package/esm/store/store.d.ts +10 -1
  46. package/esm/store/store.d.ts.map +1 -1
  47. package/esm/store/store.js +2 -0
  48. package/esm/types.d.ts +17 -5
  49. package/esm/types.d.ts.map +1 -1
  50. package/esm/utils.d.ts +3 -2
  51. package/esm/utils.d.ts.map +1 -1
  52. package/esm/utils.js +10 -0
  53. package/package.json +20 -20
  54. package/esm/store/sideEffects/loadContextDashboards.d.ts +0 -12
  55. package/esm/store/sideEffects/loadContextDashboards.d.ts.map +0 -1
  56. package/esm/store/sideEffects/loadContextDashboards.js +0 -57
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigContext.d.ts","sourceRoot":"","sources":["../../src/components/ConfigContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAsC,MAAM,OAAO,CAAC;AAEnF,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE7G,MAAM,MAAM,aAAa,GAAG;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,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,MAAM,aAAa,GAAG;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,cAAc,EAAE,gBAAgB,KAAK,MAAM,GAAG,SAAS,CAAC;IACvE,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC3B,IAAI,EAAE,SAAS,GAAG,eAAe,CAAC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACpC,aAAa,CAAC,EAAE,QAAQ,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CAC3C,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,YAAY,CAAC;AAIzD,wBAAgB,cAAc,CAAC,EAC3B,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,SAAS,EACT,UAAU,EACV,cAAc,EACjB,EAAE,iBAAiB,CAAC,aAAa,CAAC,2CAsBlC;AAED,eAAO,MAAM,SAAS,qBAErB,CAAC"}
@@ -6,25 +6,18 @@ export function ConfigProvider({ children, allowNativeLinks, linkHandler, catalo
6
6
  const parentConfig = useConfig();
7
7
  const value = useMemo(() => ({
8
8
  allowNativeLinks: allowNativeLinks ?? parentConfig.allowNativeLinks,
9
- linkHandler: linkHandler ?? parentConfig.linkHandler,
9
+ linkHandler: linkHandler
10
+ ? (event) => {
11
+ const resultParent = parentConfig.linkHandler?.(event);
12
+ const resultCurrent = linkHandler?.(event);
13
+ return resultCurrent ?? resultParent;
14
+ }
15
+ : parentConfig.linkHandler,
10
16
  catalogItems: catalogItems ?? parentConfig.catalogItems,
11
17
  canManage: canManage ?? parentConfig.canManage,
12
18
  canAnalyze: canAnalyze ?? parentConfig.canAnalyze,
13
19
  canFullControl: canFullControl ?? parentConfig.canFullControl,
14
- }), [
15
- allowNativeLinks,
16
- parentConfig.allowNativeLinks,
17
- parentConfig.linkHandler,
18
- parentConfig.catalogItems,
19
- parentConfig.canManage,
20
- parentConfig.canAnalyze,
21
- parentConfig.canFullControl,
22
- linkHandler,
23
- catalogItems,
24
- canManage,
25
- canAnalyze,
26
- canFullControl,
27
- ]);
20
+ }), [allowNativeLinks, parentConfig, linkHandler, catalogItems, canManage, canAnalyze, canFullControl]);
28
21
  return _jsx(configContext.Provider, { value: value, children: children });
29
22
  }
30
23
  export const useConfig = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"GenAIChat.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChat.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAQ3C,OAAO,EAEH,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EAExB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEnE;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG;IAClE;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,cAAc,EAAE,gBAAgB,KAAK,MAAM,GAAG,SAAS,CAAC;IAEvE;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OA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E3B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,8BAA8B,CAAC,EAAE,MAAM,aAAa,CAAC;IAErD;;OAEG;IACH,2BAA2B,CAAC,EAAE,MAAM,aAAa,GAAG,IAAI,CAAC;IAEzD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAE1B;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACrD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAEjD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CAyDxD;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,uBAAiB,CAAC"}
@@ -3,7 +3,7 @@ import { BackendProvider, WorkspaceProvider, useBackendStrict, useWorkspaceStric
3
3
  import { IntlWrapper } from "../localization/IntlWrapper.js";
4
4
  import { PermissionsProvider } from "../permissions/PermissionsContext.js";
5
5
  import { usePermissions } from "../permissions/usePermissions.js";
6
- import { ConfigProvider, useConfig, } from "./ConfigContext.js";
6
+ import { ConfigProvider } from "./ConfigContext.js";
7
7
  import { CustomizationProvider } from "./CustomizationProvider.js";
8
8
  import { GenAIChatWrapper } from "./GenAIChatWrapper.js";
9
9
  import { GenAiStore } from "./GenAiStore.js";
@@ -12,10 +12,10 @@ import { GenAiStore } from "./GenAiStore.js";
12
12
  * @public
13
13
  */
14
14
  export function GenAIAssistant(props) {
15
- const { backend, workspace, locale, colorPalette, eventHandlers, settings, objectTypes, catalogItems, dashboards, includeTags, excludeTags, isPreview, allowInteractionIntelligence, providedStore, onDispatcher, onLinkClick, mode, allowNativeLinks, } = props;
15
+ const { backend, workspace, locale, colorPalette, eventHandlers, settings, objectTypes, catalogItems, dashboards, visualizations, includeTags, excludeTags, isPreview, allowInteractionIntelligence, providedStore, onDispatcher, onLinkClick, mode, allowNativeLinks, } = props;
16
16
  const effectiveBackend = useBackendStrict(backend);
17
17
  const effectiveWorkspace = useWorkspaceStrict(workspace);
18
- return (_jsx(IntlWrapper, { locale: locale, children: _jsx(GenAiStore, { backend: effectiveBackend, workspace: effectiveWorkspace, onDispatcher: onDispatcher, colorPalette: colorPalette, mode: mode, eventHandlers: eventHandlers, allowNativeLinks: allowNativeLinks, onLinkClick: onLinkClick, settings: settings, objectTypes: objectTypes, includeTags: includeTags, excludeTags: excludeTags, catalogItems: catalogItems, dashboards: dashboards, isPreview: isPreview, allowInteractionIntelligence: allowInteractionIntelligence, providedStore: providedStore, children: _jsx(BackendProvider, { backend: effectiveBackend, children: _jsx(WorkspaceProvider, { workspace: effectiveWorkspace, children: _jsx(PermissionsProvider, { children: _jsx(GenAIContent, { ...props }) }) }) }) }) }));
18
+ return (_jsx(IntlWrapper, { locale: locale, children: _jsx(GenAiStore, { backend: effectiveBackend, workspace: effectiveWorkspace, onDispatcher: onDispatcher, colorPalette: colorPalette, mode: mode, eventHandlers: eventHandlers, allowNativeLinks: allowNativeLinks, onLinkClick: onLinkClick, settings: settings, objectTypes: objectTypes, includeTags: includeTags, excludeTags: excludeTags, catalogItems: catalogItems, dashboards: dashboards, visualizations: visualizations, isPreview: isPreview, allowInteractionIntelligence: allowInteractionIntelligence, providedStore: providedStore, children: _jsx(BackendProvider, { backend: effectiveBackend, children: _jsx(WorkspaceProvider, { workspace: effectiveWorkspace, children: _jsx(PermissionsProvider, { children: _jsx(GenAIContent, { ...props }) }) }) }) }) }));
19
19
  }
20
20
  /**
21
21
  * UI component that renders the Gen AI chat.
@@ -24,8 +24,7 @@ export function GenAIAssistant(props) {
24
24
  */
25
25
  export const GenAIChat = GenAIAssistant;
26
26
  function GenAIContent(props) {
27
- const { onLinkClick, catalogItems, LandingScreenComponentProvider, DisclaimerComponentProvider, className, } = props;
27
+ const { LandingScreenComponentProvider, DisclaimerComponentProvider, className, catalogItems } = props;
28
28
  const { permissions, loading } = usePermissions();
29
- const { allowNativeLinks } = useConfig();
30
- return (_jsx(ConfigProvider, { linkHandler: onLinkClick, catalogItems: catalogItems, allowNativeLinks: allowNativeLinks ?? props.allowNativeLinks, canFullControl: props.disableFullControl ? false : (permissions.canManageProject ?? false), canManage: props.disableManage ? false : (permissions.canManageProject ?? false), canAnalyze: props.disableAnalyze ? false : (permissions.canCreateVisualization ?? false), children: _jsx(CustomizationProvider, { landingScreenComponentProvider: LandingScreenComponentProvider, disclaimerComponentProvider: DisclaimerComponentProvider, children: _jsx(GenAIChatWrapper, { initializing: loading, className: className }) }) }));
29
+ return (_jsx(ConfigProvider, { catalogItems: catalogItems, canFullControl: props.disableFullControl ? false : (permissions.canManageProject ?? false), canManage: props.disableManage ? false : (permissions.canManageProject ?? false), canAnalyze: props.disableAnalyze ? false : (permissions.canCreateVisualization ?? false), children: _jsx(CustomizationProvider, { landingScreenComponentProvider: LandingScreenComponentProvider, disclaimerComponentProvider: DisclaimerComponentProvider, children: _jsx(GenAIChatWrapper, { initializing: loading, className: className }) }) }));
31
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"GenAIChatAgentDropdown.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatAgentDropdown.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAgB3D,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAkC3E,MAAM,MAAM,2BAA2B,GAAG;IACtC,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,aAAa,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACzC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UA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EAAE,eAAe,CAAC;IACjC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;CACtD,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,EACnC,MAAM,EACN,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,UAAU,EACV,SAAS,EACT,aAAa,EACb,gBAAwB,EACxB,cAA+B,EAC/B,cAAc,EACjB,EAAE,2BAA2B,2CA2L7B"}
@@ -77,6 +77,7 @@ export function GenAIChatAgentDropdown({ agents, conversations, conversationAgen
77
77
  isDisabled: false,
78
78
  data: { type: "agent", agent },
79
79
  tooltip: agent.description || undefined,
80
+ tooltipWidth: 230,
80
81
  iconRight: agent.description ? (_jsx(UiIcon, { type: "question", size: 12, color: "complementary-5", accessibilityConfig: { ariaHidden: true } })) : undefined,
81
82
  };
82
83
  });
@@ -1 +1 @@
1
- {"version":3,"file":"GenAIChatReasoningMenu.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatReasoningMenu.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAEH,KAAK,kCAAkC,EACvC,KAAK,WAAW,EAMnB,MAAM,sBAAsB,CAAC;AAkC9B;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAChC,IAAI,EAAE,WAAW,CAAC;IAClB,cAAc,EAAE,eAAe,CAAC;IAChC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;CACtD,CAAC;AAEF,eAAO,MAAM,sBAAsB,cAAc,CAAC;AAElD;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,MAAM,CAAC;AAqBlD;;;;GAIG;AACH,wBAAgB,yBAAyB,CACrC,cAAc,EAAE,eAAe,EAC/B,SAAS,EAAE,kBAAkB,GAC9B,MAAM,GAAG,SAAS,CAIpB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CA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KG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,MAAM,CAAC;AAqBlD;;;;GAIG;AACH,wBAAgB,yBAAyB,CACrC,cAAc,EAAE,eAAe,EAC/B,SAAS,EAAE,kBAAkB,GAC9B,MAAM,GAAG,SAAS,CAIpB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EAClC,OAAO,EACP,cAAc,EACd,cAAc,EACjB,EAAE;IACC,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,eAAe,CAAC;IAChC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;CACtD,GAAG,WAAW,CAAC;IAAE,WAAW,EAAE,qBAAqB,CAAA;CAAE,CAAC,EAAE,CAmBxD;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC7B,WAAW,EAAE;QAAE,MAAM,EAAE,eAAe,CAAA;KAAE,CAAC;CAC5C,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,uBAAuB,CACnC,cAAc,EAAE,eAAe,EAC/B,SAAS,EAAE,kBAAkB,GAC9B,WAAW,CAAC,kBAAkB,CAAC,EAAE,CA+BnC;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,2CAczE;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,EACtC,IAAI,EACP,EAAE,kCAAkC,CAAC;IAAE,WAAW,EAAE,qBAAqB,CAAA;CAAE,CAAC,2CAiE5E"}
@@ -100,6 +100,7 @@ export function useReasoningOptionItems(selectedEffort, labelMode) {
100
100
  isDisabled: false,
101
101
  data: { effort },
102
102
  tooltip: descriptionText,
103
+ tooltipWidth: 230,
103
104
  iconRight: (_jsx(UiIcon, { type: "question", size: 12, color: "complementary-5", accessibilityConfig: { ariaHidden: true } })),
104
105
  };
105
106
  }), [intl, selectedEffort, labelMode]);
@@ -1 +1 @@
1
- {"version":3,"file":"GenAiChatContextChooser.d.ts","sourceRoot":"","sources":["../../src/components/GenAiChatContextChooser.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAWvD,KAAK,+BAA+B,GAAG;IACnC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACzD,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,EAAE,YAAY,EAAE,EAAE,+BAA+B,kDAiExF"}
1
+ {"version":3,"file":"GenAiChatContextChooser.d.ts","sourceRoot":"","sources":["../../src/components/GenAiChatContextChooser.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAWvD,KAAK,+BAA+B,GAAG;IACnC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACzD,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,EAAE,YAAY,EAAE,EAAE,+BAA+B,kDA4ExF"}
@@ -5,7 +5,7 @@ import { defineMessages, useIntl } from "react-intl";
5
5
  import { useDispatch, useSelector } from "react-redux";
6
6
  import { Dropdown, UiIconButton, useIdPrefixed } from "@gooddata/sdk-ui-kit";
7
7
  import { ambientContextSelector, userContextSelector } from "../store/chatWindow/chatWindowSelectors.js";
8
- import { addContextReferenceAction, initContextDashboardsAction, } from "../store/chatWindow/chatWindowSlice.js";
8
+ import { addContextReferenceAction, initContextObjectsAction } from "../store/chatWindow/chatWindowSlice.js";
9
9
  import { GenAiChatContextChooserBody } from "./GenAiChatContextChooserBody.js";
10
10
  import { useContextItems } from "./hooks/useContextItems.js";
11
11
  const msgs = defineMessages({
@@ -19,20 +19,21 @@ export function GenAiChatContextChooser({ onAddContext }) {
19
19
  const titleId = useIdPrefixed("context-chooser-title");
20
20
  const ambient = useSelector((state) => ambientContextSelector(state));
21
21
  const active = useSelector((state) => userContextSelector(state));
22
- const { items: inputItems, isLoading, hasNextPage, loadNextPage } = useContextItems(ambient, active);
22
+ const { items: inputItems, search, setSearch, isLoading, hasNextPage, loadNextPage, } = useContextItems(ambient, active);
23
23
  const addContextLabel = intl.formatMessage(msgs.add);
24
24
  const onOpenStateChanged = useCallback((isOpen) => {
25
+ setSearch("");
25
26
  if (isOpen) {
26
- dispatch(initContextDashboardsAction());
27
+ dispatch(initContextObjectsAction());
27
28
  }
28
- }, [dispatch]);
29
+ }, [dispatch, setSearch]);
29
30
  if (!ambient) {
30
31
  return null;
31
32
  }
32
33
  return (_jsx("div", { className: "gd-gen-ai-chat__input__context", children: _jsx(Dropdown, { alignPoints: [{ align: "tl bl", offset: { x: 0, y: 0 } }], closeOnEscape: true, fullscreenOnMobile: false, autofocusOnOpen: true, accessibilityConfig: {}, onOpenStateChanged: onOpenStateChanged, renderButton: ({ isOpen, toggleDropdown, accessibilityConfig }) => (_jsx(UiIconButton, { icon: "plus", variant: "tertiary", size: "small", dataTestId: "choose_context", isActive: isOpen, accessibilityConfig: {
33
34
  ...accessibilityConfig,
34
35
  ariaLabel: addContextLabel,
35
- }, onClick: toggleDropdown, isDisabled: !inputItems.length && !hasNextPage && !isLoading })), renderBody: ({ closeDropdown, ariaAttributes }) => (_jsx(GenAiChatContextChooserBody, { inputItems: inputItems, title: addContextLabel, titleId: titleId, isLoading: isLoading, hasNextPage: hasNextPage, loadNextPage: loadNextPage, ariaAttributes: ariaAttributes, closeDropdown: closeDropdown, onSelect: (item) => {
36
+ }, onClick: toggleDropdown, isDisabled: !search && !inputItems.length && !hasNextPage && !isLoading })), renderBody: ({ closeDropdown, ariaAttributes }) => (_jsx(GenAiChatContextChooserBody, { inputItems: inputItems, title: addContextLabel, titleId: titleId, search: search, onSearchChange: setSearch, isLoading: isLoading, hasNextPage: hasNextPage, loadNextPage: loadNextPage, ariaAttributes: ariaAttributes, closeDropdown: closeDropdown, onSelect: (item) => {
36
37
  dispatch(addContextReferenceAction({ object: item }));
37
38
  onAddContext?.(item);
38
39
  } })) }) }));
@@ -3,6 +3,8 @@ type GenAiChatContextChooserBodyProps = {
3
3
  inputItems: IGenAIContextObject[];
4
4
  title: string;
5
5
  titleId: string;
6
+ search: string;
7
+ onSearchChange: (search: string) => void;
6
8
  isLoading?: boolean;
7
9
  hasNextPage?: boolean;
8
10
  loadNextPage?: () => void;
@@ -14,6 +16,6 @@ type GenAiChatContextChooserBodyProps = {
14
16
  onSelect: (item: IGenAIContextObject) => void;
15
17
  closeDropdown: () => void;
16
18
  };
17
- export declare function GenAiChatContextChooserBody({ inputItems, title, titleId, isLoading, hasNextPage, loadNextPage, ariaAttributes, onSelect, closeDropdown }: GenAiChatContextChooserBodyProps): import("react/jsx-runtime").JSX.Element;
19
+ export declare function GenAiChatContextChooserBody({ inputItems, title, titleId, search, onSearchChange, isLoading, hasNextPage, loadNextPage, ariaAttributes, onSelect, closeDropdown }: GenAiChatContextChooserBodyProps): import("react/jsx-runtime").JSX.Element;
18
20
  export {};
19
21
  //# sourceMappingURL=GenAiChatContextChooserBody.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GenAiChatContextChooserBody.d.ts","sourceRoot":"","sources":["../../src/components/GenAiChatContextChooserBody.tsx"],"names":[],"mappings":"AAsBA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AA6BvD,KAAK,gCAAgC,GAAG;IACpC,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,EAAE;QACZ,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;IACF,QAAQ,EAAE,CAAC,IAAI,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC9C,aAAa,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AAEF,wBAAgB,2BAA2B,CAAC,EACxC,UAAU,EACV,KAAK,EACL,OAAO,EACP,SAAiB,EACjB,WAAmB,EACnB,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,aAAa,EAChB,EAAE,gCAAgC,2CAsIlC"}
1
+ {"version":3,"file":"GenAiChatContextChooserBody.d.ts","sourceRoot":"","sources":["../../src/components/GenAiChatContextChooserBody.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AA8BvD,KAAK,gCAAgC,GAAG;IACpC,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,EAAE;QACZ,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;IACF,QAAQ,EAAE,CAAC,IAAI,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC9C,aAAa,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AAEF,wBAAgB,2BAA2B,CAAC,EACxC,UAAU,EACV,KAAK,EACL,OAAO,EACP,MAAM,EACN,cAAc,EACd,SAAiB,EACjB,WAAmB,EACnB,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,aAAa,EAChB,EAAE,gCAAgC,2CAmIlC"}
@@ -1,11 +1,13 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // (C) 2026 GoodData Corporation
3
- import { useCallback, useId, useMemo, useState } from "react";
3
+ import { useCallback, useEffect, useId } from "react";
4
4
  import cx from "classnames";
5
5
  import { defineMessages, useIntl } from "react-intl";
6
+ import { useDebouncedState } from "@gooddata/sdk-ui";
6
7
  import { DEFAULT_ITEM_HEIGHT, DETAILED_ANNOUNCEMENT_THRESHOLD, Input, NoData, ScopedIdStore, ShortenedText, UiIcon, UiPagedVirtualList, UiSearchResultsAnnouncement, UiSubmenuHeader, isTypingKey, useScopedIdStoreValue, } from "@gooddata/sdk-ui-kit";
7
8
  import { getIconByType } from "./utils/icons.js";
8
9
  const SEARCH_FIELD_VISIBILITY_THRESHOLD = 7;
10
+ const SEARCH_DEBOUNCE_MS = 300;
9
11
  const MAX_VISIBLE_ITEMS = 7;
10
12
  const LOADING_SKELETON_ITEMS_COUNT = 3;
11
13
  const msgs = defineMessages({
@@ -28,25 +30,23 @@ const msgs = defineMessages({
28
30
  id: "gd.gen-ai.context.noDataAvailable",
29
31
  },
30
32
  });
31
- export function GenAiChatContextChooserBody({ inputItems, title, titleId, isLoading = false, hasNextPage = false, loadNextPage, ariaAttributes, onSelect, closeDropdown, }) {
33
+ export function GenAiChatContextChooserBody({ inputItems, title, titleId, search, onSearchChange, isLoading = false, hasNextPage = false, loadNextPage, ariaAttributes, onSelect, closeDropdown, }) {
32
34
  const intl = useIntl();
33
35
  const listboxId = useId();
34
- const [searchString, setSearchString] = useState("");
35
- const isSearchFieldVisible = inputItems.length > SEARCH_FIELD_VISIBILITY_THRESHOLD;
36
- const searchStringToUse = isSearchFieldVisible ? searchString : "";
37
- const normalizedSearch = searchStringToUse.trim().toLowerCase();
38
- const filteredItems = useMemo(() => {
39
- if (!normalizedSearch) {
40
- return inputItems;
36
+ const [searchString, setSearchString, debouncedSearch] = useDebouncedState(search, SEARCH_DEBOUNCE_MS);
37
+ useEffect(() => {
38
+ if (debouncedSearch.trim() !== search) {
39
+ onSearchChange(debouncedSearch.trim());
41
40
  }
42
- return inputItems.filter((item) => item.title.toLowerCase().includes(normalizedSearch));
43
- }, [inputItems, normalizedSearch]);
41
+ }, [debouncedSearch, search, onSearchChange]);
42
+ const isSearchFieldVisible = inputItems.length > SEARCH_FIELD_VISIBILITY_THRESHOLD || searchString.length > 0 || hasNextPage;
43
+ const normalizedSearch = search.trim().toLowerCase();
44
44
  const scopedIdStoreValue = useScopedIdStoreValue((item) => `${item.type}-${item.id}`);
45
45
  const handleSelect = useCallback((item) => {
46
46
  onSelect(item);
47
47
  closeDropdown();
48
48
  }, [closeDropdown, onSelect]);
49
- const hasNoData = !isLoading && filteredItems.length === 0;
49
+ const hasNoData = !isLoading && inputItems.length === 0;
50
50
  const hasNoMatchingData = hasNoData && normalizedSearch.length > 0;
51
51
  const searchFilled = searchString.length > 0;
52
52
  const onEscKeyPress = useCallback((event) => {
@@ -57,10 +57,9 @@ export function GenAiChatContextChooserBody({ inputItems, title, titleId, isLoad
57
57
  closeDropdown();
58
58
  }
59
59
  }, [closeDropdown, searchFilled]);
60
- const canLoadNextPage = hasNextPage && normalizedSearch.length === 0;
61
- const shouldShowPagedList = !hasNoData || canLoadNextPage;
62
- const skeletonItemsCount = isLoading || (canLoadNextPage && filteredItems.length === 0) ? LOADING_SKELETON_ITEMS_COUNT : 0;
63
- const visibleRowsCount = filteredItems.length + skeletonItemsCount;
60
+ const shouldShowPagedList = !hasNoData || hasNextPage;
61
+ const skeletonItemsCount = isLoading || (hasNextPage && inputItems.length === 0) ? LOADING_SKELETON_ITEMS_COUNT : 0;
62
+ const visibleRowsCount = inputItems.length + skeletonItemsCount;
64
63
  const listMaxHeight = Math.min(Math.max(visibleRowsCount, 1), MAX_VISIBLE_ITEMS) * DEFAULT_ITEM_HEIGHT;
65
64
  return (_jsxs("div", { ...ariaAttributes, "aria-labelledby": titleId, className: "gd-gen-ai-chat__context-chooser", "data-testid": "context_chooser_menu", children: [
66
65
  _jsx(UiSubmenuHeader, { title: title, titleId: titleId, height: "medium", onClose: closeDropdown, closeAriaLabel: intl.formatMessage(msgs.close) }), isSearchFieldVisible ? (_jsxs(_Fragment, { children: [
@@ -68,13 +67,13 @@ export function GenAiChatContextChooserBody({ inputItems, title, titleId, isLoad
68
67
  if (isTypingKey(event)) {
69
68
  event.stopPropagation();
70
69
  }
71
- }, children: _jsx(Input, { className: cx("gd-list-searchfield", "gd-flex-item"), value: searchStringToUse, onChange: (value) => setSearchString(String(value)), onEscKeyPress: onEscKeyPress, placeholder: intl.formatMessage(msgs.searchPlaceholder), autofocus: true, clearOnEsc: true, isSearch: true, isSmall: true, type: "search", accessibilityConfig: {
70
+ }, children: _jsx(Input, { className: cx("gd-list-searchfield", "gd-flex-item"), value: searchString, onChange: (value) => setSearchString(String(value)), onEscKeyPress: onEscKeyPress, placeholder: intl.formatMessage(msgs.searchPlaceholder), autofocus: true, clearOnEsc: true, isSearch: true, isSmall: true, type: "search", accessibilityConfig: {
72
71
  ariaLabel: intl.formatMessage(msgs.searchAriaLabel),
73
72
  ariaControls: listboxId,
74
- } }) }), _jsx(UiSearchResultsAnnouncement, { totalResults: normalizedSearch ? filteredItems.length : undefined, resultValues: filteredItems.length <= DETAILED_ANNOUNCEMENT_THRESHOLD
75
- ? filteredItems.map((item) => item.title)
73
+ } }) }), _jsx(UiSearchResultsAnnouncement, { totalResults: normalizedSearch ? inputItems.length : undefined, resultValues: inputItems.length <= DETAILED_ANNOUNCEMENT_THRESHOLD
74
+ ? inputItems.map((item) => item.title)
76
75
  : undefined })
77
- ] })) : null, shouldShowPagedList ? (_jsx(ScopedIdStore, { value: scopedIdStoreValue, children: _jsx(UiPagedVirtualList, { maxHeight: listMaxHeight, items: filteredItems, itemHeight: DEFAULT_ITEM_HEIGHT, itemsGap: 0, itemPadding: 0, skeletonItemsCount: skeletonItemsCount, isLoading: isLoading, hasNextPage: canLoadNextPage, loadNextPage: loadNextPage, representAs: "listbox", closeDropdown: closeDropdown, onKeyDownConfirm: handleSelect, listboxProps: {
76
+ ] })) : null, shouldShowPagedList ? (_jsx(ScopedIdStore, { value: scopedIdStoreValue, children: _jsx(UiPagedVirtualList, { maxHeight: listMaxHeight, items: inputItems, itemHeight: DEFAULT_ITEM_HEIGHT, itemsGap: 0, itemPadding: 0, skeletonItemsCount: skeletonItemsCount, isLoading: isLoading, hasNextPage: hasNextPage, loadNextPage: loadNextPage, representAs: "listbox", closeDropdown: closeDropdown, onKeyDownConfirm: handleSelect, listboxProps: {
78
77
  id: listboxId,
79
78
  "aria-label": intl.formatMessage(msgs.listAriaLabel),
80
79
  }, children: (item) => _jsx(ContextChooserItem, { item: item, onSelect: () => handleSelect(item) }) }) })) : (_jsx(NoData, { hasNoMatchingData: hasNoMatchingData, notFoundLabel: intl.formatMessage(msgs.noMatchingData), noDataLabel: intl.formatMessage(msgs.noDataAvailable) }))] }));
@@ -1,7 +1,7 @@
1
1
  import { type ReactNode } from "react";
2
2
  import { type EnhancedStore, type Store } from "@reduxjs/toolkit";
3
3
  import { type IAnalyticalBackend, type IUserWorkspaceSettings } from "@gooddata/sdk-backend-spi";
4
- import { type CatalogItem, type GenAIObjectType, type IColorPalette, type IListedDashboard } from "@gooddata/sdk-model";
4
+ import { type CatalogItem, type GenAIObjectType, type IColorPalette, type IInsight, type IListedDashboard } from "@gooddata/sdk-model";
5
5
  import { type ChatEventHandler } from "../store/events.js";
6
6
  import { type GenAIAssistantMode, type LinkHandlerEvent } from "./ConfigContext.js";
7
7
  /**
@@ -30,6 +30,11 @@ export type GenAiStoreProps = {
30
30
  * no dashboards are loaded from the backend.
31
31
  */
32
32
  dashboards?: IListedDashboard[];
33
+ /**
34
+ * Visualizations offered by the context chooser. When provided, the list is taken as complete
35
+ * and no visualizations are loaded from the backend.
36
+ */
37
+ visualizations?: IInsight[];
33
38
  /**
34
39
  * User settings to use for the chat UI.
35
40
  */
@@ -1 +1 @@
1
- {"version":3,"file":"GenAiStore.d.ts","sourceRoot":"","sources":["../../src/components/GenAiStore.tsx"],"names":[],"mappings":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AAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B;;;OAGG;IACH,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAChC;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAElC;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,cAAc,EAAE,gBAAgB,KAAK,MAAM,GAAG,SAAS,CAAC;IACvE;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACnC;;OAEG;IACH,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B;;;;OAIG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IAC7D;;OAEG;IACH,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,UAAU,EAAE,aAAa,KAAK,SAAS,CAAC,CAAC;IAEjE;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;;OAOG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;CAC1C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,kDAmDhD"}
@@ -45,21 +45,37 @@ export function GenAiStore(props) {
45
45
  }
46
46
  return (_jsx(ConfigProvider, { allowNativeLinks: props.allowNativeLinks, linkHandler: props.onLinkClick, children: _jsx(InternalStore, { ...props, children: children }) }));
47
47
  }
48
- function ExternalStore({ onDispatcher, children, currentStore, }) {
48
+ function ExternalStore({ onDispatcher, children, currentStore, onLinkClick, }) {
49
49
  useEffect(() => {
50
50
  onDispatcher?.(currentStore.dispatch);
51
51
  }, [currentStore, onDispatcher]);
52
+ useEffect(() => {
53
+ const store = currentStore;
54
+ const dispatcher = store.optionsDispatcher;
55
+ if (dispatcher && onLinkClick) {
56
+ return dispatcher.registerLinkHandler(onLinkClick);
57
+ }
58
+ return undefined;
59
+ }, [currentStore, onLinkClick]);
52
60
  const content = typeof children === "function" ? children(currentStore) : children;
53
61
  return _jsx(_Fragment, { children: content });
54
62
  }
55
- function InjectedStore({ onDispatcher, children, currentStore, }) {
63
+ function InjectedStore({ onDispatcher, children, currentStore, onLinkClick, }) {
56
64
  useEffect(() => {
57
65
  onDispatcher?.(currentStore.dispatch);
58
66
  }, [currentStore, onDispatcher]);
67
+ useEffect(() => {
68
+ const store = currentStore;
69
+ const dispatcher = store.optionsDispatcher;
70
+ if (dispatcher && onLinkClick) {
71
+ return dispatcher.registerLinkHandler(onLinkClick);
72
+ }
73
+ return undefined;
74
+ }, [currentStore, onLinkClick]);
59
75
  const content = typeof children === "function" ? children(currentStore) : children;
60
76
  return _jsx(StoreProvider, { store: currentStore, children: content });
61
77
  }
62
- function InternalStore({ backend, workspace, onDispatcher, children, eventHandlers, settings, catalogItems, dashboards, includeTags, excludeTags, objectTypes, allowNativeLinks, onLinkClick, mode, isPreview, allowInteractionIntelligence, colorPalette, }) {
78
+ function InternalStore({ backend, workspace, onDispatcher, children, eventHandlers, settings, catalogItems, dashboards, visualizations, includeTags, excludeTags, objectTypes, allowNativeLinks, onLinkClick, mode, isPreview, allowInteractionIntelligence, colorPalette, }) {
63
79
  const effectiveBackend = useBackendStrict(backend);
64
80
  const effectiveWorkspace = useWorkspaceStrict(workspace);
65
81
  const genAIStore = useGenAIStore(effectiveBackend, effectiveWorkspace, {
@@ -71,6 +87,7 @@ function InternalStore({ backend, workspace, onDispatcher, children, eventHandle
71
87
  excludeTags,
72
88
  catalogItems,
73
89
  dashboards,
90
+ visualizations,
74
91
  isPreview,
75
92
  allowInteractionIntelligence,
76
93
  allowNativeLinks,
@@ -2,6 +2,8 @@ import { type IGenAIUserContext } from "@gooddata/sdk-model";
2
2
  import { type IGenAIContextObject } from "../../types.js";
3
3
  export declare function useContextItems(ambient: IGenAIUserContext | undefined, active: IGenAIUserContext | undefined): {
4
4
  items: IGenAIContextObject[];
5
+ search: string;
6
+ setSearch: (value: string) => void;
5
7
  isLoading: boolean;
6
8
  hasNextPage: boolean;
7
9
  loadNextPage: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"useContextItems.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useContextItems.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,iBAAiB,EAAmB,MAAM,qBAAqB,CAAC;AAQ9E,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,wBAAgB,eAAe,CAC3B,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,MAAM,EAAE,iBAAiB,GAAG,SAAS;;;;;EA4CxC"}
1
+ {"version":3,"file":"useContextItems.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useContextItems.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,iBAAiB,EAAmB,MAAM,qBAAqB,CAAC;AAc9E,OAAO,EAIH,KAAK,mBAAmB,EAC3B,MAAM,gBAAgB,CAAC;AAExB,wBAAgB,eAAe,CAC3B,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,MAAM,EAAE,iBAAiB,GAAG,SAAS;;;;;;;EAqExC"}
@@ -4,36 +4,80 @@ import { useIntl } from "react-intl";
4
4
  import { useDispatch, useSelector } from "react-redux";
5
5
  import { serializeObjRef } from "@gooddata/sdk-model";
6
6
  import { collectAvailableReferences, collectContextReferences, } from "../../context/collectContextReferences.js";
7
- import { contextDashboardsSelector } from "../../store/chatWindow/chatWindowSelectors.js";
8
- import { loadContextDashboardsNextPageAction } from "../../store/chatWindow/chatWindowSlice.js";
7
+ import { contextObjectsSearchSelector, contextObjectsSelector, } from "../../store/chatWindow/chatWindowSelectors.js";
8
+ import { loadContextObjectsNextPageAction, setContextObjectsSearchAction, } from "../../store/chatWindow/chatWindowSlice.js";
9
9
  export function useContextItems(ambient, active) {
10
10
  const intl = useIntl();
11
11
  const dispatch = useDispatch();
12
12
  const emptyReferenceLabel = intl.formatMessage({ id: "gd.gen-ai.context.untitled" });
13
- const dashboards = useSelector(contextDashboardsSelector);
13
+ const contextObjects = useSelector(contextObjectsSelector);
14
+ const search = useSelector(contextObjectsSearchSelector);
15
+ const dashboards = contextObjects.dashboard;
16
+ const visualizations = contextObjects.visualization;
14
17
  const items = useMemo(() => {
15
- const ambientReferences = collectAvailableReferences(ambient, emptyReferenceLabel);
18
+ const matchesSearch = titleMatcher(search);
19
+ const ambientReferences = collectAvailableReferences(ambient, emptyReferenceLabel).filter(matchesSearch);
16
20
  const selectedReferences = collectContextReferences(active, emptyReferenceLabel);
17
- const offered = new Set(ambientReferences.map((reference) => serializeObjRef(reference.ref)));
18
- const dashboardReferences = dashboards.items
19
- .filter((dashboard) => !offered.has(serializeObjRef(dashboard.ref)))
20
- .map((dashboard) => ({
21
- id: dashboard.id,
22
- ref: dashboard.ref,
23
- type: "dashboard",
24
- where: "referencedObjects",
25
- title: dashboard.title || emptyReferenceLabel || dashboard.id,
26
- nesting: 1,
27
- }));
28
- return [...ambientReferences, ...dashboardReferences].filter((reference) => !selectedReferences.some((selectedReference) => selectedReference.id === reference.id && selectedReference.type === reference.type));
29
- }, [active, ambient, dashboards.items, emptyReferenceLabel]);
21
+ const offered = new Set();
22
+ collectAvailableReferences(ambient, emptyReferenceLabel).forEach((reference) => {
23
+ offered.add(serializeObjRef(reference.ref));
24
+ if (reference.insightRef) {
25
+ offered.add(serializeObjRef(reference.insightRef));
26
+ }
27
+ });
28
+ const workspaceReferences = [
29
+ ...searchable(dashboards, "dashboard", emptyReferenceLabel, matchesSearch),
30
+ ...searchable(visualizations, "visualization", emptyReferenceLabel, matchesSearch),
31
+ ].filter((reference) => !offered.has(serializeObjRef(reference.ref)));
32
+ return [...ambientReferences, ...workspaceReferences].filter((reference) => !selectedReferences.some((selectedReference) => isSameObject(selectedReference, reference)));
33
+ }, [active, ambient, dashboards, visualizations, emptyReferenceLabel, search]);
34
+ const setSearch = useCallback((value) => {
35
+ if (value === search) {
36
+ return;
37
+ }
38
+ dispatch(setContextObjectsSearchAction({ search: value }));
39
+ }, [dispatch, search]);
40
+ const nextPageKind = dashboards.hasNextPage
41
+ ? "dashboard"
42
+ : visualizations.hasNextPage
43
+ ? "visualization"
44
+ : undefined;
30
45
  const loadNextPage = useCallback(() => {
31
- dispatch(loadContextDashboardsNextPageAction());
32
- }, [dispatch]);
46
+ if (!nextPageKind) {
47
+ return;
48
+ }
49
+ dispatch(loadContextObjectsNextPageAction({ kind: nextPageKind }));
50
+ }, [dispatch, nextPageKind]);
33
51
  return {
34
52
  items,
35
- isLoading: dashboards.isLoading,
36
- hasNextPage: dashboards.hasNextPage,
53
+ search,
54
+ setSearch,
55
+ isLoading: dashboards.isLoading || visualizations.isLoading,
56
+ hasNextPage: nextPageKind !== undefined,
37
57
  loadNextPage,
38
58
  };
39
59
  }
60
+ function titleMatcher(search) {
61
+ const normalized = search.trim().toLowerCase();
62
+ return normalized ? (reference) => reference.title.toLowerCase().includes(normalized) : () => true;
63
+ }
64
+ function searchable(list, type, emptyReferenceLabel, matchesSearch) {
65
+ const references = toContextObjects(list.items, type, emptyReferenceLabel);
66
+ return list.isExternal ? references.filter(matchesSearch) : references;
67
+ }
68
+ function toContextObjects(items, type, emptyReferenceLabel) {
69
+ return items.map((item) => ({
70
+ id: item.id,
71
+ ref: item.ref,
72
+ type,
73
+ where: "referencedObjects",
74
+ title: item.title || emptyReferenceLabel || item.id,
75
+ nesting: 1,
76
+ }));
77
+ }
78
+ function isSameObject(a, b) {
79
+ return a.id === b.id && normalizeType(a.type) === normalizeType(b.type);
80
+ }
81
+ function normalizeType(type) {
82
+ return type === "widget" ? "visualization" : type;
83
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"addContextReference.d.ts","sourceRoot":"","sources":["../../src/context/addContextReference.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,iBAAiB,EAEzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAO1E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,mBAAmB,GAAG,YAAY,CA+DxG;AAED,wBAAgB,2BAA2B,CACvC,OAAO,EAAE,YAAY,EACrB,WAAW,CAAC,EAAE,iBAAiB,GAChC,YAAY,CAkBd"}
1
+ {"version":3,"file":"addContextReference.d.ts","sourceRoot":"","sources":["../../src/context/addContextReference.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,iBAAiB,EAEzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAO1E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,mBAAmB,GAAG,YAAY,CA+DxG;AAUD,wBAAgB,2BAA2B,CACvC,OAAO,EAAE,YAAY,EACrB,WAAW,CAAC,EAAE,iBAAiB,GAChC,YAAY,CAkBd"}
@@ -3,7 +3,7 @@ import { areObjRefsEqual, } from "@gooddata/sdk-model";
3
3
  import { convertGenAiTypeToReferenceType } from "../utils.js";
4
4
  import { mergeContexts } from "./build.js";
5
5
  import { isReferenceChanged } from "./isReferenceChanged.js";
6
- import { removeAmbientContribution } from "./removeContextReference.js";
6
+ import { removeAmbientContribution, removeReferencesCoveredByAmbient } from "./removeContextReference.js";
7
7
  export function addContextReference(context, reference) {
8
8
  const { ambient, active } = context;
9
9
  if (!reference) {
@@ -59,6 +59,9 @@ export function addContextReference(context, reference) {
59
59
  }
60
60
  return context;
61
61
  }
62
+ function pruneForNewAmbient(active, previousAmbient, newAmbient) {
63
+ return removeReferencesCoveredByAmbient(removeAmbientContribution(active, previousAmbient), newAmbient);
64
+ }
62
65
  export function addAmbientContextReferences(context, userContext) {
63
66
  const referenceChanged = isReferenceChanged(context.ambient, userContext);
64
67
  const updateActive = Boolean(!context.ambient || context.active?.view?.dashboard || referenceChanged);
@@ -68,7 +71,7 @@ export function addAmbientContextReferences(context, userContext) {
68
71
  ...(updateActive
69
72
  ? {
70
73
  active: mergeContexts(referenceChanged
71
- ? removeAmbientContribution(context.active, context.ambient)
74
+ ? pruneForNewAmbient(context.active, context.ambient, userContext)
72
75
  : context.active, userContext),
73
76
  }
74
77
  : {}),
@@ -1 +1 @@
1
- {"version":3,"file":"collectContextReferences.d.ts","sourceRoot":"","sources":["../../src/context/collectContextReferences.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,iBAAiB,EAGzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGvD,wBAAgB,wBAAwB,CACpC,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,gBAAgB,CAAC,EAAE,MAAM,GAC1B,mBAAmB,EAAE,CAwCvB;AAED,wBAAgB,0BAA0B,CACtC,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,gBAAgB,CAAC,EAAE,MAAM,GAC1B,mBAAmB,EAAE,CAiFvB"}
1
+ {"version":3,"file":"collectContextReferences.d.ts","sourceRoot":"","sources":["../../src/context/collectContextReferences.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,iBAAiB,EAGzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGvD,wBAAgB,wBAAwB,CACpC,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,gBAAgB,CAAC,EAAE,MAAM,GAC1B,mBAAmB,EAAE,CAwCvB;AAED,wBAAgB,0BAA0B,CACtC,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,gBAAgB,CAAC,EAAE,MAAM,GAC1B,mBAAmB,EAAE,CAmFvB"}
@@ -81,6 +81,7 @@ export function collectAvailableReferences(context, placeholderTitle) {
81
81
  title: widget.title || placeholderTitle || id,
82
82
  type: "widget",
83
83
  context,
84
+ insightRef: widget.insightRef,
84
85
  });
85
86
  }
86
87
  break;
@@ -103,6 +104,7 @@ export function collectAvailableReferences(context, placeholderTitle) {
103
104
  title: visualization.title || placeholderTitle || id,
104
105
  type: "widget",
105
106
  context,
107
+ insightRef: visualization.insightRef,
106
108
  });
107
109
  }
108
110
  });
@@ -2,10 +2,16 @@ import { type IGenAIUserContext } from "@gooddata/sdk-model";
2
2
  import { type IGenAIContextObject } from "../types.js";
3
3
  export declare function removeContextReference(context: IGenAIUserContext | undefined, reference?: IGenAIContextObject): IGenAIUserContext | undefined;
4
4
  /**
5
- * Removes from `context` everything that was contributed by `ambient` - the dashboard the user was
6
- * viewing, plus the objects they pinned from it.
5
+ * Removes what `ambient` put in `context` on its own - the viewed dashboard and its own references.
6
+ * The user's own picks stay, the objects pinned from that dashboard included.
7
7
  * @internal
8
8
  */
9
9
  export declare function removeAmbientContribution(context: IGenAIUserContext | undefined, ambient: IGenAIUserContext | undefined): IGenAIUserContext | undefined;
10
+ /**
11
+ * Removes the references the newly opened dashboard covers itself - its own ref and the
12
+ * visualizations it renders - so nothing added earlier sits in the context twice.
13
+ * @internal
14
+ */
15
+ export declare function removeReferencesCoveredByAmbient(context: IGenAIUserContext | undefined, ambient: IGenAIUserContext | undefined): IGenAIUserContext | undefined;
10
16
  export declare function removeUserContextReferences(context: IGenAIUserContext | undefined): IGenAIUserContext | undefined;
11
17
  //# sourceMappingURL=removeContextReference.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"removeContextReference.d.ts","sourceRoot":"","sources":["../../src/context/removeContextReference.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,iBAAiB,EAEzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAIvD,wBAAgB,sBAAsB,CAClC,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,SAAS,CAAC,EAAE,mBAAmB,GAChC,iBAAiB,GAAG,SAAS,CAqC/B;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACrC,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,OAAO,EAAE,iBAAiB,GAAG,SAAS,GACvC,iBAAiB,GAAG,SAAS,CAmB/B;AAeD,wBAAgB,2BAA2B,CACvC,OAAO,EAAE,iBAAiB,GAAG,SAAS,GACvC,iBAAiB,GAAG,SAAS,CAS/B"}
1
+ {"version":3,"file":"removeContextReference.d.ts","sourceRoot":"","sources":["../../src/context/removeContextReference.ts"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,iBAAiB,EAGzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAIvD,wBAAgB,sBAAsB,CAClC,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,SAAS,CAAC,EAAE,mBAAmB,GAChC,iBAAiB,GAAG,SAAS,CAqC/B;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACrC,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,OAAO,EAAE,iBAAiB,GAAG,SAAS,GACvC,iBAAiB,GAAG,SAAS,CAoB/B;AAED;;;;GAIG;AACH,wBAAgB,gCAAgC,CAC5C,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,OAAO,EAAE,iBAAiB,GAAG,SAAS,GACvC,iBAAiB,GAAG,SAAS,CAuB/B;AAmCD,wBAAgB,2BAA2B,CACvC,OAAO,EAAE,iBAAiB,GAAG,SAAS,GACvC,iBAAiB,GAAG,SAAS,CAS/B"}