Skip to content

Commit af9b80f

Browse files
committed
toolbar styling
1 parent 2780b58 commit af9b80f

File tree

3 files changed

+25
-27
lines changed

3 files changed

+25
-27
lines changed

gui/src/components/FileIcon.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default function FileIcon({ filename, height, width }: FileIconProps) {
4545
height: height,
4646
fill: color,
4747
flexShrink: 0,
48-
display: "block",
48+
display: "flex",
4949
}}
5050
/>
5151
);

gui/src/components/markdown/StepContainerPreToolbar/FileInfo.tsx

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import FileIcon from "../../FileIcon";
1+
import { inferResolvedUriFromRelativePath } from "core/util/ideUtils";
2+
import { getLastNPathParts } from "core/util/uri";
23
import { useContext } from "react";
34
import { IdeMessengerContext } from "../../../context/IdeMessenger";
4-
import { getLastNPathParts, getUriPathBasename } from "core/util/uri";
5-
import { inferResolvedUriFromRelativePath } from "core/util/ideUtils";
5+
import FileIcon from "../../FileIcon";
66

77
export interface FileInfoProps {
88
relativeFilepath: string;
@@ -23,17 +23,18 @@ const FileInfo = ({ relativeFilepath, range }: FileInfoProps) => {
2323
}
2424

2525
return (
26-
<div className="flex w-full min-w-0 items-center">
27-
<div
28-
className="mr-0.5 flex w-full min-w-0 cursor-pointer items-center gap-0.5"
29-
onClick={onClickFileName}
30-
>
26+
<div
27+
className="flex cursor-pointer flex-row items-center gap-0.5"
28+
onClick={onClickFileName}
29+
>
30+
<div>
3131
<FileIcon height="20px" width="20px" filename={relativeFilepath} />
32-
<span className="w-full truncate hover:underline">
33-
{getLastNPathParts(relativeFilepath, 1)}
34-
{range && ` ${range}`}
35-
</span>
3632
</div>
33+
<span className="line-clamp-1 break-all hover:underline">
34+
asdfasdfasdfasdfasdfasdfasdf
35+
{getLastNPathParts(relativeFilepath, 1)}
36+
{range && ` ${range}`}
37+
</span>
3738
</div>
3839
);
3940
};

gui/src/components/markdown/StepContainerPreToolbar/StepContainerPreToolbar.tsx

+11-14
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import GeneratingCodeLoader from "./GeneratingCodeLoader";
2525
import RunInTerminalButton from "./RunInTerminalButton";
2626

2727
const TopDiv = styled.div`
28+
display: flex;
29+
flex-direction: column;
2830
outline: 1px solid ${vscCommandCenterInactiveBorder};
2931
outline-offset: -0.5px;
3032
border-radius: ${defaultBorderRadius};
@@ -37,7 +39,6 @@ const ToolbarDiv = styled.div<{ isExpanded: boolean }>`
3739
display: flex;
3840
justify-content: space-between;
3941
align-items: center;
40-
background: inherit;
4142
font-size: ${getFontSize() - 2}px;
4243
padding: 4px 6px;
4344
margin: 0;
@@ -181,31 +182,27 @@ export default function StepContainerPreToolbar(
181182

182183
return (
183184
<TopDiv>
184-
<ToolbarDiv isExpanded={isExpanded} className="find-widget-skip">
185-
<div className="flex min-w-0 max-w-[45%] items-center">
185+
<ToolbarDiv isExpanded={isExpanded} className="find-widget-skip gap-3">
186+
<div className="flex max-w-72 flex-row items-center">
186187
<ChevronDownIcon
187188
onClick={onClickExpand}
188-
className={`h-3.5 w-3.5 shrink-0 cursor-pointer text-gray-400 hover:brightness-125 ${
189+
className={`h-3.5 w-3.5 flex-shrink-0 cursor-pointer text-gray-400 hover:brightness-125 ${
189190
isExpanded ? "rotate-0" : "-rotate-90"
190191
}`}
191192
/>
192-
<div className="w-full min-w-0">
193-
<FileInfo
194-
relativeFilepath={props.relativeFilepath}
195-
range={props.range}
196-
/>
197-
</div>
193+
<FileInfo
194+
relativeFilepath={props.relativeFilepath}
195+
range={props.range}
196+
/>
198197
</div>
199198

200199
<div className="flex items-center gap-3 max-sm:gap-1.5">
201-
{isGeneratingCodeBlock && (
200+
{isGeneratingCodeBlock ? (
202201
<GeneratingCodeLoader
203202
showLineCount={!isExpanded}
204203
codeBlockContent={codeBlockContent}
205204
/>
206-
)}
207-
208-
{!isGeneratingCodeBlock && (
205+
) : (
209206
<>
210207
<CopyButton text={props.codeBlockContent} />
211208
{isTerminalCodeBlock(props.language, props.codeBlockContent) ? (

0 commit comments

Comments
 (0)