reduce line jitter when switching from simple to full mode

This commit is contained in:
sawka 2023-10-31 12:55:35 -07:00
parent e1189a5051
commit 8211a0bb26
3 changed files with 17 additions and 11 deletions

View File

@ -422,8 +422,10 @@ class LineCmd extends React.Component<
data-screenid={line.screenid}
style={{ height: height }}
>
<SmallLineAvatar line={line} cmd={cmd} />
<div className="ts">{formattedTime}</div>
<div className="simple-line-header">
<SmallLineAvatar line={line} cmd={cmd} />
<div className="ts">{formattedTime}</div>
</div>
</div>
);
}

View File

@ -38,7 +38,7 @@
.line-header {
display: flex;
flex-direction: row;
padding-bottom: 0.7em;
padding-bottom: 0.7rem;
width: 100%;
&.is-expanded {
@ -111,7 +111,7 @@
.terminal {
margin-right: 8px;
padding: 0.25em;
padding: 0.25rem;
}
&.cmd-done .terminal .xterm-cursor {
@ -137,7 +137,7 @@
margin: 6px 0 2px 10px;
padding: 2px 5px 0px 5px;
display: inline-block;
font-size: 0.8em;
font-size: 10px;
color: @term-white;
background-color: #151715;
}
@ -163,8 +163,8 @@
}
.line {
margin: 1em 1em 0 1em;
padding: 1em;
margin: 1rem 1rem 0 1rem;
padding: 1rem;
border-radius: 6px;
display: flex;
overflow: hidden;
@ -189,11 +189,16 @@
}
&.line-simple {
flex-direction: row;
font-size: 11px;
line-height: 1.2;
color: rgba(@base-color, 0.6);
.simple-line-header {
display: flex;
margin-top: 5px;
flex-direction: row;
}
.ts {
display: flex;
}

View File

@ -137,10 +137,9 @@ class PluginModelClass {
default:
return;
}
imagePaths = screenshotsContext.keys().map(screenshotsContext);
} catch (error) {
console.error(`Failed to load screenshots for plugin ${plugin.name}`);
// this is no longer an error. we don't need to require screenshots
}
plugin.screenshots = imagePaths.map((path) => path.default);
}
@ -148,7 +147,7 @@ class PluginModelClass {
// use dynamic import to attach the icon etc. ensure that the 'name' matches the dir the plugin is in
async loadPluginResources(plugin) {
this.attachScreenshots(plugin);
// attach other resources
// attach other resources, these show an error because all plugins should have an icon, readme, and meta
const handleImportError = (error, resourceType) =>
console.error(`Failed to load ${resourceType} for plugin ${plugin.name}`);
const iconPromise = import(`../plugins/${plugin.name}/icon.svg`)