chrome-devtools-frontend 1.0.1733843 → 1.0.1736236
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.
- package/.agents/rules/tests/test-view-and-presenter-isolation.md +4 -4
- package/.agents/rules/ui-and-widgets/ui-declarative-tree-and-prompt-patterns.md +61 -0
- package/.agents/rules/ui-and-widgets/ui-lit-declarative-templates-and-directives.md +11 -7
- package/.agents/rules/ui-and-widgets/ui-modern-component-and-encapsulation-standards.md +13 -4
- package/.agents/rules/ui-and-widgets/ui-pure-view-and-presenter-separation.md +31 -2
- package/.agents/rules/ui-and-widgets/ui-reactive-widget-update-lifecycle.md +23 -4
- package/.agents/rules/ui-and-widgets/ui-widget-dom-and-listener-lifecycle.md +34 -3
- package/.agents/skills/code-review/SKILL.md +27 -0
- package/.agents/skills/devtools-uistrings/SKILL.md +147 -0
- package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +27 -1
- package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +100 -0
- package/.agents/skills/ui-eng-vision-test-scaffolder/SKILL.md +16 -0
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +13 -2
- package/.agents/skills/ui-widgets/SKILL.md +25 -25
- package/DIR_METADATA +8 -1
- package/docs/cookbook/localization.md +1 -1
- package/docs/ui_engineering.md +24 -0
- package/eslint.config.mjs +0 -1
- package/front_end/application_tokens.css +1 -1
- package/front_end/core/host/AidaClient.ts +147 -202
- package/front_end/core/host/AidaClientTypes.ts +9 -0
- package/front_end/core/host/AidaErrors.ts +416 -0
- package/front_end/core/host/AidaGcaTranslation.ts +11 -0
- package/front_end/core/host/InspectorFrontendHostAPI.ts +9 -2
- package/front_end/core/host/UserMetrics.ts +25 -0
- package/front_end/core/host/UserMetricsEnums.ts +25 -0
- package/front_end/core/host/host.ts +3 -1
- package/front_end/core/i18n/collect-ui-strings.js +20 -0
- package/front_end/core/root/Runtime.ts +12 -0
- package/front_end/core/sdk/CPUThrottlingManager.ts +3 -0
- package/front_end/core/sdk/EnhancedTracesParser.ts +8 -4
- package/front_end/core/sdk/NetworkManager.ts +0 -6
- package/front_end/core/sdk/OverlayModel.ts +0 -6
- package/front_end/core/sdk/PreloadingModel.ts +30 -13
- package/front_end/core/sdk/PrivateVerificationTokensModel.ts +0 -18
- package/front_end/core/sdk/RehydratingConnection.ts +5 -2
- package/front_end/core/sdk/ResourceTreeModel.ts +0 -42
- package/front_end/core/sdk/ScreenCaptureModel.ts +0 -84
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +0 -15
- package/front_end/core/sdk/StorageBucketsModel.ts +0 -15
- package/front_end/devtools_compatibility.js +57 -2
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +4 -2
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +203 -127
- package/front_end/entrypoints/inspector_main/renderingOptions.css +5 -0
- package/front_end/entrypoints/node_app/app/NodeMain.ts +0 -9
- package/front_end/entrypoints/node_app/app/nodeConnectionsPanel.css +0 -22
- package/front_end/generated/InspectorBackendCommands.ts +1 -1
- package/front_end/generated/SupportedCSSProperties.ts +0 -136
- package/front_end/generated/protocol-proxy-api.d.ts +231 -231
- package/front_end/generated/protocol.ts +1 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +4 -1
- package/front_end/models/ai_assistance/ChangeManager.ts +3 -1
- package/front_end/models/ai_assistance/DOMHelpers.ts +118 -3
- package/front_end/models/ai_assistance/ExtensionScope.ts +31 -24
- package/front_end/models/ai_assistance/agents/AiAgent.ts +6 -0
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +13 -13
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +1 -1
- package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +18 -8
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +2 -2
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +103 -81
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +15 -203
- package/front_end/models/ai_assistance/injected.ts +6 -1
- package/front_end/models/ai_assistance/skills/lighthouse.md +1 -1
- package/front_end/models/ai_assistance/skills/styling.md +8 -10
- package/front_end/models/ai_assistance/tools/GetTraceEventByKey.ts +1 -1
- package/front_end/models/ai_assistance/tools/SetElementStyles.ts +288 -0
- package/front_end/models/ai_assistance/tools/Tool.ts +1 -0
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +3 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +64 -16
- package/front_end/models/comment_manager/CD4ABridge.ts +12 -2
- package/front_end/models/comment_manager/CommentManager.ts +24 -4
- package/front_end/models/javascript_metadata/NativeFunctions.ts +41 -1
- package/front_end/models/project_settings/ProjectSettingsModel.ts +1 -1
- package/front_end/models/trace/handlers/FlowsHandler.ts +10 -0
- package/front_end/models/trace/handlers/SamplesHandler.ts +3 -2
- package/front_end/models/trace/handlers/ScriptsHandler.ts +25 -26
- package/front_end/models/trace/helpers/TreeHelpers.ts +4 -0
- package/front_end/models/trace/insights/DuplicatedJavaScript.ts +1 -2
- package/front_end/models/trace/types/TraceEvents.ts +21 -22
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +9 -1
- package/front_end/panels/ai_assistance/components/chatInput.css +4 -4
- package/front_end/panels/animation/AnimationTimeline.ts +3 -3
- package/front_end/panels/animation/animationTimeline.css +6 -4
- package/front_end/panels/application/IndexedDBModel.ts +0 -15
- package/front_end/panels/application/appManifestView.css +2 -5
- package/front_end/panels/application/components/backForwardCacheView.css +1 -5
- package/front_end/panels/application/components/serviceWorkerRouterView.css +2 -2
- package/front_end/panels/application/preloading/components/PreloadingString.ts +7 -0
- package/front_end/panels/comments/CommentsPane.ts +12 -7
- package/front_end/panels/comments/commentsPane.css +16 -2
- package/front_end/panels/common/CommentsOverlayWidget.ts +16 -10
- package/front_end/panels/common/CommentsStatusBarPill.ts +12 -5
- package/front_end/panels/common/commentsOverlay.css +7 -1
- package/front_end/panels/common/commentsStatusBarPill.css +30 -0
- package/front_end/panels/console/consolePrompt.css +0 -12
- package/front_end/panels/console/consoleView.css +2 -2
- package/front_end/panels/developer_resources/developerResourcesView.css +4 -3
- package/front_end/panels/elements/DOMTreeWidget.ts +29 -9
- package/front_end/panels/elements/StylePropertyTreeElement.ts +2 -1
- package/front_end/panels/elements/components/CSSHintDetailsView.ts +12 -5
- package/front_end/panels/elements/components/cssVariableValueView.css +1 -1
- package/front_end/panels/elements/components/elementsBreadcrumbs.css +2 -2
- package/front_end/panels/elements/domTreeWidget.css +6 -1
- package/front_end/panels/elements/elementsPanel.css +0 -6
- package/front_end/panels/elements/layoutPane.css +1 -1
- package/front_end/panels/elements/metricsSidebarPane.css +1 -1
- package/front_end/panels/elements/platformFontsWidget.css +1 -1
- package/front_end/panels/elements/stylesSidebarPane.css +0 -10
- package/front_end/panels/emulation/deviceModeView.css +6 -7
- package/front_end/panels/explain/components/consoleInsight.css +4 -4
- package/front_end/panels/issues/issuesTree.css +1 -26
- package/front_end/panels/lighthouse/lighthouseStartView.css +2 -2
- package/front_end/panels/linear_memory_inspector/components/linearMemoryInspector.css +1 -1
- package/front_end/panels/media/TickingFlameChart.ts +20 -3
- package/front_end/panels/media/playerMessagesView.css +2 -2
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +24 -5
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +1 -6
- package/front_end/panels/network/networkLogView.css +2 -2
- package/front_end/panels/network/networkTimingTable.css +1 -1
- package/front_end/panels/performance_monitor/performanceMonitor.css +0 -4
- package/front_end/panels/protocol_monitor/JSONEditor.css +1 -1
- package/front_end/panels/protocol_monitor/JSONEditor.ts +4 -2
- package/front_end/panels/recorder/recorderPanel.css +3 -3
- package/front_end/panels/recorder/recordingListView.css +1 -1
- package/front_end/panels/screencast/screencastView.css +1 -1
- package/front_end/panels/search/searchResultsPane.css +1 -1
- package/front_end/panels/security/SecurityModel.ts +0 -6
- package/front_end/panels/security/SecurityPanel.ts +120 -108
- package/front_end/panels/security/originView.css +1 -1
- package/front_end/panels/sensors/locationsSettingsTab.css +3 -3
- package/front_end/panels/settings/EditFileSystemView.ts +159 -104
- package/front_end/panels/settings/editFileSystemView.css +30 -4
- package/front_end/panels/settings/emulation/devicesSettingsTab.css +0 -52
- package/front_end/panels/settings/settingsScreen.css +0 -7
- package/front_end/panels/sources/CallStackSidebarPane.ts +339 -221
- package/front_end/panels/sources/NavigatorView.ts +95 -8
- package/front_end/panels/sources/ThreadsSidebarPane.ts +8 -4
- package/front_end/panels/sources/breakpointsView.css +1 -3
- package/front_end/panels/sources/callStackSidebarPane.css +4 -0
- package/front_end/panels/sources/components/HeadersView.ts +15 -2
- package/front_end/panels/sources/watchExpressionsSidebarPane.css +0 -1
- package/front_end/panels/timeline/CountersGraph.ts +0 -4
- package/front_end/panels/timeline/TimelineLoader.ts +16 -6
- package/front_end/panels/timeline/TimelinePanel.ts +20 -12
- package/front_end/panels/timeline/TimelineUIUtils.ts +1 -1
- package/front_end/panels/timeline/components/DetailsView.ts +2 -1
- package/front_end/panels/timeline/components/cwvMetrics.css +1 -1
- package/front_end/panels/timeline/components/metricCard.css +1 -1
- package/front_end/panels/timeline/components/sidebarAnnotationsTab.css +4 -4
- package/front_end/panels/timeline/timelineFlameChartView.css +1 -1
- package/front_end/panels/webauthn/WebauthnPane.ts +13 -14
- package/front_end/panels/webauthn/webauthnPane.css +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/comments/CommentOverlayManager.ts +34 -18
- package/front_end/ui/components/icon_button/FileSourceIcon.ts +6 -0
- package/front_end/ui/components/input/textInput.css +1 -1
- package/front_end/ui/components/panel_introduction_steps/panelIntroductionSteps.css +6 -4
- package/front_end/ui/components/suggestion_input/suggestionInput.css +2 -2
- package/front_end/ui/components/text_editor/AiCodeGenerationTeaser.ts +14 -2
- package/front_end/ui/legacy/DockController.ts +17 -4
- package/front_end/ui/legacy/Treeoutline.ts +2 -2
- package/front_end/ui/legacy/UIUtils.ts +148 -10
- package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +3 -2
- package/front_end/ui/legacy/components/perf_ui/chartViewport.css +2 -2
- package/front_end/ui/legacy/components/perf_ui/filmStripView.css +2 -2
- package/front_end/ui/legacy/components/perf_ui/pieChart.css +1 -1
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +5 -4
- package/front_end/ui/legacy/components/source_frame/imageView.css +1 -1
- package/front_end/ui/legacy/components/utils/TargetDetachedDialog.ts +0 -3
- package/front_end/ui/legacy/components/utils/imagePreview.css +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +1 -14
- package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +3 -2
- package/front_end/ui/legacy/listWidget.css +0 -18
- package/front_end/ui/legacy/theme_support/ThemeSupport.ts +44 -9
- package/front_end/ui/lit/strip-whitespace.ts +1 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +3 -3
- package/front_end/generated/Deprecation.ts +0 -471
- package/front_end/panels/accessibility/axBreadcrumbs.css +0 -155
- package/front_end/panels/network/requestHeadersTree.css +0 -226
- package/front_end/panels/recorder/startView.css +0 -38
- package/front_end/panels/security/ipProtectionView.css +0 -141
- package/front_end/ui/legacy/components/inline_editor/animationNameSwatch.css +0 -27
|
@@ -2,17 +2,19 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
import '../../ui/
|
|
5
|
+
import '../../ui/components/lists/lists.js';
|
|
6
6
|
|
|
7
7
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
8
|
import * as Platform from '../../core/platform/platform.js';
|
|
9
9
|
import type * as Persistence from '../../models/persistence/persistence.js';
|
|
10
|
+
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
11
|
+
import type * as Lists from '../../ui/components/lists/lists.js';
|
|
10
12
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
11
|
-
import {Directives, html, render} from '../../ui/lit/lit.js';
|
|
13
|
+
import {Directives, html, type LitTemplate, nothing, render} from '../../ui/lit/lit.js';
|
|
12
14
|
|
|
13
15
|
import editFileSystemViewStyles from './editFileSystemView.css.js';
|
|
14
16
|
|
|
15
|
-
const {
|
|
17
|
+
const {ifDefined, repeat} = Directives;
|
|
16
18
|
|
|
17
19
|
const UIStrings = {
|
|
18
20
|
/**
|
|
@@ -31,181 +33,234 @@ const UIStrings = {
|
|
|
31
33
|
* @description Error message when a file system path is identical to an existing path.
|
|
32
34
|
*/
|
|
33
35
|
enterAUniquePath: 'Enter a unique path',
|
|
36
|
+
/**
|
|
37
|
+
* @description Text for the button to add a new excluded sub-folder.
|
|
38
|
+
*/
|
|
39
|
+
addSubfolder: 'Add sub-folder',
|
|
40
|
+
/**
|
|
41
|
+
* @description Accessible label for the excluded sub-folder path input in Workspace settings.
|
|
42
|
+
*/
|
|
43
|
+
folderPath: 'Folder path',
|
|
34
44
|
} as const;
|
|
35
45
|
const str_ = i18n.i18n.registerUIStrings('panels/settings/EditFileSystemView.ts', UIStrings);
|
|
36
46
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
37
47
|
|
|
38
|
-
|
|
39
|
-
VALID = 1,
|
|
40
|
-
ERROR_NOT_A_PATH = 2,
|
|
41
|
-
ERROR_NOT_UNIQUE = 3,
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function statusString(status: ExcludedFolderStatus): Platform.UIString.LocalizedString {
|
|
45
|
-
switch (status) {
|
|
46
|
-
case ExcludedFolderStatus.ERROR_NOT_A_PATH:
|
|
47
|
-
return i18nString(UIStrings.enterAPath);
|
|
48
|
-
case ExcludedFolderStatus.ERROR_NOT_UNIQUE:
|
|
49
|
-
return i18nString(UIStrings.enterAUniquePath);
|
|
50
|
-
case ExcludedFolderStatus.VALID:
|
|
51
|
-
throw new Error('unreachable');
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface PathWithStatus {
|
|
56
|
-
path: Platform.DevToolsPath.EncodedPathString;
|
|
57
|
-
status: ExcludedFolderStatus;
|
|
58
|
-
}
|
|
48
|
+
const NEW_ITEM_KEY = Symbol('new-excluded-folder');
|
|
59
49
|
|
|
60
50
|
export interface EditFileSystemViewInput {
|
|
61
51
|
fileSystemPath: Platform.DevToolsPath.UrlString;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
52
|
+
excludedFolders: Platform.DevToolsPath.EncodedPathString[];
|
|
53
|
+
editingIndex: number|null;
|
|
54
|
+
onAdd: () => void;
|
|
55
|
+
onEdit: (index: number) => void;
|
|
56
|
+
onDelete: (index: number) => void;
|
|
57
|
+
onCommit: (index: number, value: string) => void;
|
|
58
|
+
onCancel: () => void;
|
|
59
|
+
validateFolder: (index: number, value: string) => Platform.UIString.LocalizedString | null;
|
|
66
60
|
}
|
|
67
61
|
|
|
68
62
|
export type View = (input: EditFileSystemViewInput, output: undefined, target: HTMLElement) => void;
|
|
69
63
|
|
|
64
|
+
function renderExcludedFolderRow(folder: string, index: number, input: EditFileSystemViewInput): LitTemplate {
|
|
65
|
+
const editing = input.editingIndex === index;
|
|
66
|
+
const onPromptActivate = (event: Event): void => {
|
|
67
|
+
if (editing) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
input.onEdit(index);
|
|
71
|
+
event.consume(true);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// clang-format off
|
|
75
|
+
return html`
|
|
76
|
+
<div
|
|
77
|
+
class="excluded-folder-row"
|
|
78
|
+
?editable=${!editing}
|
|
79
|
+
?deletable=${!editing}>
|
|
80
|
+
<devtools-prompt
|
|
81
|
+
class="excluded-folder-path"
|
|
82
|
+
render-as-block
|
|
83
|
+
title=${ifDefined(folder || undefined)}
|
|
84
|
+
aria-label=${ifDefined(editing ? i18nString(UIStrings.folderPath) : undefined)}
|
|
85
|
+
value=${folder}
|
|
86
|
+
?editing=${editing}
|
|
87
|
+
.validator=${(value: string) => input.validateFolder(index, value)}
|
|
88
|
+
@click=${onPromptActivate}
|
|
89
|
+
@commit=${(event: UI.TextPrompt.TextPromptElement.CommitEvent) => input.onCommit(index, event.detail)}
|
|
90
|
+
@cancel=${input.onCancel}>
|
|
91
|
+
${folder}
|
|
92
|
+
</devtools-prompt>
|
|
93
|
+
</div>
|
|
94
|
+
`;
|
|
95
|
+
// clang-format on
|
|
96
|
+
}
|
|
97
|
+
|
|
70
98
|
export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
99
|
+
const isAdding = input.editingIndex === input.excludedFolders.length;
|
|
100
|
+
const items = isAdding ? [...input.excludedFolders, ''] : input.excludedFolders;
|
|
71
101
|
// clang-format off
|
|
72
102
|
render(html`
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
</table>
|
|
99
|
-
</devtools-data-grid>
|
|
100
|
-
${input.excludedFolderPaths.filter(({status}) => status !== ExcludedFolderStatus.VALID).map(({status}) =>
|
|
101
|
-
html`<span class="excluded-folder-error">${statusString(status)}</span>`)}
|
|
102
|
-
</div>`, target);
|
|
103
|
+
<style>${editFileSystemViewStyles}</style>
|
|
104
|
+
<div class="excluded-folder-header">
|
|
105
|
+
<span>${i18nString(UIStrings.url)}</span>
|
|
106
|
+
<span class="excluded-folder-url">${input.fileSystemPath}</span>
|
|
107
|
+
<div class="excluded-folders-title">${i18nString(UIStrings.excludedFolders)}</div>
|
|
108
|
+
${items.length > 0 ? html`
|
|
109
|
+
<devtools-list
|
|
110
|
+
?disable-li-focus=${input.editingIndex !== null}
|
|
111
|
+
@edit=${(e: Lists.List.ItemEditEvent) => input.onEdit(e.detail.index)}
|
|
112
|
+
@delete=${(e: Lists.List.ItemRemoveEvent) => input.onDelete(e.detail.index)}>
|
|
113
|
+
${repeat(
|
|
114
|
+
items,
|
|
115
|
+
(folder, index) => index === input.excludedFolders.length ? NEW_ITEM_KEY : folder,
|
|
116
|
+
(folder, index) => renderExcludedFolderRow(folder, index, input))}
|
|
117
|
+
</devtools-list>
|
|
118
|
+
` : nothing}
|
|
119
|
+
<devtools-button
|
|
120
|
+
class="add-subfolder-button"
|
|
121
|
+
.variant=${Buttons.Button.Variant.OUTLINED}
|
|
122
|
+
.jslogContext=${'settings.add-excluded-folder'}
|
|
123
|
+
@click=${input.onAdd}>
|
|
124
|
+
${i18nString(UIStrings.addSubfolder)}
|
|
125
|
+
</devtools-button>
|
|
126
|
+
</div>
|
|
127
|
+
`, target);
|
|
103
128
|
// clang-format on
|
|
104
129
|
};
|
|
105
130
|
|
|
106
131
|
export class EditFileSystemView extends UI.Widget.VBox {
|
|
107
132
|
#fileSystem?: Persistence.PlatformFileSystem.PlatformFileSystem;
|
|
108
|
-
#
|
|
133
|
+
#excludedFolders: Platform.DevToolsPath.EncodedPathString[] = [];
|
|
134
|
+
#editingIndex: number|null = null;
|
|
109
135
|
readonly #view: View;
|
|
110
136
|
|
|
111
|
-
constructor(element
|
|
137
|
+
constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
|
|
112
138
|
super(element);
|
|
113
139
|
this.#view = view;
|
|
114
140
|
}
|
|
115
141
|
|
|
116
142
|
set fileSystem(fileSystem: Persistence.PlatformFileSystem.PlatformFileSystem) {
|
|
143
|
+
if (this.#fileSystem === fileSystem) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
117
146
|
this.#fileSystem = fileSystem;
|
|
118
|
-
this.#
|
|
147
|
+
this.#editingIndex = null;
|
|
148
|
+
this.#resyncExcludedFolders();
|
|
119
149
|
this.requestUpdate();
|
|
120
150
|
}
|
|
121
151
|
|
|
122
152
|
override wasShown(): void {
|
|
123
153
|
super.wasShown();
|
|
124
|
-
this.#
|
|
154
|
+
this.#editingIndex = null;
|
|
155
|
+
this.#resyncExcludedFolders();
|
|
125
156
|
this.requestUpdate();
|
|
126
157
|
}
|
|
127
158
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
159
|
+
override willHide(): void {
|
|
160
|
+
super.willHide();
|
|
161
|
+
this.#editingIndex = null;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
#resyncExcludedFolders(): void {
|
|
165
|
+
this.#excludedFolders = this.#fileSystem?.excludedFolders().values().toArray() ?? [];
|
|
135
166
|
}
|
|
136
167
|
|
|
137
168
|
override performUpdate(): void {
|
|
138
169
|
const input: EditFileSystemViewInput = {
|
|
139
170
|
fileSystemPath: this.#fileSystem?.path() ?? Platform.DevToolsPath.urlString``,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
onDelete:
|
|
171
|
+
excludedFolders: [...this.#excludedFolders],
|
|
172
|
+
editingIndex: this.#editingIndex,
|
|
173
|
+
onAdd: this.#onAdd.bind(this),
|
|
174
|
+
onEdit: this.#onEdit.bind(this),
|
|
175
|
+
onDelete: this.#onDelete.bind(this),
|
|
176
|
+
onCommit: this.#onCommit.bind(this),
|
|
177
|
+
onCancel: this.#onCancel.bind(this),
|
|
178
|
+
validateFolder: this.#validateFolder.bind(this),
|
|
145
179
|
};
|
|
146
180
|
this.#view(input, undefined, this.contentElement);
|
|
147
181
|
}
|
|
148
182
|
|
|
149
|
-
#
|
|
150
|
-
if (
|
|
151
|
-
// The data grid fires onCreate even when the user just selects and then deselects the
|
|
152
|
-
// creation row. Ignore those occurrences.
|
|
183
|
+
#onAdd(): void {
|
|
184
|
+
if (this.#editingIndex === this.#excludedFolders.length) {
|
|
153
185
|
return;
|
|
154
186
|
}
|
|
187
|
+
this.#editingIndex = this.#excludedFolders.length;
|
|
188
|
+
this.requestUpdate();
|
|
189
|
+
}
|
|
155
190
|
|
|
156
|
-
|
|
157
|
-
this.#
|
|
158
|
-
|
|
159
|
-
this.#fileSystem?.addExcludedFolder(pathWithStatus.path);
|
|
191
|
+
#onEdit(index: number): void {
|
|
192
|
+
if (index < 0 || index >= this.#excludedFolders.length) {
|
|
193
|
+
return;
|
|
160
194
|
}
|
|
161
|
-
|
|
195
|
+
this.#editingIndex = index;
|
|
162
196
|
this.requestUpdate();
|
|
163
197
|
}
|
|
164
198
|
|
|
165
|
-
#
|
|
166
|
-
|
|
167
|
-
if (index < 0 || index >= this.#excludedFolderPaths.length) {
|
|
199
|
+
#onCancel(): void {
|
|
200
|
+
if (!this.isShowing() || this.#editingIndex === null) {
|
|
168
201
|
return;
|
|
169
202
|
}
|
|
203
|
+
this.#editingIndex = null;
|
|
204
|
+
this.requestUpdate();
|
|
205
|
+
}
|
|
170
206
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
207
|
+
#onCommit(index: number, rawValue: string): void {
|
|
208
|
+
if (!this.isShowing() || this.#editingIndex === null) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
const isNew = index === this.#excludedFolders.length;
|
|
212
|
+
if (!isNew && (index < 0 || index >= this.#excludedFolders.length)) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
if (this.#validateFolder(index, rawValue) !== null) {
|
|
216
|
+
return;
|
|
177
217
|
}
|
|
178
218
|
|
|
179
|
-
|
|
180
|
-
|
|
219
|
+
const path = EditFileSystemView.#normalizePrefix(rawValue.trim()) as Platform.DevToolsPath.EncodedPathString;
|
|
220
|
+
if (isNew) {
|
|
221
|
+
this.#excludedFolders.push(path);
|
|
222
|
+
this.#fileSystem?.addExcludedFolder(path);
|
|
223
|
+
} else if (this.#excludedFolders[index] !== path) {
|
|
224
|
+
this.#fileSystem?.removeExcludedFolder(this.#excludedFolders[index]);
|
|
225
|
+
this.#excludedFolders[index] = path;
|
|
226
|
+
this.#fileSystem?.addExcludedFolder(path);
|
|
181
227
|
}
|
|
182
228
|
|
|
229
|
+
this.#editingIndex = null;
|
|
183
230
|
this.requestUpdate();
|
|
184
231
|
}
|
|
185
232
|
|
|
186
|
-
#onDelete(
|
|
187
|
-
|
|
188
|
-
if (index < 0 || index >= this.#excludedFolderPaths.length) {
|
|
233
|
+
#onDelete(index: number): void {
|
|
234
|
+
if (index < 0 || index >= this.#excludedFolders.length) {
|
|
189
235
|
return;
|
|
190
236
|
}
|
|
191
237
|
|
|
192
|
-
this.#fileSystem?.removeExcludedFolder(this.#
|
|
193
|
-
this.#
|
|
238
|
+
this.#fileSystem?.removeExcludedFolder(this.#excludedFolders[index]);
|
|
239
|
+
this.#excludedFolders.splice(index, 1);
|
|
240
|
+
|
|
241
|
+
if (this.#editingIndex !== null) {
|
|
242
|
+
if (this.#editingIndex === index) {
|
|
243
|
+
this.#editingIndex = null;
|
|
244
|
+
} else if (this.#editingIndex > index) {
|
|
245
|
+
this.#editingIndex--;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
194
248
|
|
|
195
249
|
this.requestUpdate();
|
|
196
250
|
}
|
|
197
251
|
|
|
198
|
-
#validateFolder(rawInput: string):
|
|
252
|
+
#validateFolder(index: number, rawInput: string): Platform.UIString.LocalizedString|null {
|
|
199
253
|
const path = EditFileSystemView.#normalizePrefix(rawInput.trim()) as Platform.DevToolsPath.EncodedPathString;
|
|
200
254
|
if (!path) {
|
|
201
|
-
return
|
|
255
|
+
return i18nString(UIStrings.enterAPath);
|
|
202
256
|
}
|
|
203
257
|
|
|
204
|
-
|
|
205
|
-
|
|
258
|
+
const isDuplicate = this.#excludedFolders.some((p, i) => i !== index && p === path);
|
|
259
|
+
if (isDuplicate) {
|
|
260
|
+
return i18nString(UIStrings.enterAUniquePath);
|
|
206
261
|
}
|
|
207
262
|
|
|
208
|
-
return
|
|
263
|
+
return null;
|
|
209
264
|
}
|
|
210
265
|
|
|
211
266
|
static #normalizePrefix(prefix: string): string {
|
|
@@ -18,11 +18,37 @@
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
.
|
|
22
|
-
|
|
21
|
+
.excluded-folder-row {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
flex: auto;
|
|
25
|
+
min-width: 0;
|
|
26
|
+
padding: var(--sys-size-2) var(--sys-size-4);
|
|
27
|
+
|
|
28
|
+
&:has(devtools-prompt[editing]) {
|
|
29
|
+
align-self: stretch;
|
|
30
|
+
background-color: var(--app-color-card-background, var(--sys-color-cdt-base-container));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.excluded-folder-path {
|
|
35
|
+
flex: auto;
|
|
36
|
+
white-space: nowrap;
|
|
37
|
+
text-overflow: ellipsis;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
|
|
40
|
+
--devtools-text-prompt-min-width: 6em;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
devtools-prompt.excluded-folder-path {
|
|
44
|
+
cursor: text;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
devtools-prompt.excluded-folder-path[editing] {
|
|
48
|
+
overflow: visible;
|
|
23
49
|
}
|
|
24
50
|
|
|
25
|
-
.
|
|
26
|
-
|
|
51
|
+
.add-subfolder-button {
|
|
52
|
+
align-self: flex-start;
|
|
27
53
|
}
|
|
28
54
|
}
|
|
@@ -32,20 +32,6 @@
|
|
|
32
32
|
padding: var(--sys-size-5) var(--sys-size-6);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
.devices-settings-tab .devices-button-row {
|
|
36
|
-
flex: none;
|
|
37
|
-
display: flex;
|
|
38
|
-
|
|
39
|
-
devtools-button {
|
|
40
|
-
margin: var(--sys-size-3) 0 0 5px;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.devices-settings-tab .devices-list {
|
|
45
|
-
width: min(350px, 100%);
|
|
46
|
-
margin-top: 10px;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
35
|
.devices-list-item {
|
|
50
36
|
padding: var(--sys-size-3) var(--sys-size-6);
|
|
51
37
|
height: var(--sys-size-13);
|
|
@@ -92,49 +78,11 @@
|
|
|
92
78
|
margin-bottom: 0;
|
|
93
79
|
}
|
|
94
80
|
|
|
95
|
-
.devices-edit-client-hints-heading {
|
|
96
|
-
display: flex;
|
|
97
|
-
flex-direction: row;
|
|
98
|
-
align-items: center;
|
|
99
|
-
margin-bottom: 5px;
|
|
100
|
-
}
|
|
101
|
-
/* Don't want the bottom margin in the specific case of the folding one;
|
|
102
|
-
* it messes with alignment with the arrow (which is a ::before) and it's
|
|
103
|
-
* spaced reasonably without it anyway
|
|
104
|
-
*/
|
|
105
|
-
li .devices-edit-client-hints-heading {
|
|
106
|
-
margin-bottom: 0;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.devices-edit-client-hints-heading b {
|
|
110
|
-
margin-inline-end: var(--sys-size-2);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.devices-edit-client-hints-heading .help-icon {
|
|
114
|
-
margin-left: var(--sys-size-2);
|
|
115
|
-
margin-right: var(--sys-size-2);
|
|
116
|
-
vertical-align: middle;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.devices-edit-client-hints-heading a:focus {
|
|
120
|
-
box-shadow: var(--sys-color-state-focus-ring);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
81
|
.devices-edit-fields input {
|
|
124
82
|
flex: auto;
|
|
125
83
|
margin: var(--sys-size-5) 5px 0;
|
|
126
84
|
}
|
|
127
85
|
|
|
128
|
-
li.devices-edit-client-hints-field {
|
|
129
|
-
/* Cancel out padding from treeview's .tree-outline ol */
|
|
130
|
-
left: calc(-1 * var(--sys-size-6));
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.devices-edit-client-hints-field input {
|
|
134
|
-
flex: auto;
|
|
135
|
-
margin: var(--sys-size-5) 5px 0;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
86
|
.devices-edit-fields .device-edit-fixed {
|
|
139
87
|
flex: 0 0 140px;
|
|
140
88
|
}
|
|
@@ -9,13 +9,6 @@
|
|
|
9
9
|
background-color: var(--sys-color-cdt-base-container);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
.settings-content {
|
|
13
|
-
overflow: hidden auto;
|
|
14
|
-
margin: var(--sys-size-5) var(--sys-size-5) var(--sys-size-5) 0;
|
|
15
|
-
padding: 0 var(--sys-size-3);
|
|
16
|
-
flex: auto;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
12
|
.settings-experiments-block {
|
|
20
13
|
padding: 0 var(--sys-size-6) var(--sys-size-5) var(--sys-size-4);
|
|
21
14
|
}
|