Skip to content

Commit 55531d0

Browse files
committed
chore: misc updates across renderer, supervisor, and website
- refactor(renderer): simplify ThreadComposerSection - test(supervisor): update runtime and prompt runner tests - chore(website): add vercel.json and tweak layout/page
1 parent 2ded6cb commit 55531d0

13 files changed

Lines changed: 154 additions & 110 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"description": "The universal desktop orchestrator for AI agents. Run terminal-native and structured chat agents side-by-side.",
66
"license": "Apache-2.0",
77
"author": "SDSLeon",
8+
"homepage": "https://www.lightcodeapp.com/",
89
"repository": {
910
"type": "git",
1011
"url": "https://github.com/SDSLeon/lightcode"

src/renderer/components/thread/ThreadComposerSection.tsx

Lines changed: 58 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -809,67 +809,64 @@ function ThreadComposerSectionInner(props: ThreadComposerSectionProps & { thread
809809
? () => undefined
810810
: undefined
811811
}
812-
{...(() => {
813-
const renderExtras = (level: number) => (
814-
<>
815-
{showContextIndicator ? (
816-
<ThreadContextIndicator
817-
summary={contextSummary}
818-
isOpen={contextDockOpen}
819-
onToggle={() => setContextDockOpen((open) => !open)}
820-
/>
821-
) : null}
822-
<Button
823-
isIconOnly
824-
aria-label="Attach files"
825-
className="lightcode-composer-menu min-w-9 px-2"
826-
size="sm"
827-
variant="ghost"
828-
onPress={() => {
829-
void readBridge()
830-
.pickFiles()
831-
.then((paths) => {
832-
if (paths) attachments.addFiles(paths);
833-
});
834-
}}
835-
>
836-
<Paperclip className="size-4" />
837-
</Button>
838-
{branchName ? (
839-
thread.worktreePath ? (
840-
<Tooltip delay={0}>
841-
<Tooltip.Trigger tabIndex={-1} role="none">
842-
<div className="lightcode-composer-static min-w-0 max-w-48 px-2.5">
843-
<GitFork className="size-3.5 text-muted" />
844-
{level < 3 && <span className="truncate">{branchName}</span>}
845-
{level < 3 && thread.prNumber ? (
846-
<span className="shrink-0 text-muted/60">
847-
PR #{thread.prNumber}
848-
</span>
849-
) : null}
850-
</div>
851-
</Tooltip.Trigger>
852-
<Tooltip.Content placement="top">{branchName}</Tooltip.Content>
853-
</Tooltip>
854-
) : (
855-
<BranchSelector
856-
projectId={thread.projectId}
857-
currentBranch={branchName}
858-
value={branchName}
859-
onSelect={handleBranchSelect}
860-
onSwitchBranch={handleSwitchBranch}
861-
hideWorktreeToggle
862-
forceHideLabel={level >= 3}
863-
iconOnly={level >= 3}
864-
/>
865-
)
866-
) : null}
867-
</>
868-
);
869-
return isCliThread
870-
? { leadingControls: renderExtras }
871-
: { afterControls: renderExtras };
872-
})()}
812+
leadingControls={
813+
<>
814+
{showContextIndicator ? (
815+
<ThreadContextIndicator
816+
summary={contextSummary}
817+
isOpen={contextDockOpen}
818+
onToggle={() => setContextDockOpen((open) => !open)}
819+
/>
820+
) : null}
821+
<Button
822+
isIconOnly
823+
aria-label="Attach files"
824+
className="lightcode-composer-menu min-w-9 px-2"
825+
size="sm"
826+
variant="ghost"
827+
onPress={() => {
828+
void readBridge()
829+
.pickFiles()
830+
.then((paths) => {
831+
if (paths) attachments.addFiles(paths);
832+
});
833+
}}
834+
>
835+
<Paperclip className="size-4" />
836+
</Button>
837+
</>
838+
}
839+
afterControls={(level: number) =>
840+
branchName ? (
841+
thread.worktreePath ? (
842+
<Tooltip delay={0}>
843+
<Tooltip.Trigger tabIndex={-1} role="none">
844+
<div className="lightcode-composer-static min-w-0 max-w-48 px-2.5">
845+
<GitFork className="size-3.5 text-muted" />
846+
{level < 3 && <span className="truncate">{branchName}</span>}
847+
{level < 3 && thread.prNumber ? (
848+
<span className="shrink-0 text-muted/60">
849+
PR #{thread.prNumber}
850+
</span>
851+
) : null}
852+
</div>
853+
</Tooltip.Trigger>
854+
<Tooltip.Content placement="top">{branchName}</Tooltip.Content>
855+
</Tooltip>
856+
) : (
857+
<BranchSelector
858+
projectId={thread.projectId}
859+
currentBranch={branchName}
860+
value={branchName}
861+
onSelect={handleBranchSelect}
862+
onSwitchBranch={handleSwitchBranch}
863+
hideWorktreeToggle
864+
forceHideLabel={level >= 3}
865+
iconOnly={level >= 3}
866+
/>
867+
)
868+
) : null
869+
}
873870
onPromptChange={setPrompt}
874871
onSubmit={() => {
875872
const segments = mentionRef.current?.serializeSegments();

src/renderer/views/MainView/parts/RightPanel/parts/DevTerminalPanel/parts/BottomTerminalLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export function BottomTerminalLayout(props: {
132132
</div>
133133
</div>
134134

135-
<div className="relative min-h-0 min-w-0 flex-1 px-2">
135+
<div className="relative min-h-0 min-w-0 flex-1 px-2 pt-2">
136136
<TerminalSurfaces
137137
tabs={tabs}
138138
selectedTabId={selectedTabId}

src/renderer/views/SettingsOverlay/parts/AboutSettings.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { formatBytes } from "@/shared/formatBytes";
77
import appIconUrl from "../../../../../build/icon.png";
88

99
const GITHUB_REPO = "https://github.com/nicepkg/lightcode";
10+
const WEBSITE_URL = "https://www.lightcodeapp.com/";
1011

1112
function AboutLink(props: { href: string; children: React.ReactNode }) {
1213
return (
@@ -124,6 +125,8 @@ export function AboutSettings() {
124125
</div>
125126

126127
<div className="mt-8 space-y-3 border-t border-white/6 pt-6">
128+
<AboutLink href={WEBSITE_URL}>Website</AboutLink>
129+
<br />
127130
<AboutLink href={GITHUB_REPO}>GitHub Repository</AboutLink>
128131
<br />
129132
<AboutLink href={`${GITHUB_REPO}/releases`}>Changelog</AboutLink>

src/supervisor/commitMessageGenerator.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,5 +495,4 @@ describe("generateCommitMessage", () => {
495495
await expect(pending).rejects.toThrow("spawn ENOENT");
496496
expect(spawnMock).toHaveBeenCalledTimes(1);
497497
});
498-
499498
});

src/supervisor/oneShotPromptRunner.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ const buildAgentCommandMock = vi.hoisted(() =>
1717
vi.mock("node:child_process", () => ({ spawn: spawnMock }));
1818
vi.mock("./agents/base", () => ({ buildAgentCommand: buildAgentCommandMock }));
1919

20-
import { isArgvLikelyTooLong, isArgvTooLongError, runOneShotPromptWithFallback } from "./oneShotPromptRunner";
20+
import {
21+
isArgvLikelyTooLong,
22+
isArgvTooLongError,
23+
runOneShotPromptWithFallback,
24+
} from "./oneShotPromptRunner";
2125

2226
type MockChildProcess = EventEmitter & {
2327
stdout: EventEmitter;

src/supervisor/prSummaryGenerator.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,7 @@ describe("generatePrSummary", () => {
213213
].join("\n"),
214214
);
215215

216-
const pending = generatePrSummary(
217-
windowsProject,
218-
createAdapter(),
219-
"feature/SIT-123-x",
220-
"main",
221-
);
216+
const pending = generatePrSummary(windowsProject, createAdapter(), "feature/SIT-123-x", "main");
222217
await flushPromises();
223218

224219
first.emit("error", Object.assign(new Error("spawn ENAMETOOLONG"), { code: "ENAMETOOLONG" }));

src/supervisor/prSummaryGenerator.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@ export async function generatePrSummary(
134134
buildPrompt: () => {
135135
let prompt = PROMPT + branchHeader + logSection;
136136
if (files.length > 0) {
137-
prompt +=
138-
"\n\n" + buildDiffPromptContext({ diff: "", files, sourceLabel });
137+
prompt += "\n\n" + buildDiffPromptContext({ diff: "", files, sourceLabel });
139138
}
140139
return prompt;
141140
},

0 commit comments

Comments
 (0)