refactor(web): sweep AGENTS.md TypeScript + Mantine rule violations (#1771)
Codebase-wide sweep bringing the web client into strict compliance with the AGENTS.md TypeScript and Mantine/React conventions: ~170 inline 2+-static-prop elements extracted to named .withProps() constants across ~77 files, the AGENTS.md rule wording tightened to match (static-prop boundary + Accordion/Transition/data-*/Box exemptions), a real ScreenStage Box->Flex layout regression fixed (direction: column) with a Storybook regression guard, and an App.tsx double-cast tightened. Closes #1762.
This commit is contained in:
parent
8aba3122c5
commit
da37692485
1 changed files with 1567 additions and 991 deletions
|
|
@ -107,10 +107,13 @@ const SidebarCard = Card.withProps({
|
|||
// `variant="preview"` (overflow: hidden) keeps the full-height card from
|
||||
// bleeding past the viewport: the running app's iframe fills it, and the
|
||||
// app-input form scrolls internally (see AppDetailPanel's PanelScroll).
|
||||
// `flex: 1` + `h: "100%"` make it fill the screen column (both call sites do).
|
||||
const ContentCard = Card.withProps({
|
||||
withBorder: true,
|
||||
padding: "lg",
|
||||
variant: "preview",
|
||||
flex: 1,
|
||||
h: "100%",
|
||||
});
|
||||
|
||||
const EmptyState = Text.withProps({
|
||||
|
|
@ -152,6 +155,17 @@ const HeaderActions = Group.withProps({
|
|||
wrap: "nowrap",
|
||||
});
|
||||
|
||||
const BackToInputButton = Button.withProps({
|
||||
variant: "subtle",
|
||||
size: "sm",
|
||||
leftSection: <MdArrowBack aria-hidden size={16} />,
|
||||
});
|
||||
|
||||
const CloseIconButton = ActionIcon.withProps({
|
||||
variant: "subtle",
|
||||
"aria-label": "Close",
|
||||
});
|
||||
|
||||
// The host-controlled box the running app sits within. Its size is driven by
|
||||
// the host's layout (window resize, sidebar toggle, maximize) and NOT by the
|
||||
// view's reported content height — that drives the inner RendererFrame — so the
|
||||
|
|
@ -552,7 +566,7 @@ export function AppsScreen({
|
|||
if (!sandboxPath) {
|
||||
return (
|
||||
<ScreenLayout>
|
||||
<ContentCard flex={1} h="100%">
|
||||
<ContentCard>
|
||||
<EmptyState>
|
||||
MCP Apps are unavailable — the sandbox could not be reached.
|
||||
</EmptyState>
|
||||
|
|
@ -589,8 +603,6 @@ export function AppsScreen({
|
|||
)}
|
||||
|
||||
<ContentCard
|
||||
flex={1}
|
||||
h="100%"
|
||||
data-testid="apps-form"
|
||||
data-app-status={running ? appStatus : "idle"}
|
||||
data-app-error={running ? appError?.message : undefined}
|
||||
|
|
@ -608,14 +620,9 @@ export function AppsScreen({
|
|||
</HeaderLabel>
|
||||
<HeaderActions>
|
||||
{running && selectedHasFields && (
|
||||
<Button
|
||||
variant="subtle"
|
||||
size="sm"
|
||||
leftSection={<MdArrowBack aria-hidden size={16} />}
|
||||
onClick={handleBackToInput}
|
||||
>
|
||||
<BackToInputButton onClick={handleBackToInput}>
|
||||
Back to Input
|
||||
</Button>
|
||||
</BackToInputButton>
|
||||
)}
|
||||
{running && (
|
||||
<Tooltip label={maximized ? "Restore" : "Maximize"}>
|
||||
|
|
@ -633,13 +640,9 @@ export function AppsScreen({
|
|||
</Tooltip>
|
||||
)}
|
||||
<Tooltip label="Close">
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
onClick={handleClose}
|
||||
aria-label="Close"
|
||||
>
|
||||
<CloseIconButton onClick={handleClose}>
|
||||
<MdClose aria-hidden size={20} />
|
||||
</ActionIcon>
|
||||
</CloseIconButton>
|
||||
</Tooltip>
|
||||
</HeaderActions>
|
||||
</HeaderRow>
|
||||
|
|
|
|||
Loading…
Reference in a new issue