Skip to content

Commit 5ba63cd

Browse files
authored
Merge pull request continuedev#4868 from continuedev/pe/code-to-edit-fix
feat: improve styling on code to edit
2 parents 5868fb8 + 47fbe4f commit 5ba63cd

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

extensions/vscode/package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gui/src/components/CodeToEditCard/AddFileButton.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ export default function AddFileButton({ onClick }: AddFileButtonProps) {
3939
className="bg-vsc-editor-background m-0 rounded-md p-0"
4040
>
4141
<div
42-
className="flex h-5 w-14 items-center justify-center gap-1 hover:brightness-125"
42+
className="flex h-5 items-center justify-center gap-1 hover:brightness-125"
4343
onClick={(e) => {
4444
e.preventDefault();
4545
e.stopPropagation();
4646
onClick();
4747
}}
4848
>
49-
<PlusIcon className="text-vsc-foreground inline h-2.5 w-2.5 brightness-75" />
50-
<span className="text-vsc-foreground text-[10px] brightness-75">
49+
<PlusIcon className="text-vsc-foreground inline h-2.5 w-2.5 px-1 brightness-75" />
50+
<span className="text-vsc-foreground xs:block hidden text-[10px] brightness-75">
5151
Add file
5252
</span>
5353
</div>

gui/src/components/CodeToEditCard/CodeToEditCard.tsx

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1+
import { PlusIcon, XMarkIcon } from "@heroicons/react/24/outline";
2+
import type { CodeToEdit } from "core";
13
import { useContext, useState } from "react";
24
import { useDispatch } from "react-redux";
35
import { IdeMessengerContext } from "../../context/IdeMessenger";
4-
import CodeToEditListItem from "./CodeToEditListItem";
5-
import type { CodeToEdit } from "core";
6-
import AddFileButton from "./AddFileButton";
7-
import AddFileCombobox from "./AddFileCombobox";
8-
import { PlusIcon, XMarkIcon } from "@heroicons/react/24/outline";
96
import { useAppSelector } from "../../redux/hooks";
107
import {
118
addCodeToEdit,
129
removeCodeToEdit,
1310
} from "../../redux/slices/sessionSlice";
11+
import AddFileButton from "./AddFileButton";
12+
import AddFileCombobox from "./AddFileCombobox";
13+
import CodeToEditListItem from "./CodeToEditListItem";
1414

1515
export default function CodeToEditCard() {
1616
const dispatch = useDispatch();
1717
const ideMessenger = useContext(IdeMessengerContext);
1818
const [showAddFileCombobox, setShowAddFileCombobox] = useState(false);
1919
const codeToEdit = useAppSelector((state) => state.session.codeToEdit);
2020

21-
const title =
21+
const itemCount =
2222
codeToEdit.length === 0
23-
? "Code to edit"
23+
? ""
2424
: codeToEdit.length === 1
25-
? "Code to edit (1 item)"
26-
: `Code to edit (${codeToEdit.length} items)`;
25+
? "(1 item)"
26+
: `(${codeToEdit.length} items)`;
2727

2828
function onDelete(rif: CodeToEdit) {
2929
dispatch(removeCodeToEdit(rif));
@@ -57,7 +57,11 @@ export default function CodeToEditCard() {
5757
return (
5858
<div className="bg-vsc-editor-background mx-3 flex flex-col rounded-t-lg p-1">
5959
<div className="text-lightgray flex items-center justify-between gap-1.5 py-1.5 pl-3 pr-2 text-xs">
60-
<span>{title}</span>
60+
<div className="flex items-center gap-1">
61+
<span>Code to edit</span>
62+
<span className="hidden sm:inline">{itemCount}</span>
63+
</div>
64+
6165
<AddFileButton onClick={() => setShowAddFileCombobox(true)} />
6266
</div>
6367

0 commit comments

Comments
 (0)