diff --git a/src/components/AppDialog.tsx b/src/components/AppDialog.tsx index c43ce499..2e4c646f 100644 --- a/src/components/AppDialog.tsx +++ b/src/components/AppDialog.tsx @@ -14,6 +14,7 @@ import { Label } from '@/components/ui/label'; import { Skeleton } from '@/components/ui/skeleton'; import { Badge } from '@/components/ui/badge'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; +import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar'; import { useToast } from '@/hooks/useToast'; import { useFS } from '@/hooks/useFS'; @@ -648,211 +649,182 @@ export function AppDialog({ projectId, open, onOpenChange }: AppDialogProps) { -
+
{/* Hint to use AI */}
Not sure? Ask Shakespeare to update your app.
- {/* Identifier (d-tag) */} -
- - updateField('dTag', e.target.value)} - placeholder="my-app" - disabled={isSaving || hasApp} - /> -

- {hasApp ? 'Cannot be changed after publishing.' : 'Unique identifier for this app. Defaults to the project ID.'} -

-
+ + + General + Handlers + Tags + - {/* ngit Repository */} -
- - updateField('ngitRepo', e.target.value)} - placeholder="naddr1..." - disabled={isSaving} - className={formData.ngitRepo && !naddrToATag(formData.ngitRepo) ? 'border-destructive focus-visible:ring-destructive' : ''} - /> - {formData.ngitRepo && !naddrToATag(formData.ngitRepo) && ( -

Invalid naddr

- )} -

naddr of the ngit repository (kind 30617). Auto-detected from git remote if left blank.

-
- - {/* nsite Deployment */} -
- - updateField('nsiteDeployment', e.target.value)} - placeholder="naddr1..." - disabled={isSaving} - className={formData.nsiteDeployment && !naddrToATag(formData.nsiteDeployment) ? 'border-destructive focus-visible:ring-destructive' : ''} - /> - {formData.nsiteDeployment && !naddrToATag(formData.nsiteDeployment) && ( -

Invalid naddr

- )} -

naddr of the nsite deployment (kind 35128). Auto-detected from .nsite/config.json if left blank.

-
- - {/* Tags */} -
- - {formData.tTags.length > 0 && ( -
- {formData.tTags.map(tag => ( - - {tag} - - - ))} -
- )} -
- setNewTag(e.target.value)} - placeholder="e.g. productivity" - disabled={isSaving} - onKeyDown={e => { - if (e.key === 'Enter') { e.preventDefault(); addTag(); } - }} - className="flex-1" - /> - -
-
- - {/* Supported Kinds */} -
- - {formData.supportedKinds.length > 0 && ( -
- {formData.supportedKinds.map(kind => ( - - {kind} - - - ))} -
- )} -
- setNewKind(e.target.value)} - placeholder="Kind number (e.g. 1)" - disabled={isSaving} - onKeyDown={e => { - if (e.key === 'Enter') { - e.preventDefault(); - addKind(); - } - }} - className="flex-1" - /> - -
-
- - {/* Web Handlers */} -
- - {formData.webHandlers.length > 0 && ( + {/* General tab: Identifier, Git Repo, nsite */} +
- {formData.webHandlers.map((handler, index) => ( -
- - {handler.url} - {handler.type && ( - {handler.type} - )} - -
- ))} + + updateField('dTag', e.target.value)} + placeholder="my-app" + disabled={isSaving || hasApp} + /> +

+ {hasApp ? 'Cannot be changed after publishing.' : 'Unique identifier for this app. Defaults to the project ID.'} +

- )} -
- setNewHandlerUrl(e.target.value)} - placeholder="https://app.example.com/e/" - disabled={isSaving} - className="flex-1" - /> - - -
-

- URL patterns where {''} will be replaced with the NIP-19 entity. -

-
+ +
+ + updateField('ngitRepo', e.target.value)} + placeholder="naddr1..." + disabled={isSaving} + className={formData.ngitRepo && !naddrToATag(formData.ngitRepo) ? 'border-destructive focus-visible:ring-destructive' : ''} + /> + {formData.ngitRepo && !naddrToATag(formData.ngitRepo) && ( +

Invalid naddr

+ )} +

naddr of the ngit repository (kind 30617). Auto-detected from git remote if left blank.

+
+ +
+ + updateField('nsiteDeployment', e.target.value)} + placeholder="naddr1..." + disabled={isSaving} + className={formData.nsiteDeployment && !naddrToATag(formData.nsiteDeployment) ? 'border-destructive focus-visible:ring-destructive' : ''} + /> + {formData.nsiteDeployment && !naddrToATag(formData.nsiteDeployment) && ( +

Invalid naddr

+ )} +

naddr of the nsite deployment (kind 35128). Auto-detected from .nsite/config.json if left blank.

+
+ + + {/* Handlers tab: Supported Kinds, Web Handlers */} + +
+ + {formData.supportedKinds.length > 0 && ( +
+ {formData.supportedKinds.map(kind => ( + + {kind} + + + ))} +
+ )} +
+ setNewKind(e.target.value)} + placeholder="Kind number (e.g. 1)" + disabled={isSaving} + onKeyDown={e => { if (e.key === 'Enter') { e.preventDefault(); addKind(); } }} + className="flex-1" + /> + +
+
+ +
+ + {formData.webHandlers.length > 0 && ( +
+ {formData.webHandlers.map((handler, index) => ( +
+ + {handler.url} + {handler.type && ( + {handler.type} + )} + +
+ ))} +
+ )} +
+ setNewHandlerUrl(e.target.value)} + placeholder="https://app.example.com/e/" + disabled={isSaving} + className="flex-1" + /> + + +
+

+ URL patterns where {''} will be replaced with the NIP-19 entity. +

+
+
+ + {/* Tags tab */} + +
+ + {formData.tTags.length > 0 && ( +
+ {formData.tTags.map(tag => ( + + {tag} + + + ))} +
+ )} +
+ setNewTag(e.target.value)} + placeholder="e.g. productivity" + disabled={isSaving} + onKeyDown={e => { if (e.key === 'Enter') { e.preventDefault(); addTag(); } }} + className="flex-1" + /> + +
+
+
+
+ {/* Delete App */} {hasApp && (
@@ -860,23 +832,11 @@ export function AppDialog({ projectId, open, onOpenChange }: AppDialogProps) {

Are you sure? This will publish a deletion event to Nostr.

- -