cherry-pick(#21826): chore: update margins to align

This commit is contained in:
Pavel Feldman 2023-03-20 20:45:32 -07:00
parent b6e9f1fa53
commit 497c89dcfb
8 changed files with 73 additions and 50 deletions

View file

@ -24,6 +24,10 @@
overflow: hidden; overflow: hidden;
} }
.snapshot-tab .toolbar {
background-color: var(--vscode-sideBar-background);
}
.snapshot-controls { .snapshot-controls {
flex: none; flex: none;
background-color: var(--vscode-sideBar-background); background-color: var(--vscode-sideBar-background);

View file

@ -150,7 +150,7 @@ export const SnapshotTab: React.FunctionComponent<{
window.open(popoutUrl || '', '_blank'); window.open(popoutUrl || '', '_blank');
}}></ToolbarButton> }}></ToolbarButton>
</Toolbar> </Toolbar>
{pickerVisible && <Toolbar> {pickerVisible && <Toolbar noMinHeight={true}>
<ToolbarButton icon='microscope' title='Pick locator' disabled={!popoutUrl} toggled={isInspecting} onClick={() => { <ToolbarButton icon='microscope' title='Pick locator' disabled={!popoutUrl} toggled={isInspecting} onClick={() => {
setIsInspecting(!isInspecting); setIsInspecting(!isInspecting);
}}></ToolbarButton> }}></ToolbarButton>

View file

@ -47,6 +47,7 @@
user-select: none; user-select: none;
} }
.list-view-entry.selected .watch-mode-list-item-time,
.list-view-entry.highlighted .watch-mode-list-item-time { .list-view-entry.highlighted .watch-mode-list-item-time {
display: none; display: none;
} }
@ -67,7 +68,7 @@
.watch-mode-sidebar img { .watch-mode-sidebar img {
flex: none; flex: none;
margin-left: 4px; margin-left: 6px;
width: 24px; width: 24px;
height: 24px; height: 24px;
} }
@ -107,6 +108,11 @@
flex: none; flex: none;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin: 2px 0;
}
.filter-list {
padding: 0 10px 10px 10px;
} }
.filter-title, .filter-title,
@ -123,15 +129,18 @@
} }
.filter-summary { .filter-summary {
line-height: 21px; line-height: 24px;
margin-top: 2px; margin-left: 24px;
margin-left: 20px;
} }
.filter-summary .filter-label { .filter-summary .filter-label {
margin-left: 5px; margin-left: 5px;
} }
.filter-entry {
line-height: 24px;
}
.filter-entry label { .filter-entry label {
display: flex; display: flex;
align-items: center; align-items: center;

View file

@ -162,7 +162,7 @@ export const WatchModeView: React.FC<{}> = ({
</div> </div>
</div> </div>
<div className='vbox watch-mode-sidebar'> <div className='vbox watch-mode-sidebar'>
<Toolbar noShadow={true}> <Toolbar noShadow={true} noMinHeight={true}>
<img src='icon-32x32.png' /> <img src='icon-32x32.png' />
<div className='section-title'>Playwright</div> <div className='section-title'>Playwright</div>
<ToolbarButton icon='color-mode' title='Toggle color mode' onClick={() => toggleTheme()} /> <ToolbarButton icon='color-mode' title='Toggle color mode' onClick={() => toggleTheme()} />
@ -238,40 +238,43 @@ const FiltersView: React.FC<{
if (e.key === 'Enter') if (e.key === 'Enter')
runTests(); runTests();
}} />}> }} />}>
{<div className='filter-title' title={statusLine} onClick={() => setExpanded(false)}><span className='filter-label'>Status:</span> {statusLine}</div>}
{[...statusFilters.entries()].map(([status, value]) => {
return <div className='filter-entry'>
<label>
<input type='checkbox' checked={value} onClick={() => {
const copy = new Map(statusFilters);
copy.set(status, !copy.get(status));
setStatusFilters(copy);
}}/>
<div>{status}</div>
</label>
</div>;
})}
{<div className='filter-title' title={projectsLine}><span className='filter-label'>Projects:</span> {projectsLine}</div>}
{[...projectFilters.entries()].map(([projectName, value]) => {
return <div className='filter-entry'>
<label>
<input type='checkbox' checked={value} onClick={() => {
const copy = new Map(projectFilters);
copy.set(projectName, !copy.get(projectName));
setProjectFilters(copy);
const configFile = testModel?.config?.configFile;
if (configFile)
settings.setObject(configFile + ':projects', [...copy.entries()].filter(([_, v]) => v).map(([k]) => k));
}}/>
<div>{projectName}</div>
</label>
</div>;
})}
</Expandable> </Expandable>
{!expanded && <div className='filter-summary' title={'Status: ' + statusLine + '\nProjects: ' + projectsLine} onClick={() => setExpanded(true)}> <div className='filter-summary' title={'Status: ' + statusLine + '\nProjects: ' + projectsLine} onClick={() => setExpanded(!expanded)}>
<span className='filter-label'>Status:</span> {statusLine} <span className='filter-label'>Status:</span> {statusLine}
<span className='filter-label'>Projects:</span> {projectsLine} <span className='filter-label'>Projects:</span> {projectsLine}
</div>
{expanded && <div className='hbox' style={{ marginLeft: 14 }}>
<div className='filter-list'>
{[...statusFilters.entries()].map(([status, value]) => {
return <div className='filter-entry'>
<label>
<input type='checkbox' checked={value} onClick={() => {
const copy = new Map(statusFilters);
copy.set(status, !copy.get(status));
setStatusFilters(copy);
}}/>
<div>{status}</div>
</label>
</div>;
})}
</div>
<div className='filter-list'>
{[...projectFilters.entries()].map(([projectName, value]) => {
return <div className='filter-entry'>
<label>
<input type='checkbox' checked={value} onClick={() => {
const copy = new Map(projectFilters);
copy.set(projectName, !copy.get(projectName));
setProjectFilters(copy);
const configFile = testModel?.config?.configFile;
if (configFile)
settings.setObject(configFile + ':projects', [...copy.entries()].filter(([_, v]) => v).map(([k]) => k));
}}/>
<div>{projectName}</div>
</label>
</div>;
})}
</div>
</div>} </div>}
</div>; </div>;
}; };
@ -404,15 +407,17 @@ const TestList: React.FC<{
return <div className='hbox watch-mode-list-item'> return <div className='hbox watch-mode-list-item'>
<div className='watch-mode-list-item-title'>{treeItem.title}</div> <div className='watch-mode-list-item-title'>{treeItem.title}</div>
{!!treeItem.duration && <div className='watch-mode-list-item-time'>{msToString(treeItem.duration)}</div>} {!!treeItem.duration && <div className='watch-mode-list-item-time'>{msToString(treeItem.duration)}</div>}
<ToolbarButton icon='play' title='Run' onClick={() => runTreeItem(treeItem)} disabled={!!runningState}></ToolbarButton> <Toolbar noMinHeight={true} noShadow={true}>
<ToolbarButton icon='go-to-file' title='Open in VS Code' onClick={() => sendMessageNoReply('open', { location: locationToOpen(treeItem) })}></ToolbarButton> <ToolbarButton icon='play' title='Run' onClick={() => runTreeItem(treeItem)} disabled={!!runningState}></ToolbarButton>
{!watchAll && <ToolbarButton icon='eye' title='Watch' onClick={() => { <ToolbarButton icon='go-to-file' title='Open in VS Code' onClick={() => sendMessageNoReply('open', { location: locationToOpen(treeItem) })}></ToolbarButton>
if (watchedTreeIds.value.has(treeItem.id)) {!watchAll && <ToolbarButton icon='eye' title='Watch' onClick={() => {
watchedTreeIds.value.delete(treeItem.id); if (watchedTreeIds.value.has(treeItem.id))
else watchedTreeIds.value.delete(treeItem.id);
watchedTreeIds.value.add(treeItem.id); else
setWatchedTreeIds({ ...watchedTreeIds }); watchedTreeIds.value.add(treeItem.id);
}} toggled={watchedTreeIds.value.has(treeItem.id)}></ToolbarButton>} setWatchedTreeIds({ ...watchedTreeIds });
}} toggled={watchedTreeIds.value.has(treeItem.id)}></ToolbarButton>}
</Toolbar>
</div>; </div>;
}} }}
icon={treeItem => { icon={treeItem => {

View file

@ -145,6 +145,10 @@ body.dark-mode ::-webkit-scrollbar-track:hover {
animation: spin 1s infinite linear; animation: spin 1s infinite linear;
} }
::placeholder {
color: var(--vscode-input-placeholderForeground);
}
@keyframes spin { @keyframes spin {
100% { 100% {
transform: rotate(360deg); transform: rotate(360deg);

View file

@ -20,6 +20,10 @@
overflow: hidden; overflow: hidden;
} }
.tabbed-pane .toolbar {
background-color: var(--vscode-sideBar-background);
}
.tabbed-pane .tab-content { .tabbed-pane .tab-content {
display: flex; display: flex;
flex: auto; flex: auto;
@ -28,7 +32,6 @@
.tabbed-pane-tab { .tabbed-pane-tab {
padding: 2px 10px 0 10px; padding: 2px 10px 0 10px;
margin-right: 4px;
cursor: pointer; cursor: pointer;
display: flex; display: flex;
flex: none; flex: none;

View file

@ -17,12 +17,11 @@
.toolbar { .toolbar {
position: relative; position: relative;
display: flex; display: flex;
background-color: var(--vscode-sideBar-background);
color: var(--vscode-sideBarTitle-foreground); color: var(--vscode-sideBarTitle-foreground);
min-height: 35px; min-height: 35px;
align-items: center; align-items: center;
flex: none; flex: none;
padding-right: 2px; padding-right: 4px;
} }
.toolbar:after { .toolbar:after {

View file

@ -21,7 +21,6 @@
color: var(--vscode-sideBarTitle-foreground); color: var(--vscode-sideBarTitle-foreground);
background: transparent; background: transparent;
padding: 4px; padding: 4px;
margin: 0 2px;
cursor: pointer; cursor: pointer;
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;