docs(AddAgentModal): add comment explaining modal button pattern

Add explanatory comment for combining Button and Modal components in Hero UI pattern to clarify focus management requirements
This commit is contained in:
icarus 2025-09-14 04:44:53 +08:00
parent 1e919a908f
commit ba41d8021f

View File

@ -220,6 +220,9 @@ export const AddAgentModal: React.FC = () => {
return (
<ErrorBoundary>
{/* NOTE: Hero UI Modal Pattern: Combine the Button and Modal components into a single
encapsulated component. This is because the Modal component needs to bind the onOpen
event handler to the Button for proper focus management. */}
<Button onPress={onOpen} className="justify-start bg-transparent text-foreground-500 hover:bg-accent">
<Plus size={16} style={{ marginRight: 4, flexShrink: 0 }} />
{t('agent.add.title')}