Skip to content

Commit 0b251ad

Browse files
committed
Better naming
1 parent 7351b1c commit 0b251ad

File tree

6 files changed

+16
-17
lines changed

6 files changed

+16
-17
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ Breaking changes in this release:
103103
- Attaching files will no longer remove previously attached files
104104
- Updated Fluent theme to use the new attachment preview feature
105105
- Added collapsible activity and activity with abstract handling, in PR [#5506](https://github.com/microsoft/BotFramework-WebChat/pull/5506), in PR [#5513](https://github.com/microsoft/BotFramework-WebChat/pull/5513), in PR [#5771](https://github.com/microsoft/BotFramework-WebChat/pull/5771), by [@OEvgeny](https://github.com/OEvgeny)
106-
- Added `styleOptions.collapsibleGroupingDefaultOpen` to configure whether collapsible part groups are open by default, defaults to `true`
107-
- In the Fluent theme "copilot" variant, collapsible groups now default to closed
106+
- Added `styleOptions.partGroupDefaultOpen` to configure whether part groups are open by default, defaults to `true`
107+
- Added `styleOptions.referencesDefaultOpen` to configure whether references are open by default, defaults to `true`
108+
- In the Fluent theme "copilot" variant, part groups and references now default to closed
108109
- Added `disableFileUpload` flag to completelly disable file upload feature, in PR [#5508](https://github.com/microsoft/BotFramework-WebChat/pull/5508), by [@JamesNewbyAtMicrosoft](https://github.com/JamesNewbyAtMicrosoft)
109110
- Deprecated `hideUploadButton` in favor of `disableFileUpload`.
110111
- Updated `BasicSendBoxToolbar` to rely solely on `disableFileUpload`.

packages/api/src/StyleOptions.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -967,18 +967,18 @@ type StyleOptions = {
967967
speechRecognitionContinuous?: boolean | undefined;
968968

969969
/**
970-
* Whether collapsible activity groupings ("part" groups) are open by default.
970+
* Whether part groups are open by default.
971971
*
972972
* @default true
973973
*/
974-
collapsibleGroupingDefaultOpen?: boolean | undefined;
974+
partGroupDefaultOpen?: boolean | undefined;
975975

976976
/**
977-
* Whether link definitions (citation references) are open by default.
977+
* Whether references (citation link definitions) are open by default.
978978
*
979979
* @default true
980980
*/
981-
linkDefinitionsDefaultOpen?: boolean | undefined;
981+
referencesDefaultOpen?: boolean | undefined;
982982

983983
/**
984984
* Defines how activities are being grouped by (in the order of appearance in the array). Default to `['sender', 'status', 'part']` or `sender,status` in CSS.

packages/api/src/defaultStyleOptions.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,9 @@ const DEFAULT_OPTIONS: Required<StyleOptions> = {
313313
// Speech recognition
314314
speechRecognitionContinuous: false,
315315

316-
collapsibleGroupingDefaultOpen: true,
317-
linkDefinitionsDefaultOpen: true,
316+
partGroupDefaultOpen: true,
317+
referencesDefaultOpen: true,
318+
318319
groupActivitiesBy: ['sender', 'status', 'part'],
319320

320321
// Send box attachment bar

packages/component/src/LinkDefinition/LinkDefinitions.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,11 @@ const LinkDefinitions = <TAccessoryProps extends {}>({
5555
const localizeWithPlural = useLocalizer({ plural: true });
5656
const summaryRef = useRef<HTMLElement>(null);
5757
const classNames = useStyles(styles);
58-
const [{ linkDefinitionsDefaultOpen }] = useStyleOptions();
58+
const [{ referencesDefaultOpen }] = useStyleOptions();
5959

6060
const headerText = localizeWithPlural(REFERENCE_LIST_HEADER_IDS, childrenCount(children));
6161

62-
const defaultOpenString = useMemo(
63-
() => (linkDefinitionsDefaultOpen ? 'true' : 'false'),
64-
[linkDefinitionsDefaultOpen]
65-
);
62+
const defaultOpenString = useMemo(() => (referencesDefaultOpen ? 'true' : 'false'), [referencesDefaultOpen]);
6663

6764
const handleToggle = useCallback<ReactEventHandler<HTMLDetailsElement>>(event => {
6865
const summary = summaryRef.current;
@@ -80,7 +77,7 @@ const LinkDefinitions = <TAccessoryProps extends {}>({
8077
// eslint-disable-next-line react/forbid-dom-props
8178
id={id}
8279
onToggle={handleToggle}
83-
open={linkDefinitionsDefaultOpen}
80+
open={referencesDefaultOpen}
8481
>
8582
<summary
8683
aria-controls={id}

packages/component/src/Middleware/ActivityGrouping/ui/PartGrouping/private/PartGroupingActivity.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ function PartGroupingActivity(props: PartGroupingActivityProps) {
143143

144144
const classNames = useStyles(styles);
145145
const getKeyByActivity = useGetKeyByActivity();
146-
const [{ collapsibleGroupingDefaultOpen }] = useStyleOptions();
147-
const [isGroupOpen, setIsGroupOpen] = useState(collapsibleGroupingDefaultOpen);
146+
const [{ partGroupDefaultOpen }] = useStyleOptions();
147+
const [isGroupOpen, setIsGroupOpen] = useState(partGroupDefaultOpen);
148148

149149
const messages = useMemo(
150150
() => activities.map(activity => getOrgSchemaMessage(activity.entities)).filter(message => !!message),

packages/fluent-theme/src/private/FluentThemeProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function FluentThemeProvider(props: FluentThemeProviderProps) {
104104
const fluentStyleOptions = useMemo(
105105
() =>
106106
Object.freeze({
107-
...(variant === 'copilot' && { collapsibleGroupingDefaultOpen: false, linkDefinitionsDefaultOpen: false }),
107+
...(variant === 'copilot' && { partGroupDefaultOpen: false, referencesDefaultOpen: false }),
108108
feedbackActionsPlacement: 'activity-actions',
109109
stylesRoot
110110
}),

0 commit comments

Comments
 (0)