From 75bfb58cd92d255ec876c119b84b979314fbb1fa Mon Sep 17 00:00:00 2001
From: Stephen Zhou <38493346+hyoban@users.noreply.github.com>
Date: Tue, 12 May 2026 09:15:07 +0800
Subject: [PATCH] tweaks
---
.../skills/how-to-write-component/SKILL.md | 5 +-
web/app/(commonLayout)/deployments/page.tsx | 4 +-
web/app/(commonLayout)/layout.tsx | 2 +-
.../header/__tests__/index.spec.tsx | 2 +-
web/app/components/header/index.tsx | 59 ++--
.../components/create-instance-modal.tsx | 230 +++++++++++--
.../deployments/components/deploy-drawer.tsx | 53 +--
.../components/deploy-drawer/form.tsx | 171 +++++++---
.../deployments/components/status-badge.tsx | 4 +-
web/features/deployments/data.ts | 10 +
.../detail/access-tab/channels-section.tsx | 157 ---------
.../access-tab/developer-api-section.tsx | 167 ----------
.../detail/access-tab/permissions-section.tsx | 58 ----
web/features/deployments/detail/common.tsx | 10 +
.../deployments/detail/deploy-tab.tsx | 81 ++++-
.../deployment-environment-list.tsx | 10 +-
.../detail/deploy-tab/deployment-panel.tsx | 4 +-
.../deploy-tab/deployment-status-summary.tsx | 9 +
.../deployments/detail/deployment-sidebar.tsx | 132 +++++---
web/features/deployments/detail/index.tsx | 38 +--
.../deployments/detail/overview-tab.tsx | 210 +++++++++---
.../deployments/detail/settings-tab.tsx | 301 +++++++++++-------
.../access}/api-keys.tsx | 2 +-
.../settings-tab/access/channels-section.tsx | 197 ++++++++++++
.../access}/common.tsx | 0
.../access/developer-api-section.tsx | 206 ++++++++++++
.../access/permissions-section.tsx | 77 +++++
.../access}/permissions.tsx | 105 +++---
.../access}/url.ts | 0
.../deployments/detail/versions-tab.tsx | 185 ++++++-----
.../versions-tab/deploy-release-menu.tsx | 5 +-
.../versions-tab/release-history-table.tsx | 172 ++++++++--
web/features/deployments/list/index.tsx | 160 ++++++++--
.../deployments/list/new-instance-card.tsx | 29 +-
web/features/deployments/nav/index.tsx | 76 +++--
web/features/deployments/runtime-status.ts | 18 +-
web/features/deployments/store.ts | 9 -
web/i18n/en-US/deployments.json | 5 +
web/i18n/zh-Hans/deployments.json | 5 +
39 files changed, 1933 insertions(+), 1035 deletions(-)
delete mode 100644 web/features/deployments/detail/access-tab/channels-section.tsx
delete mode 100644 web/features/deployments/detail/access-tab/developer-api-section.tsx
delete mode 100644 web/features/deployments/detail/access-tab/permissions-section.tsx
rename web/features/deployments/detail/{access-tab => settings-tab/access}/api-keys.tsx (98%)
create mode 100644 web/features/deployments/detail/settings-tab/access/channels-section.tsx
rename web/features/deployments/detail/{access-tab => settings-tab/access}/common.tsx (100%)
create mode 100644 web/features/deployments/detail/settings-tab/access/developer-api-section.tsx
create mode 100644 web/features/deployments/detail/settings-tab/access/permissions-section.tsx
rename web/features/deployments/detail/{access-tab => settings-tab/access}/permissions.tsx (86%)
rename web/features/deployments/detail/{access-tab => settings-tab/access}/url.ts (100%)
diff --git a/.agents/skills/how-to-write-component/SKILL.md b/.agents/skills/how-to-write-component/SKILL.md
index 0e897587cc..546f97611d 100644
--- a/.agents/skills/how-to-write-component/SKILL.md
+++ b/.agents/skills/how-to-write-component/SKILL.md
@@ -20,7 +20,8 @@ Use this as the decision guide for React/TypeScript component structure. Existin
- Put local state, queries, mutations, handlers, and derived UI data in the lowest component that uses them. Extract a purpose-built owner component only when the logic has no natural home.
- Repeated TanStack query calls in sibling components are acceptable when each component independently consumes the data. Do not hoist a query only because it is duplicated; TanStack Query handles deduplication and cache sharing.
- Hoist state, queries, or callbacks to a parent only when the parent consumes the data, coordinates shared loading/error/empty UI, needs one consistent snapshot, or owns a workflow spanning children.
-- Pass stable domain identity across boundaries; avoid forwarding derived presentation state when the receiver can derive it from its own data source. A component that owns a visual surface should also own loading, empty, and error states for data rendered inside it.
+- Pass stable domain identity across boundaries; avoid forwarding derived presentation state when the receiver can derive it from its own data source. A component that owns a visual surface should also own the data access, loading, empty, and error states for content rendered inside it unless a parent truly coordinates that state.
+- Loading states for visual surfaces should use skeleton placeholders scoped to the content that is actually loading, with shape, density, and dimensions close to the final UI. Avoid generic loading text or centered spinners for page sections, cards, lists, tables, forms, and drawers; reserve spinners for small inline busy indicators such as an in-progress status icon.
- Avoid prop drilling. One pass-through layer is acceptable; repeated forwarding means ownership should move down or into feature-scoped Jotai UI state. Keep server/cache state in query and API data flow.
- Keep callbacks in a parent only for workflow coordination such as form submission, shared selection, batch behavior, or navigation. Otherwise let the child or row own its action.
- Prefer uncontrolled DOM state and CSS variables before adding controlled props.
@@ -56,7 +57,7 @@ Use this as the decision guide for React/TypeScript component structure. Existin
- Separate hidden secondary surfaces from the trigger's main flow. For dialogs, dropdowns, popovers, and similar branches, extract a small local component that owns the trigger, open state, and hidden content when it would obscure the parent flow.
- Preserve composability by separating behavior ownership from layout ownership. A dropdown action may own its trigger, open state, and menu content; the caller owns placement such as slots, offsets, and alignment.
- Avoid unnecessary DOM hierarchy. Do not add wrapper elements unless they provide layout, semantics, accessibility, state ownership, or integration with a library API; prefer fragments or styling an existing element when possible.
-- Avoid shallow wrappers and prop renaming unless the wrapper adds validation, orchestration, error handling, state ownership, or a real semantic boundary.
+- Avoid shallow wrappers, layout-only render-prop wrappers, and prop renaming unless the wrapper adds validation, orchestration, error handling, state ownership, or a real semantic boundary.
## You Might Not Need An Effect
diff --git a/web/app/(commonLayout)/deployments/page.tsx b/web/app/(commonLayout)/deployments/page.tsx
index 1d085df265..753f0a1837 100644
--- a/web/app/(commonLayout)/deployments/page.tsx
+++ b/web/app/(commonLayout)/deployments/page.tsx
@@ -1,10 +1,10 @@
'use client'
import { useTranslation } from 'react-i18next'
-import { DeploymentsMain } from '@/features/deployments/list'
+import { DeploymentsList } from '@/features/deployments/list'
import useDocumentTitle from '@/hooks/use-document-title'
export default function DeploymentsPage() {
const { t } = useTranslation('deployments')
useDocumentTitle(t('documentTitle.list'))
- return
+ return
}
diff --git a/web/app/(commonLayout)/layout.tsx b/web/app/(commonLayout)/layout.tsx
index 699d2a4348..473fb45bda 100644
--- a/web/app/(commonLayout)/layout.tsx
+++ b/web/app/(commonLayout)/layout.tsx
@@ -5,7 +5,7 @@ import InSiteMessageNotification from '@/app/components/app/in-site-message/noti
import GA, { GaType } from '@/app/components/base/ga'
import Zendesk from '@/app/components/base/zendesk'
import { GotoAnything } from '@/app/components/goto-anything'
-import Header from '@/app/components/header'
+import { Header } from '@/app/components/header'
import HeaderWrapper from '@/app/components/header/header-wrapper'
import ReadmePanel from '@/app/components/plugins/readme-panel'
import { AppContextProvider } from '@/context/app-context-provider'
diff --git a/web/app/components/header/__tests__/index.spec.tsx b/web/app/components/header/__tests__/index.spec.tsx
index 0e9ef6493d..699e3c20e5 100644
--- a/web/app/components/header/__tests__/index.spec.tsx
+++ b/web/app/components/header/__tests__/index.spec.tsx
@@ -2,7 +2,7 @@ import type { ReactElement } from 'react'
import { fireEvent, screen } from '@testing-library/react'
import { vi } from 'vitest'
import { renderWithSystemFeatures } from '@/__tests__/utils/mock-system-features'
-import Header from '../index'
+import { Header } from '../index'
function createMockComponent(testId: string) {
return () =>