From 7c545e9fa720377b3d723edaf641b5544b0961d1 Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Sat, 25 Jul 2026 09:09:22 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20docstrings=20to=20`arena/0?= =?UTF-8?q?19f987a-smartshit`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docstrings generation was requested by @Ocean82. * https://github.com/Ocean82/smartshit/pull/13#issuecomment-5077825911 The following files were modified: * `src/components/ChatPanel.tsx` * `src/components/panels/DockPanel.tsx` * `src/components/panels/panelTypes.tsx` --- src/components/ChatPanel.tsx | 8 ++++++++ src/components/panels/DockPanel.tsx | 8 ++++++++ src/components/panels/panelTypes.tsx | 6 ++++++ 3 files changed, 22 insertions(+) diff --git a/src/components/ChatPanel.tsx b/src/components/ChatPanel.tsx index 86b6349..4f7fb77 100644 --- a/src/components/ChatPanel.tsx +++ b/src/components/ChatPanel.tsx @@ -22,6 +22,14 @@ function healthFooterMessage(health: ServerHealth | null): string { return 'Instant analysis active ยท Skills work without AI' } +/** + * Renders the assistant chat panel with messaging, spreadsheet actions, attachments, feedback, and usage controls. + * + * @param isMobileOpen - Whether the standalone panel is open on mobile. + * @param onCloseMobile - Callback invoked when the mobile panel is closed. + * @param embedded - Whether to render the panel without standalone header and visibility controls. + * @returns The assistant chat panel. + */ export function ChatPanel({ isMobileOpen, onCloseMobile, embedded }: { isMobileOpen?: boolean; onCloseMobile?: () => void; embedded?: boolean }) { const { messages, diff --git a/src/components/panels/DockPanel.tsx b/src/components/panels/DockPanel.tsx index aa16535..b21adc8 100644 --- a/src/components/panels/DockPanel.tsx +++ b/src/components/panels/DockPanel.tsx @@ -17,6 +17,14 @@ interface DockPanelProps { headerActions?: React.ReactNode } +/** + * Renders an active dock panel with resizable content and header controls. + * + * @param panelId - Identifier of the panel to render and resize + * @param title - Optional title displayed in the panel header + * @param headerActions - Optional controls displayed before the close button + * @returns The dock panel when active, or `null` otherwise + */ export function DockPanel({ panelId, children, title, headerActions }: DockPanelProps) { const activePanel = useStore((s) => s.activePanel) const setActivePanel = useStore((s) => s.setActivePanel) diff --git a/src/components/panels/panelTypes.tsx b/src/components/panels/panelTypes.tsx index ab81cad..4f29ea0 100644 --- a/src/components/panels/panelTypes.tsx +++ b/src/components/panels/panelTypes.tsx @@ -24,6 +24,12 @@ export const PANELS: PanelDef[] = [ { id: 'inspector', icon: , label: 'Inspector', defaultWidth: 300, minWidth: 260, maxWidth: 440 }, ] +/** + * Retrieves the definition for a panel identifier. + * + * @param id - The identifier of the panel to retrieve + * @returns The matching panel definition + */ export function getPanelDef(id: PanelId): PanelDef { return PANELS.find((p) => p.id === id)! }