mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-17 21:10:54 +00:00
[codex] Polish sidebar status, agent skills, and chat rendering (#45451)
* style: update chat layout and spacing for improved UI consistency - Adjusted margin and padding for .chat-thread and .content--chat to enhance layout. - Consolidated CSS selectors for better readability and maintainability. - Introduced new test for log parsing functionality to ensure accurate message extraction. * UI: polish agent skills, chat images, and sidebar status * test: stabilize vitest helper export types * UI: address review feedback on agents refresh and chat styles * test: update outbound gateway client fixture values * test: narrow shared ip fixtures to IPv4
This commit is contained in:
@@ -46,6 +46,7 @@ describe("runServiceRestart token drift", () => {
|
||||
});
|
||||
resetLifecycleServiceMocks();
|
||||
service.readCommand.mockResolvedValue({
|
||||
programArguments: [],
|
||||
environment: { OPENCLAW_GATEWAY_TOKEN: "service-token" },
|
||||
});
|
||||
stubEmptyGatewayEnv();
|
||||
@@ -77,6 +78,7 @@ describe("runServiceRestart token drift", () => {
|
||||
},
|
||||
});
|
||||
service.readCommand.mockResolvedValue({
|
||||
programArguments: [],
|
||||
environment: { OPENCLAW_GATEWAY_TOKEN: "env-token" },
|
||||
});
|
||||
vi.stubEnv("OPENCLAW_GATEWAY_TOKEN", "env-token");
|
||||
|
||||
@@ -1,16 +1,36 @@
|
||||
import { vi } from "vitest";
|
||||
import type { GatewayService } from "../../../daemon/service.js";
|
||||
import type { RuntimeEnv } from "../../../runtime.js";
|
||||
import type { MockFn } from "../../../test-utils/vitest-mock-fn.js";
|
||||
|
||||
export const runtimeLogs: string[] = [];
|
||||
|
||||
export const defaultRuntime = {
|
||||
log: (message: string) => runtimeLogs.push(message),
|
||||
error: vi.fn(),
|
||||
exit: (code: number) => {
|
||||
throw new Error(`__exit__:${code}`);
|
||||
},
|
||||
type LifecycleRuntimeHarness = RuntimeEnv & {
|
||||
error: MockFn<RuntimeEnv["error"]>;
|
||||
exit: MockFn<RuntimeEnv["exit"]>;
|
||||
};
|
||||
|
||||
export const service = {
|
||||
type LifecycleServiceHarness = GatewayService & {
|
||||
install: MockFn<GatewayService["install"]>;
|
||||
uninstall: MockFn<GatewayService["uninstall"]>;
|
||||
stop: MockFn<GatewayService["stop"]>;
|
||||
isLoaded: MockFn<GatewayService["isLoaded"]>;
|
||||
readCommand: MockFn<GatewayService["readCommand"]>;
|
||||
readRuntime: MockFn<GatewayService["readRuntime"]>;
|
||||
restart: MockFn<GatewayService["restart"]>;
|
||||
};
|
||||
|
||||
export const defaultRuntime: LifecycleRuntimeHarness = {
|
||||
log: (...args: unknown[]) => {
|
||||
runtimeLogs.push(args.map((arg) => String(arg)).join(" "));
|
||||
},
|
||||
error: vi.fn(),
|
||||
exit: vi.fn((code: number) => {
|
||||
throw new Error(`__exit__:${code}`);
|
||||
}),
|
||||
};
|
||||
|
||||
export const service: LifecycleServiceHarness = {
|
||||
label: "TestService",
|
||||
loadedText: "loaded",
|
||||
notLoadedText: "not loaded",
|
||||
@@ -32,7 +52,7 @@ export function resetLifecycleServiceMocks() {
|
||||
service.readCommand.mockClear();
|
||||
service.restart.mockClear();
|
||||
service.isLoaded.mockResolvedValue(true);
|
||||
service.readCommand.mockResolvedValue({ environment: {} });
|
||||
service.readCommand.mockResolvedValue({ programArguments: [], environment: {} });
|
||||
service.restart.mockResolvedValue({ outcome: "completed" });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user