Skip to content

Commit 45f5fe6

Browse files
aasimkhan30Aasim Khan
andauthored
Aasim/fix/schema designer UI (#21440)
* Refactor schema designer UI: update icons and localization, remove unused SVGs * Update localization strings: change "Publish Changes" to "Apply Changes" and "Definition" to "Show Definition" * Add Filter Funnel Icons and Update Toolbar for Compact Mode - Introduced new FilterFunnelIcon16Regular and FilterFunnelIcon16Filled components for better icon rendering. - Replaced existing FilterFunnel icons in the toolbar with the new 16px versions. - Implemented a compact mode for the Schema Designer toolbar, allowing buttons to hide their text labels when space is limited. - Updated various toolbar buttons (AddTableButton, AutoArrangeButton, DeleteNodesButton, ExportDiagramButton, FilterTablesButton, ShowChangesButton, ShowCopilotChangesButton, UndoRedoButtons, ViewDefinitionsButton) to conditionally render labels based on the compact state. - Created SchemaDesignerToolbarContext to manage the compact state across the toolbar. * Refactor setHighlightOverride to use stable callback in useSchemaDesignerChangeState * Replace icon in DesignerPageRibbon with CodeDefinitionIcon16Regular * Fix typos in icon names and update tooltips with localization constants in Schema Designer UI * Normalize package.json line endings --------- Co-authored-by: Aasim Khan <aasimkhan@gmail.com>
1 parent 65ce20d commit 45f5fe6

31 files changed

Lines changed: 381 additions & 133 deletions

extensions/mssql/l10n/bundle.l10n.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
"Schema": "Schema",
197197
"Back to preview": "Back to preview",
198198
"You must review and accept the terms to proceed": "You must review and accept the terms to proceed",
199-
"Publish Changes": "Publish Changes",
199+
"Apply Changes": "Apply Changes",
200200
"Open Publish Script": "Open Publish Script",
201201
"Code Analysis - {0}/{0} is the name of the database project": {
202202
"message": "Code Analysis - {0}",
@@ -703,7 +703,7 @@
703703
"No Action": "No Action",
704704
"Possible Data Loss detected. Please review the changes.": "Possible Data Loss detected. Please review the changes.",
705705
"Warnings detected. Please review the changes.": "Warnings detected. Please review the changes.",
706-
"Definition": "Definition",
706+
"Show Definition": "Show Definition",
707707
"Delete Confirmation": "Delete Confirmation",
708708
"Are you sure you want to delete the selected items?": "Are you sure you want to delete the selected items?",
709709
"Undo": "Undo",
@@ -881,7 +881,6 @@
881881
"Optional - Override default api/entityName path": "Optional - Override default api/entityName path",
882882
"Custom GraphQL Type": "Custom GraphQL Type",
883883
"Optional - Override default GraphQL type name": "Optional - Override default GraphQL type name",
884-
"Apply Changes": "Apply Changes",
885884
"Source Table": "Source Table",
886885
"Loading...": "Loading...",
887886
"Initializing DAB configuration...": "Initializing DAB configuration...",
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 5 additions & 0 deletions
Loading

extensions/mssql/media/designSchema_dark.svg

Lines changed: 0 additions & 12 deletions
This file was deleted.

extensions/mssql/media/designSchema_light.svg

Lines changed: 0 additions & 12 deletions
This file was deleted.

extensions/mssql/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,8 +1194,8 @@
11941194
"title": "%mssql.schemaDesigner%",
11951195
"category": "MS SQL",
11961196
"icon": {
1197-
"dark": "media/designSchema_dark.svg",
1198-
"light": "media/designSchema_light.svg"
1197+
"dark": "media/applicationQuickStart_dark.svg",
1198+
"light": "media/applicationQuickStart_light.svg"
11991199
}
12001200
},
12011201
{

extensions/mssql/src/reactviews/common/copilot/copilotChatButton.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ export interface CopilotChatButtonProps {
1111
label: string;
1212
tooltip: string;
1313
onClick: () => void | Promise<void>;
14+
hideLabel?: boolean;
1415
}
1516

1617
export const CopilotChatButton = forwardRef<HTMLButtonElement, CopilotChatButtonProps>(
17-
({ label, tooltip, onClick }, ref) => {
18+
({ label, tooltip, onClick, hideLabel }, ref) => {
1819
return (
1920
<Tooltip content={tooltip} relationship="label">
2021
<Button
@@ -25,7 +26,7 @@ export const CopilotChatButton = forwardRef<HTMLButtonElement, CopilotChatButton
2526
title={tooltip}
2627
aria-label={tooltip}
2728
onClick={() => void onClick()}>
28-
{label}
29+
{!hideLabel && label}
2930
</Button>
3031
</Tooltip>
3132
);

extensions/mssql/src/reactviews/common/copilot/copilotChatEntry.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,16 @@ export interface CopilotChatEntryProps {
2121
tooltip: string;
2222
onOpenChat: () => void | Promise<void>;
2323
discovery?: CopilotChatDiscoveryProps;
24+
hideLabel?: boolean;
2425
}
2526

26-
export function CopilotChatEntry({ label, tooltip, onOpenChat, discovery }: CopilotChatEntryProps) {
27+
export function CopilotChatEntry({
28+
label,
29+
tooltip,
30+
onOpenChat,
31+
discovery,
32+
hideLabel,
33+
}: CopilotChatEntryProps) {
2734
const [target, setTarget] = useState<HTMLButtonElement | null>(null);
2835

2936
const handleOpenChat = async () => {
@@ -40,6 +47,7 @@ export function CopilotChatEntry({ label, tooltip, onOpenChat, discovery }: Copi
4047
label={label}
4148
tooltip={tooltip}
4249
onClick={handleOpenChat}
50+
hideLabel={hideLabel}
4351
/>
4452
{discovery && (
4553
<FeatureDiscoveryPopover
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import React from "react";
7+
8+
/**
9+
* Custom icon component because the paths require fillRule="evenodd" which
10+
* createFluentIcon does not support.
11+
*/
12+
export const AddTableIcon16Regular = Object.assign(
13+
React.forwardRef<SVGSVGElement, React.SVGAttributes<SVGElement>>((props, ref) => {
14+
const { fill = "currentColor", className, style, ...rest } = props;
15+
return (
16+
<svg
17+
ref={ref}
18+
width="16"
19+
height="16"
20+
viewBox="0 0 16 16"
21+
xmlns="http://www.w3.org/2000/svg"
22+
className={className}
23+
style={style}
24+
{...rest}>
25+
<path
26+
fillRule="evenodd"
27+
clipRule="evenodd"
28+
d="M4 9.97758V10H6V9.79297C6.34864 9.69436 6.68321 9.56223 7 9.40029V10L11 10V6L9.79297 6C9.88412 5.67772 9.94663 5.34341 9.97758 5L11 5V3H9.79297C9.69436 2.65136 9.56223 2.31679 9.40029 2L12.5 2C13.8807 2 15 3.11929 15 4.5V11.5C15 12.8807 13.8807 14 12.5 14H5.5C4.11929 14 3 12.8807 3 11.5L3 9.79297C3.32228 9.88412 3.65659 9.94663 4 9.97758ZM11 13H7V11L11 11V13ZM4 11H6V13H5.5C4.67157 13 4 12.3284 4 11.5V11ZM12 6H14V10H12V6ZM12 11H14V11.5C14 12.3284 13.3284 13 12.5 13H12V11ZM14 4.5V5H12V3H12.5C13.3284 3 14 3.67157 14 4.5Z"
29+
fill={fill}
30+
/>
31+
<path
32+
fillRule="evenodd"
33+
clipRule="evenodd"
34+
d="M9 4.5C9 6.98528 6.98528 9 4.5 9C2.01472 9 0 6.98528 0 4.5C0 2.01472 2.01472 0 4.5 0C6.98528 0 9 2.01472 9 4.5ZM4.5 2C4.77614 2 5 2.22386 5 2.5V4H6.5C6.77614 4 7 4.22386 7 4.5C7 4.77614 6.77614 5 6.5 5H5V6.5C5 6.77614 4.77614 7 4.5 7C4.22386 7 4 6.77614 4 6.5V5H2.5C2.22386 5 2 4.77614 2 4.5C2 4.22386 2.22386 4 2.5 4H4V2.5C4 2.22386 4.22386 2 4.5 2Z"
35+
fill={fill}
36+
/>
37+
</svg>
38+
);
39+
}),
40+
{ displayName: "AddTableIcon16Regular" },
41+
);
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import React from "react";
7+
8+
/**
9+
* Custom icon components because the paths require fillRule="evenodd" which
10+
* createFluentIcon does not support.
11+
*/
12+
13+
export const FilterFunnelIcon16Regular = Object.assign(
14+
React.forwardRef<SVGSVGElement, React.SVGAttributes<SVGElement>>((props, ref) => {
15+
const { fill = "currentColor", className, style, ...rest } = props;
16+
return (
17+
<svg
18+
ref={ref}
19+
width="16"
20+
height="16"
21+
viewBox="0 0 16 16"
22+
xmlns="http://www.w3.org/2000/svg"
23+
className={className}
24+
style={style}
25+
{...rest}>
26+
<path
27+
fillRule="evenodd"
28+
clipRule="evenodd"
29+
d="M15 2v1.67l-5 4.759V14H6V8.429l-5-4.76V2h14zM7 8v5h2V8l5-4.76V3H2v.24L7 8z"
30+
fill={fill}
31+
/>
32+
</svg>
33+
);
34+
}),
35+
{ displayName: "FilterFunnelIcon16Regular" },
36+
);
37+
38+
export const FilterFunnelIcon16Filled = Object.assign(
39+
React.forwardRef<SVGSVGElement, React.SVGAttributes<SVGElement>>((props, ref) => {
40+
const { fill = "currentColor", className, style, ...rest } = props;
41+
return (
42+
<svg
43+
ref={ref}
44+
width="16"
45+
height="16"
46+
viewBox="0 0 16 16"
47+
xmlns="http://www.w3.org/2000/svg"
48+
className={className}
49+
style={style}
50+
{...rest}>
51+
<path
52+
fillRule="evenodd"
53+
clipRule="evenodd"
54+
d="M15 2v1.67l-5 4.759V14H6V8.429l-5-4.76V2h14z"
55+
fill={fill}
56+
/>
57+
</svg>
58+
);
59+
}),
60+
{ displayName: "FilterFunnelIcon16Filled" },
61+
);

0 commit comments

Comments
 (0)