refactor: clean up unused imports and styles

- Remove unused `MessageTypeDef` imports in `ComposePanel` and
  `DynamicForm`
- Remove unused `schema` memo in `DynamicForm`
- Update `FieldInput` label class to use `shrink-0` instead of
  `flex-shrink-0`
- Exclude test files from `tsconfig.cli.json`
This commit is contained in:
hypercross 2026-07-13 13:32:49 +08:00
parent ffa023b92a
commit c4038a5213
3 changed files with 2 additions and 7 deletions

View File

@ -5,7 +5,6 @@
import { Component, createSignal, For, Show, createMemo } from "solid-js"; import { Component, createSignal, For, Show, createMemo } from "solid-js";
import { registeredTypes, canEmit } from "./registry"; import { registeredTypes, canEmit } from "./registry";
import { sendMessage, useJournalStream } from "../stores/journalStream"; import { sendMessage, useJournalStream } from "../stores/journalStream";
import type { MessageTypeDef } from "./registry";
import { DynamicForm } from "./DynamicForm"; import { DynamicForm } from "./DynamicForm";
export const ComposePanel: Component = () => { export const ComposePanel: Component = () => {

View File

@ -9,7 +9,6 @@
import { Component, For, Show, createMemo } from "solid-js"; import { Component, For, Show, createMemo } from "solid-js";
import { z } from "zod"; import { z } from "zod";
import { getMessageType } from "./registry"; import { getMessageType } from "./registry";
import type { MessageTypeDef } from "./registry";
type FormData = Record<string, unknown>; type FormData = Record<string, unknown>;
@ -22,9 +21,6 @@ interface DynamicFormProps {
export const DynamicForm: Component<DynamicFormProps> = (props) => { export const DynamicForm: Component<DynamicFormProps> = (props) => {
const def = createMemo(() => getMessageType(props.type)); const def = createMemo(() => getMessageType(props.type));
// Generate default on type change
const schema = createMemo(() => def()?.schema);
return ( return (
<div class="space-y-1.5"> <div class="space-y-1.5">
<Show when={def()}> <Show when={def()}>
@ -136,7 +132,7 @@ const FieldInput: Component<{
return ( return (
<div class="flex items-center gap-1"> <div class="flex items-center gap-1">
<label <label
class="text-xs text-gray-500 w-20 flex-shrink-0 truncate" class="text-xs text-gray-500 w-20 shrink-0 truncate"
title={props.label} title={props.label}
> >
{props.label} {props.label}

View File

@ -16,5 +16,5 @@
"lib": ["ES2022", "DOM", "DOM.Iterable"], "lib": ["ES2022", "DOM", "DOM.Iterable"],
}, },
"include": ["src/cli/**/*"], "include": ["src/cli/**/*"],
"exclude": ["node_modules", "dist"], "exclude": ["node_modules", "dist", "src/**/*.test.ts"],
} }