Skip to content

Commit 6822f63

Browse files
committed
Introduce collapsible sections
This switches to collapsible sections and removes the menu entries for showing / hiding the sections.
1 parent d079e95 commit 6822f63

9 files changed

Lines changed: 119 additions & 221 deletions

File tree

media/options-widget.css

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,43 @@
9898
color: var(--vscode-descriptionForeground);
9999
}
100100

101-
.advanced-options-content {
102-
color: var(--vscode-settings-headerForeground);
103-
margin-bottom: 1.2rem;
101+
.advanced-options-panel .p-overlaypanel-content {
102+
padding: 0.8rem;
104103
}
105104

106-
.advanced-options-content:last-child {
107-
margin-bottom: 0;
105+
.advanced-options-panel .advanced-options-header {
106+
font-size: 11px;
107+
text-transform: uppercase;
108+
line-height: 22px;
109+
margin:0;
110+
font-weight: normal;
108111
}
109112

110-
.advanced-options-content h2 {
111-
font-size: 110%;
112-
margin: 0 0 0 0;
113+
.advanced-options-accordion a:focus {
114+
outline-color: var(--vscode-focusBorder);
115+
}
116+
117+
.advanced-options-accordion .p-accordion-header {
118+
border-top: 1px solid var(--vscode-widget-border);
119+
color: var(--vscode-sideBarSectionHeader-foreground);
120+
}
121+
122+
.advanced-options-accordion .p-accordion-header-link {
123+
overflow: hidden;
124+
text-overflow: ellipsis;
125+
color: var(--vscode-sideBarSectionHeader-foreground);
126+
}
127+
128+
.advanced-options-accordion .p-accordion-header-text {
129+
font-size: 11px;
130+
text-transform: uppercase;
131+
font-weight: bold;
132+
line-height: 22px;
133+
}
134+
135+
.advanced-options-content {
136+
color: var(--vscode-settings-headerForeground);
137+
padding-bottom: 0.5rem;
113138
}
114139

115140
.advanced-options-toggle {
@@ -148,6 +173,7 @@
148173
overflow-y: scroll;
149174
max-height: 100%;
150175
margin-top: 0px;
176+
width: 210px;
151177
}
152178
.advanced-options-panel::-webkit-scrollbar-track {
153179
background-color: var(--vscode-dropdown-listBackground);

package.json

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -127,54 +127,6 @@
127127
"enablement": "memory-inspector.canWrite",
128128
"category": "Memory"
129129
},
130-
{
131-
"command": "memory-inspector.show-columns-options",
132-
"title": "Show Columns Visibility Options",
133-
"enablement": "optionsMenu && !showColumnsOptions",
134-
"category": "Memory"
135-
},
136-
{
137-
"command": "memory-inspector.hide-columns-options",
138-
"title": "Hide Columns Visibility Options",
139-
"enablement": "optionsMenu && showColumnsOptions",
140-
"category": "Memory"
141-
},
142-
{
143-
"command": "memory-inspector.show-memory-options",
144-
"title": "Show Memory Format Options",
145-
"enablement": "optionsMenu && !showMemoryOptions",
146-
"category": "Memory"
147-
},
148-
{
149-
"command": "memory-inspector.hide-memory-options",
150-
"title": "Hide Memory Format Options",
151-
"enablement": "optionsMenu && showMemoryOptions",
152-
"category": "Memory"
153-
},
154-
{
155-
"command": "memory-inspector.show-address-options",
156-
"title": "Show Address Format Options",
157-
"enablement": "optionsMenu && !showAddressOptions",
158-
"category": "Memory"
159-
},
160-
{
161-
"command": "memory-inspector.hide-address-options",
162-
"title": "Hide Address Format Options",
163-
"enablement": "optionsMenu && showAddressOptions",
164-
"category": "Memory"
165-
},
166-
{
167-
"command": "memory-inspector.show-refresh-options",
168-
"title": "Show Refresh Options",
169-
"enablement": "optionsMenu && !showRefreshOptions",
170-
"category": "Memory"
171-
},
172-
{
173-
"command": "memory-inspector.hide-refresh-options",
174-
"title": "Hide Refresh Options",
175-
"enablement": "optionsMenu && showRefreshOptions",
176-
"category": "Memory"
177-
},
178130
{
179131
"command": "memory-inspector.reset-display-options-to-debugger-defaults",
180132
"title": "Reset to Debugger Defaults",
@@ -284,46 +236,6 @@
284236
"command": "memory-inspector.reset-display-options",
285237
"group": "a_reset@2",
286238
"when": "webviewId === memory-inspector.memory && optionsMenu"
287-
},
288-
{
289-
"command": "memory-inspector.show-columns-options",
290-
"group": "b_advancedOptions@1",
291-
"when": "webviewId === memory-inspector.memory && optionsMenu && !showColumnsOptions"
292-
},
293-
{
294-
"command": "memory-inspector.hide-columns-options",
295-
"group": "b_advancedOptions@1",
296-
"when": "webviewId === memory-inspector.memory && optionsMenu && showColumnsOptions"
297-
},
298-
{
299-
"command": "memory-inspector.show-memory-options",
300-
"group": "b_advancedOptions@2",
301-
"when": "webviewId === memory-inspector.memory && optionsMenu && !showMemoryOptions"
302-
},
303-
{
304-
"command": "memory-inspector.hide-memory-options",
305-
"group": "b_advancedOptions@2",
306-
"when": "webviewId === memory-inspector.memory && optionsMenu && showMemoryOptions"
307-
},
308-
{
309-
"command": "memory-inspector.show-address-options",
310-
"group": "b_advancedOptions@3",
311-
"when": "webviewId === memory-inspector.memory && optionsMenu && !showAddressOptions"
312-
},
313-
{
314-
"command": "memory-inspector.hide-address-options",
315-
"group": "b_advancedOptions@3",
316-
"when": "webviewId === memory-inspector.memory && optionsMenu && showAddressOptions"
317-
},
318-
{
319-
"command": "memory-inspector.show-refresh-options",
320-
"group": "b_advancedOptions@4",
321-
"when": "webviewId === memory-inspector.memory && optionsMenu && !showRefreshOptions"
322-
},
323-
{
324-
"command": "memory-inspector.hide-refresh-options",
325-
"group": "b_advancedOptions@4",
326-
"when": "webviewId === memory-inspector.memory && optionsMenu && showRefreshOptions"
327239
}
328240
]
329241
},

src/common/webview-configuration.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,9 @@ export interface MemoryDisplaySettingsContribution {
5252
}
5353

5454
/** All settings related to memory view that can be specified for the webview from the extension "main". */
55-
export interface MemoryViewSettings extends MemoryDisplaySettings, AdvancedOptionsVisibilitySettings {
55+
export interface MemoryViewSettings extends MemoryDisplaySettings {
5656
title: string
5757
messageParticipant: WebviewIdMessageParticipant;
5858
hasDebuggerDefaults?: boolean;
5959
contributionMessage?: string;
6060
}
61-
62-
export interface AdvancedOptionsVisibilitySettings {
63-
showColumnsOptions: boolean;
64-
showMemoryOptions: boolean;
65-
showAddressOptions: boolean;
66-
showRefreshOptions: boolean;
67-
}

src/common/webview-context.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ import { WebviewIdMessageParticipant } from 'vscode-messenger-common';
1818
import * as manifest from '../common/manifest';
1919
import { VariableMetadata } from './memory-range';
2020
import { ReadMemoryArguments } from './messaging';
21-
import { AdvancedOptionsVisibilitySettings } from './webview-configuration';
2221

23-
export interface WebviewContext extends AdvancedOptionsVisibilitySettings {
22+
export interface WebviewContext {
2423
messageParticipant: WebviewIdMessageParticipant,
2524
webviewSection: string,
2625
showAsciiColumn: boolean

src/plugin/memory-webview-main.ts

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,6 @@ export class MemoryWebview implements vscode.CustomReadonlyEditorProvider {
6565
public static ToggleAsciiColumnCommandType = `${manifest.PACKAGE_NAME}.toggle-ascii-column`;
6666
public static ToggleVariablesColumnCommandType = `${manifest.PACKAGE_NAME}.toggle-variables-column`;
6767
public static ToggleRadixPrefixCommandType = `${manifest.PACKAGE_NAME}.toggle-radix-prefix`;
68-
public static ShowColumnsOptionsType = `${manifest.PACKAGE_NAME}.show-columns-options`;
69-
public static HideColumnsOptionsType = `${manifest.PACKAGE_NAME}.hide-columns-options`;
70-
public static ShowMemoryOptionsType = `${manifest.PACKAGE_NAME}.show-memory-options`;
71-
public static HideMemoryOptionsType = `${manifest.PACKAGE_NAME}.hide-memory-options`;
72-
public static ShowAddressOptionsType = `${manifest.PACKAGE_NAME}.show-address-options`;
73-
public static HideAddressOptionsType = `${manifest.PACKAGE_NAME}.hide-address-options`;
74-
public static ShowRefreshOptionsType = `${manifest.PACKAGE_NAME}.show-refresh-options`;
75-
public static HideRefreshOptionsType = `${manifest.PACKAGE_NAME}.hide-refresh-options`;
7668
public static ResetDisplayOptionsToDefaultsType = `${manifest.PACKAGE_NAME}.reset-display-options`;
7769
public static ResetDisplayOptionsToDebuggerDefaultsType = `${manifest.PACKAGE_NAME}.reset-display-options-to-debugger-defaults`;
7870
public static ShowAdvancedDisplayConfigurationCommandType = `${manifest.PACKAGE_NAME}.show-advanced-display-options`;
@@ -111,31 +103,6 @@ export class MemoryWebview implements vscode.CustomReadonlyEditorProvider {
111103
this.setMemoryViewSettings(ctx.messageParticipant, { showRadixPrefix: !ctx.showRadixPrefix });
112104
}),
113105

114-
vscode.commands.registerCommand(MemoryWebview.ShowColumnsOptionsType, (ctx: WebviewContext) => {
115-
this.setMemoryViewSettings(ctx.messageParticipant, { showColumnsOptions: true });
116-
}),
117-
vscode.commands.registerCommand(MemoryWebview.HideColumnsOptionsType, (ctx: WebviewContext) => {
118-
this.setMemoryViewSettings(ctx.messageParticipant, { showColumnsOptions: false });
119-
}),
120-
vscode.commands.registerCommand(MemoryWebview.ShowMemoryOptionsType, (ctx: WebviewContext) => {
121-
this.setMemoryViewSettings(ctx.messageParticipant, { showMemoryOptions: true });
122-
}),
123-
vscode.commands.registerCommand(MemoryWebview.HideMemoryOptionsType, (ctx: WebviewContext) => {
124-
this.setMemoryViewSettings(ctx.messageParticipant, { showMemoryOptions: false });
125-
}),
126-
vscode.commands.registerCommand(MemoryWebview.ShowAddressOptionsType, (ctx: WebviewContext) => {
127-
this.setMemoryViewSettings(ctx.messageParticipant, { showAddressOptions: true });
128-
}),
129-
vscode.commands.registerCommand(MemoryWebview.HideAddressOptionsType, (ctx: WebviewContext) => {
130-
this.setMemoryViewSettings(ctx.messageParticipant, { showAddressOptions: false });
131-
}),
132-
vscode.commands.registerCommand(MemoryWebview.ShowRefreshOptionsType, (ctx: WebviewContext) => {
133-
this.setMemoryViewSettings(ctx.messageParticipant, { showRefreshOptions: true });
134-
}),
135-
vscode.commands.registerCommand(MemoryWebview.HideRefreshOptionsType, (ctx: WebviewContext) => {
136-
this.setMemoryViewSettings(ctx.messageParticipant, { showRefreshOptions: false });
137-
}),
138-
139106
vscode.commands.registerCommand(MemoryWebview.ShowAdvancedDisplayConfigurationCommandType, async (ctx: WebviewContext) => {
140107
this.messenger.sendNotification(showAdvancedOptionsType, ctx.messageParticipant, undefined);
141108
}),

src/webview/components/memory-widget.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ import * as manifest from '../../common/manifest';
2020
import { Memory } from '../../common/memory';
2121
import { WebviewSelection } from '../../common/messaging';
2222
import { MemoryOptions, ReadMemoryArguments, SessionContext } from '../../common/messaging';
23-
import { AdvancedOptionsVisibilitySettings, MemoryDataDisplaySettings } from '../../common/webview-configuration';
23+
import { MemoryDataDisplaySettings } from '../../common/webview-configuration';
2424
import { ColumnStatus } from '../columns/column-contribution-service';
2525
import { HoverService } from '../hovers/hover-service';
2626
import { Decoration, MemoryState } from '../utils/view-types';
2727
import { createAppVscodeContext, VscodeContext } from '../utils/vscode-contexts';
2828
import { MemoryTable } from './memory-table';
2929
import { OptionsWidget } from './options-widget';
3030

31-
interface MemoryWidgetProps extends MemoryDataDisplaySettings, AdvancedOptionsVisibilitySettings {
31+
interface MemoryWidgetProps extends MemoryDataDisplaySettings {
3232
messageParticipant: WebviewIdMessageParticipant;
3333
sessionContext: SessionContext;
3434
configuredReadArguments: Required<ReadMemoryArguments>;
@@ -75,10 +75,6 @@ export class MemoryWidget extends React.Component<MemoryWidgetProps, MemoryWidge
7575
showAsciiColumn: visibleColumns.includes(manifest.CONFIG_SHOW_ASCII_COLUMN),
7676
showVariablesColumn: visibleColumns.includes(manifest.CONFIG_SHOW_VARIABLES_COLUMN),
7777
activeReadArguments: this.props.activeReadArguments,
78-
showColumnsOptions: this.props.showColumnsOptions,
79-
showMemoryOptions: this.props.showMemoryOptions,
80-
showAddressOptions: this.props.showAddressOptions,
81-
showRefreshOptions: this.props.showRefreshOptions,
8278
hasDebuggerDefaults: this.props.hasDebuggerDefaults,
8379
});
8480

@@ -106,10 +102,6 @@ export class MemoryWidget extends React.Component<MemoryWidgetProps, MemoryWidge
106102
addressPadding={this.props.addressPadding}
107103
addressRadix={this.props.addressRadix}
108104
showRadixPrefix={this.props.showRadixPrefix}
109-
showColumnsOptions={this.props.showColumnsOptions}
110-
showMemoryOptions={this.props.showMemoryOptions}
111-
showAddressOptions={this.props.showAddressOptions}
112-
showRefreshOptions={this.props.showRefreshOptions}
113105
settingsContributionMessage={this.props.settingsContributionMessage}
114106
fetchMemory={this.props.fetchMemory}
115107
toggleColumn={this.props.toggleColumn}

src/webview/components/multi-select.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ export interface SingleSelectItemProps {
2525

2626
interface MultiSelectProps {
2727
items: SingleSelectItemProps[];
28-
label: string;
28+
label?: string;
2929
id?: string;
3030
classNames?: string;
3131
onSelectionChanged: (labelSelected: string, newSelectionState: boolean) => unknown;
3232
}
3333

34-
const MultiSelectBar: React.FC<MultiSelectProps> = ({ items, onSelectionChanged, id }) => {
34+
export const MultiSelectBar: React.FC<MultiSelectProps> = ({ items, onSelectionChanged, id }) => {
3535
const changeHandler: ((e: CheckboxChangeEvent) => unknown) = React.useCallback(e => {
3636
const target = e.target as HTMLInputElement;
3737
if (target) {
@@ -55,10 +55,3 @@ const MultiSelectBar: React.FC<MultiSelectProps> = ({ items, onSelectionChanged,
5555
</div>
5656
);
5757
};
58-
59-
export const MultiSelectWithLabel: React.FC<MultiSelectProps> = ({ id, label, items, onSelectionChanged, classNames }) => (
60-
<div className={'flex flex-column ' + classNames}>
61-
<h2 className='multi-select-label mb-2'>{label}</h2>
62-
<MultiSelectBar id={id} items={items} onSelectionChanged={onSelectionChanged} label={label} />
63-
</div>
64-
);

0 commit comments

Comments
 (0)