@igstack/app-catalog-frontend-core 0.4.0-alpha-20260807164058 → 0.4.0-alpha-20260807174540

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { useReactTable, getCoreRowModel, flexRender } from "@tanstack/react-table";
3
- import { ExternalLink, X, Trash2, Plus, AppWindow } from "lucide-react";
3
+ import { ExternalLink, X, Clock, Trash2, Plus, AppWindow } from "lucide-react";
4
4
  import React__default, { useState } from "react";
5
5
  import { useHotkeys } from "react-hotkeys-hook";
6
6
  import { cn } from "../../../../lib/utils.js";
@@ -224,7 +224,23 @@ function AppDetails({
224
224
  /* @__PURE__ */ jsx(ExternalLink, { className: "size-3 shrink-0 opacity-60" })
225
225
  ]
226
226
  }
227
- ) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "—" }) })
227
+ ) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "—" }) }),
228
+ ((_c = app.freshness) == null ? void 0 : _c.lastCheckedAt) && /* @__PURE__ */ jsx("div", { className: "mt-1 px-3", children: /* @__PURE__ */ jsxs(
229
+ "span",
230
+ {
231
+ className: "inline-flex items-center gap-1 text-xs text-muted-foreground",
232
+ title: app.freshness.lastCheckedAt,
233
+ children: [
234
+ /* @__PURE__ */ jsx(Clock, { className: "size-3" }),
235
+ "Updated ",
236
+ formatRelativeTime(app.freshness.lastCheckedAt),
237
+ app.freshness.isStale && /* @__PURE__ */ jsxs("span", { className: "italic opacity-75", children: [
238
+ " ",
239
+ "· may be out of date"
240
+ ] })
241
+ ]
242
+ }
243
+ ) })
228
244
  ] })
229
245
  ] }) }),
230
246
  app.deprecated && (() => {
@@ -441,13 +457,6 @@ function AppDetails({
441
457
  }
442
458
  ) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "—" })
443
459
  ] }, index)) })
444
- ] }),
445
- ((_c = app.freshness) == null ? void 0 : _c.lastCheckedAt) && /* @__PURE__ */ jsxs("p", { className: "mt-4 text-xs text-muted-foreground", children: [
446
- /* @__PURE__ */ jsxs("span", { title: app.freshness.lastCheckedAt, children: [
447
- "Last checked ",
448
- formatRelativeTime(app.freshness.lastCheckedAt)
449
- ] }),
450
- app.freshness.isStale && /* @__PURE__ */ jsx("span", { className: "italic opacity-75", children: " · may be out of date" })
451
460
  ] })
452
461
  ] }),
453
462
  /* @__PURE__ */ jsx(
@@ -1 +1 @@
1
- {"version":3,"file":"AppCatalogGrid.js","sources":["../../../../../../src/modules/appCatalog/ui/grid/AppCatalogGrid.tsx"],"sourcesContent":["import type {\n GroupingTagDefinition,\n Resource,\n} from '@igstack/app-catalog-backend-core'\nimport type { ColumnDef } from '@tanstack/react-table'\nimport {\n flexRender,\n getCoreRowModel,\n useReactTable,\n} from '@tanstack/react-table'\nimport { AppWindow, ExternalLink, Plus, Trash2, X } from 'lucide-react'\nimport React, { useState } from 'react'\nimport { useHotkeys } from 'react-hotkeys-hook'\nimport { cn } from '~/lib/utils'\nimport type {} from '~/types/table'\nimport { Badge } from '~/ui/badge'\nimport { Button } from '~/ui/button'\nimport {\n ResizableHandle,\n ResizablePanel,\n ResizablePanelGroup,\n} from '~/ui/resizable'\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from '~/ui/table'\nimport { AccessRequestSection } from '../components/AccessRequestSection'\nimport { AccessPrerequisiteChain } from '../components/AccessPrerequisiteChain'\nimport { useAppCatalogFilters } from '../context/AppCatalogFiltersContext'\nimport { PersonBadge } from '../components/PersonBadge'\nimport { useUser } from '~/modules/auth'\nimport { InlineEditableField } from '../components/InlineEditableField'\nimport { MarkdownText } from '../components/MarkdownText'\nimport { ScreenshotGallery } from '../components/ScreenshotGallery'\nimport { useUpdateApp } from '../../hooks/useUpdateApp'\nimport { useAppCatalogContext } from '../../context/AppCatalogContext'\nimport { useAppClickHistory } from '../../hooks/useAppClickHistory'\nimport { useKeyboardNavigation } from '../hooks/useKeyboardNavigation'\nimport { highlightText } from '../../utils/searchApps'\nimport { markdownToPlainText } from '../../utils/markdownToPlainText'\nimport { formatRelativeTime } from '../../utils/formatRelativeTime'\nimport { TierVariantsSection } from '../components/TierVariantsSection'\nimport { SubResourcesSection } from '../components/SubResourcesSection'\nimport { getChildResources } from '../../utils/resolveHelpers'\n\nexport interface AppCatalogGridProps {\n apps: Resource[]\n selectedAppSlug?: string\n groupingDefinition?: GroupingTagDefinition\n onAppClick?: (app: Resource) => void\n /** Whether search is active (affects group sorting) */\n hasSearch?: boolean\n /** Search query for highlighting matches */\n searchQuery?: string\n /** Total count of apps before filtering */\n totalAppsCount?: number\n /** Callback to clear all filters and search */\n onClearFilters?: () => void\n /** Called when the user closes the detail panel (Esc or X) — e.g. to navigate back to the catalog URL */\n onClosePanel?: () => void\n}\n\nfunction getIconUrl(iconName: string): string {\n return `/api/icons/${iconName}`\n}\n\nfunction HighlightedText({\n text,\n searchQuery,\n}: {\n text: string\n searchQuery?: string\n}) {\n if (!searchQuery) {\n return <>{text}</>\n }\n\n const segments = highlightText(text, searchQuery)\n\n return (\n <>\n {segments.map((segment, index) =>\n segment.highlight ? (\n <mark\n key={index}\n className=\"bg-yellow-300 dark:bg-yellow-600/60 font-semibold text-gray-900 dark:text-gray-100\"\n >\n {segment.text}\n </mark>\n ) : (\n <React.Fragment key={index}>{segment.text}</React.Fragment>\n ),\n )}\n </>\n )\n}\n\nfunction AppIcon({ app, className }: { app: Resource; className?: string }) {\n const [imageError, setImageError] = React.useState(false)\n\n // Use iconName from backend if available\n if (app.iconName && !imageError) {\n return (\n <div className={cn('size-12 shrink-0', className)}>\n <img\n src={getIconUrl(app.iconName)}\n alt={`${app.abbreviation || app.displayName} icon`}\n className=\"size-12 rounded-lg object-contain\"\n onError={() => setImageError(true)}\n />\n </div>\n )\n }\n\n // Fallback icon\n return (\n <div\n className={cn(\n 'flex items-center justify-center rounded-lg bg-primary/10 text-primary size-12 shrink-0',\n className,\n )}\n >\n <AppWindow className=\"size-6\" />\n </div>\n )\n}\n\nfunction AppScreenshot({ app }: { app: Resource }) {\n const [imageError, setImageError] = React.useState(false)\n const [isLoadingImage, setIsLoadingImage] = React.useState(true)\n\n // Check if app has screenshots\n const screenshotId = app.screenshotIds?.[0]\n if (!screenshotId) {\n return (\n <div className=\"w-full bg-muted/50 rounded-lg overflow-hidden flex items-center justify-center min-h-64\">\n <div className=\"w-full h-64 bg-muted/30 flex items-center justify-center text-muted-foreground text-sm\">\n No screenshot available\n </div>\n </div>\n )\n }\n\n const screenshotImageUrl = `/api/screenshots/${screenshotId}?size=512`\n\n return (\n <div className=\"w-full flex justify-center\">\n <div className=\"rounded-lg overflow-hidden inline-flex items-center justify-center min-h-64\">\n {!imageError ? (\n <img\n src={screenshotImageUrl}\n alt={`${app.abbreviation || app.displayName} screenshot`}\n className=\"h-64 object-contain\"\n onError={() => {\n setImageError(true)\n setIsLoadingImage(false)\n }}\n onLoad={() => setIsLoadingImage(false)}\n />\n ) : null}\n {(imageError || isLoadingImage) && (\n <div className=\"w-full h-64 bg-muted/30 flex items-center justify-center text-muted-foreground text-sm\">\n {isLoadingImage\n ? 'Loading screenshot...'\n : 'No screenshot available'}\n </div>\n )}\n </div>\n </div>\n )\n}\n\nfunction TiersAndSubResourcesPanel({ app }: { app: Resource }) {\n const { resources } = useAppCatalogContext()\n // #38 item C: the active catalog search term. When the user reached this app\n // by searching something that matched a child, seed the sub-resource filter\n // with it so the matched child is revealed.\n const { state: filterState } = useAppCatalogFilters()\n const appSubResources = React.useMemo(\n () => getChildResources(resources, app.slug),\n [resources, app.slug],\n )\n\n return (\n <>\n {app.tiers && app.tiers.length > 0 && (\n <div className=\"mt-6\">\n <TierVariantsSection tiers={app.tiers} />\n </div>\n )}\n {appSubResources.length > 0 && (\n <div className=\"mt-6\">\n <SubResourcesSection\n subResources={appSubResources}\n initialSearch={filterState.searchValue}\n />\n </div>\n )}\n </>\n )\n}\n\nexport function AppDetails({\n app,\n onAppClick,\n onClosePanel,\n}: {\n app: Resource\n onAppClick?: (app: Resource) => void\n onClosePanel: () => void\n}) {\n const [isGalleryOpen, setIsGalleryOpen] = React.useState(false)\n const [galleryInitialIndex, setGalleryInitialIndex] = React.useState(0)\n const { approvalMethods, resources: allResources } = useAppCatalogContext()\n const { recordClick } = useAppClickHistory()\n const updateApp = useUpdateApp()\n const [draftSource, setDraftSource] = React.useState<string | null>(null)\n const user = useUser()\n const isAdmin = user?.isAdmin ?? false\n\n const sourceUrls: string[] =\n app.sources?.map((s) => (typeof s === 'string' ? s : s.url)) ?? []\n const displaySources =\n draftSource !== null ? [...sourceUrls, draftSource] : sourceUrls\n\n // Enter: open screenshot gallery\n useHotkeys(\n 'enter',\n () => {\n const tag = document.activeElement?.tagName\n if (\n tag === 'BUTTON' ||\n tag === 'A' ||\n tag === 'INPUT' ||\n tag === 'SELECT' ||\n tag === 'TEXTAREA'\n )\n return\n\n if (app.screenshotIds && app.screenshotIds.length > 0) {\n setGalleryInitialIndex(0)\n setIsGalleryOpen(true)\n }\n },\n { enabled: !isGalleryOpen },\n [app, isGalleryOpen],\n )\n\n // Esc: close the details panel (only when gallery is NOT open)\n useHotkeys(\n 'escape',\n () => {\n onClosePanel()\n },\n { enabled: !isGalleryOpen },\n [isGalleryOpen, onClosePanel],\n )\n\n const handleScreenshotClick = (index: number) => {\n setGalleryInitialIndex(index)\n setIsGalleryOpen(true)\n }\n\n // Find replacement app if deprecated\n const replacementApp = app.deprecated?.replacementSlug\n ? allResources.find((a) => a.slug === app.deprecated?.replacementSlug)\n : null\n\n return (\n <>\n <div className=\"flex h-full flex-col p-6\">\n {/* Icon and Title */}\n <div className=\"border-b pb-6\">\n <div className=\"flex items-center gap-3\">\n <AppIcon app={app} className=\"size-16\" />\n <div className=\"-mx-3 flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 px-3\">\n <div className=\"font-serif text-2xl font-semibold min-w-0\">\n {app.abbreviation\n ? `${app.displayName} (${app.abbreviation})`\n : app.displayName}\n </div>\n {app.deprecated && (\n <Badge\n variant={\n app.deprecated.type === 'discouraged'\n ? 'secondary'\n : 'destructive'\n }\n >\n {app.deprecated.type === 'discouraged'\n ? 'Discouraged'\n : 'Deprecated'}\n </Badge>\n )}\n </div>\n {isAdmin && (\n <div className=\"mt-1 px-3\">\n <span className=\"text-xs text-muted-foreground mr-2\">\n Slug:\n </span>\n <InlineEditableField\n value={app.slug}\n onSave={(slug) =>\n updateApp.mutate({ id: app.id, data: { slug } })\n }\n className=\"text-sm\"\n />\n </div>\n )}\n <div className=\"mt-1 px-3\">\n {isAdmin ? (\n <InlineEditableField\n value={app.appUrl ?? ''}\n onSave={(appUrl) =>\n updateApp.mutate({ id: app.id, data: { appUrl } })\n }\n placeholder=\"App URL\"\n renderView={(url) =>\n url ? (\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={() => recordClick(app.slug)}\n className=\"inline-flex items-center gap-1 rounded-md py-1 text-sm text-blue-600 hover:bg-accent/30 hover:underline dark:text-blue-400 transition-all\"\n >\n {url.replace(/https?:\\/\\//g, '')}\n <ExternalLink className=\"size-3.5 shrink-0 opacity-40 group-hover:opacity-100 transition-opacity\" />\n </a>\n ) : (\n <span className=\"text-muted-foreground\">—</span>\n )\n }\n />\n ) : app.appUrl ? (\n <a\n href={app.appUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={() => recordClick(app.slug)}\n className=\"inline-flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1 text-xs text-muted-foreground hover:border-primary hover:text-primary transition-all\"\n title=\"Open app in new tab (secondary — see access info below)\"\n >\n {app.appUrl.replace(/https?:\\/\\//g, '')}\n <ExternalLink className=\"size-3 shrink-0 opacity-60\" />\n </a>\n ) : (\n <span className=\"text-muted-foreground\">—</span>\n )}\n </div>\n </div>\n </div>\n </div>\n\n {/* Deprecation/Discouraged Warning */}\n {app.deprecated &&\n (() => {\n const deprecationType = app.deprecated.type || 'deprecated'\n const isDiscouraged = deprecationType === 'discouraged'\n return (\n <div\n className={\n isDiscouraged\n ? 'mt-6 p-4 border border-yellow-500/50 rounded-lg bg-yellow-50 dark:bg-yellow-950/20'\n : 'mt-6 p-4 border border-destructive/50 rounded-lg bg-destructive/10'\n }\n >\n <h3\n className={\n isDiscouraged\n ? 'text-sm font-semibold text-yellow-700 dark:text-yellow-500 mb-2'\n : 'text-sm font-semibold text-destructive mb-2'\n }\n >\n {isDiscouraged\n ? 'Usage discouraged'\n : 'This application is deprecated'}\n </h3>\n <p className=\"text-sm text-muted-foreground mb-3\">\n {app.deprecated.comment}\n </p>\n {replacementApp && (\n <button\n type=\"button\"\n onClick={() => onAppClick?.(replacementApp)}\n className=\"text-sm font-medium text-primary hover:underline inline-flex items-center gap-1\"\n >\n View replacement: {replacementApp.displayName}\n <ExternalLink className=\"size-3\" />\n </button>\n )}\n </div>\n )\n })()}\n\n {/* Two-step access (#38 D): for a nested resource, show the parent-first\n prerequisite chain before this resource's own access instructions. */}\n <AccessPrerequisiteChain resource={app} onOpenParent={onAppClick} />\n\n {/* Access Request Section — hero of the detail, shown before description */}\n <AccessRequestSection app={app} approvalMethods={approvalMethods} />\n\n {/* Description */}\n <div className=\"mt-6\">\n <h3 className=\"mb-2 text-sm font-medium\">Description</h3>\n {isAdmin ? (\n <InlineEditableField\n value={app.description ?? ''}\n onSave={(description) =>\n updateApp.mutate({ id: app.id, data: { description } })\n }\n multiline\n placeholder=\"Description\"\n className=\"min-h-[4rem] resize-y text-sm text-muted-foreground\"\n />\n ) : app.description ? (\n <MarkdownText className=\"prose prose-sm max-w-none text-sm text-muted-foreground [&_p]:m-0\">\n {app.description}\n </MarkdownText>\n ) : (\n <p className=\"text-sm text-muted-foreground\">—</p>\n )}\n </div>\n\n {/* Screenshots - Clickable preview */}\n {app.screenshotIds && app.screenshotIds.length > 0 && (\n <div className=\"mt-6\">\n <h3 className=\"mb-2 text-sm font-medium\">\n Screenshots ({app.screenshotIds.length})\n </h3>\n <div\n className=\"cursor-pointer hover:opacity-80 transition-opacity\"\n onClick={() => handleScreenshotClick(0)}\n >\n <AppScreenshot app={app} />\n {app.screenshotIds.length > 1 && (\n <p className=\"text-xs text-muted-foreground mt-2 text-center\">\n Click to view all {app.screenshotIds.length} screenshots\n </p>\n )}\n </div>\n </div>\n )}\n\n {/* Owner — who is responsible for this resource. Distinct from the\n access approver (who decides access requests); see domain model. */}\n {app.ownerPersonSlug && (\n <div className=\"mt-6\">\n <h3 className=\"mb-1 text-sm font-medium\">Owner</h3>\n <p className=\"mb-2 text-xs text-muted-foreground\">\n Who is responsible for this resource\n </p>\n <PersonBadge slug={app.ownerPersonSlug} />\n </div>\n )}\n\n {/* Tier Variants and Sub-Resources */}\n <TiersAndSubResourcesPanel app={app} />\n\n {/* Links */}\n {app.links && app.links.length > 0 && (\n <div className=\"mt-4\">\n <h3 className=\"mb-1 text-xs font-medium text-muted-foreground\">\n Links\n </h3>\n <div className=\"space-y-0.5\">\n {app.links.map((link) => (\n <a\n key={link.url}\n href={link.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"flex items-center gap-1 text-xs text-muted-foreground hover:text-primary truncate\"\n >\n <ExternalLink className=\"size-3 shrink-0\" />\n {link.title || link.url.replace(/https?:\\/\\//g, '')}\n </a>\n ))}\n </div>\n </div>\n )}\n\n {/* Tags */}\n {app.tags && app.tags.length > 0 && (\n <div className=\"mt-6\">\n <h3 className=\"mb-2 text-sm font-medium\">Tags</h3>\n <div className=\"flex flex-wrap gap-2\">\n {app.tags.map((tag) => (\n <Badge key={tag} variant=\"secondary\" className=\"text-xs\">\n {tag}\n </Badge>\n ))}\n </div>\n </div>\n )}\n\n {/* Teams */}\n {app.teams && app.teams.length > 0 && (\n <div className=\"mt-6\">\n <h3 className=\"mb-2 text-sm font-medium\">Teams</h3>\n <div className=\"flex flex-wrap gap-2\">\n {app.teams.map((team) => (\n <Badge key={team} variant=\"outline\" className=\"text-xs\">\n {team}\n </Badge>\n ))}\n </div>\n </div>\n )}\n\n {/* Sources */}\n <div className=\"mt-6\">\n <h3 className=\"mb-2 text-sm font-medium\">Sources</h3>\n {isAdmin ? (\n <>\n <ul className=\"space-y-2\">\n {displaySources.map((url, index) => {\n const isDraft =\n draftSource !== null && index === sourceUrls.length\n return (\n <li\n key={isDraft ? 'draft' : `${index}-${url}`}\n className=\"flex items-center gap-2 text-xs\"\n >\n <span className=\"text-muted-foreground shrink-0 tabular-nums\">\n {index + 1}.\n </span>\n <InlineEditableField\n value={url}\n initialEditMode={isDraft}\n onCancel={\n isDraft ? () => setDraftSource(null) : undefined\n }\n onSave={(newUrl) => {\n if (isDraft) {\n setDraftSource(null)\n if (newUrl) {\n updateApp.mutate({\n id: app.id,\n data: { sources: [...sourceUrls, newUrl] },\n })\n }\n } else {\n const next = [...sourceUrls]\n next[index] = newUrl\n updateApp.mutate({\n id: app.id,\n data: { sources: next.filter(Boolean) },\n })\n }\n }}\n placeholder=\"https://...\"\n viewClassName=\"flex-1 min-w-0\"\n renderView={(val) =>\n val ? (\n <a\n href={val}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"hover:text-primary inline-flex items-center gap-1 truncate\"\n >\n {val.replace(/https?:\\/\\//g, '')}\n <ExternalLink className=\"size-3 shrink-0\" />\n </a>\n ) : (\n <span className=\"text-muted-foreground\">—</span>\n )\n }\n />\n {!isDraft && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label=\"Remove source\"\n className=\"shrink-0 text-muted-foreground hover:text-destructive\"\n onClick={() => {\n const next = sourceUrls.filter(\n (_, i) => i !== index,\n )\n updateApp.mutate({\n id: app.id,\n data: { sources: next },\n })\n }}\n >\n <Trash2 className=\"size-3.5\" />\n </Button>\n )}\n </li>\n )\n })}\n </ul>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"mt-2 gap-1 text-muted-foreground\"\n onClick={() => setDraftSource('')}\n >\n <Plus className=\"size-3.5\" />\n Add source\n </Button>\n </>\n ) : (\n <ul className=\"space-y-2\">\n {sourceUrls.map((url, index) => (\n <li key={index} className=\"flex items-center gap-2 text-xs\">\n <span className=\"text-muted-foreground shrink-0 tabular-nums\">\n {index + 1}.\n </span>\n {url ? (\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"hover:text-primary inline-flex items-center gap-1 truncate\"\n >\n {url.replace(/https?:\\/\\//g, '')}\n <ExternalLink className=\"size-3 shrink-0\" />\n </a>\n ) : (\n <span className=\"text-muted-foreground\">—</span>\n )}\n </li>\n ))}\n </ul>\n )}\n </div>\n\n {/* Freshness: muted \"last checked\" line, rarely-needed metadata. The\n backend owns the semantic (freshness.isStale); we only render. */}\n {app.freshness?.lastCheckedAt && (\n <p className=\"mt-4 text-xs text-muted-foreground\">\n <span title={app.freshness.lastCheckedAt}>\n Last checked {formatRelativeTime(app.freshness.lastCheckedAt)}\n </span>\n {app.freshness.isStale && (\n <span className=\"italic opacity-75\"> · may be out of date</span>\n )}\n </p>\n )}\n </div>\n\n {/* Screenshot Gallery Dialog */}\n <ScreenshotGallery\n app={app}\n screenshotIds={app.screenshotIds || []}\n open={isGalleryOpen}\n onOpenChange={setIsGalleryOpen}\n initialIndex={galleryInitialIndex}\n title={`${app.abbreviation || app.displayName} - Screenshots`}\n />\n </>\n )\n}\n\ninterface GroupedApps {\n groupName: string\n apps: Resource[]\n}\n\nfunction groupApps(\n apps: Resource[],\n groupingDef?: GroupingTagDefinition,\n hasSearch?: boolean,\n): GroupedApps[] {\n // When search is active, skip grouping and preserve relevance order\n if (hasSearch) {\n return [{ groupName: 'All Apps', apps: [...apps] }]\n }\n\n if (!groupingDef) {\n // No grouping definition - sort alphabetically\n const sortedApps = [...apps].sort((a, b) =>\n a.displayName.localeCompare(b.displayName),\n )\n return [{ groupName: 'All Apps', apps: sortedApps }]\n }\n\n const grouped = new Map<string, Resource[]>()\n const ungrouped: Resource[] = []\n\n for (const app of apps) {\n const matchingTag = app.tags?.find((tag) =>\n tag.startsWith(`${groupingDef.prefix}:`),\n )\n\n if (matchingTag) {\n const value = matchingTag.split(':')[1]\n if (value) {\n const tagValue = groupingDef.values.find((v) => v.value === value)\n const displayName = tagValue?.displayName || value\n\n if (!grouped.has(displayName)) {\n grouped.set(displayName, [])\n }\n grouped.get(displayName)!.push(app)\n } else {\n ungrouped.push(app)\n }\n } else {\n ungrouped.push(app)\n }\n }\n\n const result: GroupedApps[] = []\n for (const [groupName, appsInGroup] of grouped) {\n // Sort alphabetically within each group\n const sortedGroupApps = appsInGroup.sort((a, b) =>\n a.displayName.localeCompare(b.displayName),\n )\n result.push({ groupName, apps: sortedGroupApps })\n }\n\n if (ungrouped.length > 0) {\n // Sort alphabetically\n const sortedUngrouped = ungrouped.sort((a, b) =>\n a.displayName.localeCompare(b.displayName),\n )\n result.push({ groupName: 'Other', apps: sortedUngrouped })\n }\n\n // Sort groups by app count descending\n result.sort((a, b) => b.apps.length - a.apps.length)\n\n return result\n}\n\nexport function AppCatalogGrid({\n apps,\n selectedAppSlug,\n groupingDefinition,\n onAppClick,\n hasSearch = false,\n searchQuery,\n totalAppsCount,\n onClearFilters,\n onClosePanel,\n}: AppCatalogGridProps) {\n // Full, unfiltered resource set — the detail panel must resolve the open app\n // from this, not only from the filtered `apps`. Navigating to /app/<slug>\n // (e.g. a deprecated app's \"View replacement\" link, or any deep link) should\n // render that app like typing the URL in the browser, regardless of the\n // active search/filters (#12).\n const { resources: allResourcesForDetail } = useAppCatalogContext()\n const selectedApp = selectedAppSlug\n ? (apps.find((a) => a.slug === selectedAppSlug) ??\n allResourcesForDetail.find((a) => a.slug === selectedAppSlug))\n : null\n\n const groupedApps = groupApps(apps, groupingDefinition, hasSearch)\n\n // Flatten grouped apps to get display order for keyboard navigation\n const appsInDisplayOrder = React.useMemo(\n () => groupedApps.flatMap((group) => group.apps),\n [groupedApps],\n )\n\n // Use keyboard navigation hook with apps in display order\n const { rowRefs } = useKeyboardNavigation({\n apps: appsInDisplayOrder,\n selectedAppSlug,\n onAppClick,\n })\n\n // Launch history for the secondary \"open in new tab\" action on each row.\n const { recordClick: recordLaunch } = useAppClickHistory()\n\n // Build a map of parentSlug -> matched child resource displayName for search annotation\n const { resources: allResources2 } = useAppCatalogContext()\n const matchedSubResourceMap = React.useMemo(() => {\n const map = new Map<string, string>()\n if (!searchQuery?.trim() || allResources2.length === 0) return map\n const queryTerms = searchQuery\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter(Boolean)\n const allTermsMatch = (text: string): boolean =>\n queryTerms.every((term) => text.includes(term))\n\n for (const r of allResources2) {\n if (!r.parentSlug) continue\n if (map.has(r.parentSlug)) continue\n const nameMatch = allTermsMatch(r.displayName.toLowerCase())\n const aliasMatch = (r.aliases ?? []).some((a) =>\n allTermsMatch(a.toLowerCase()),\n )\n const descMatch = r.description\n ? allTermsMatch(r.description.toLowerCase())\n : false\n if (nameMatch || aliasMatch || descMatch) {\n map.set(r.parentSlug, r.displayName)\n }\n }\n return map\n }, [searchQuery, allResources2])\n\n // Define columns\n const columns = React.useMemo<ColumnDef<Resource>[]>(\n () => [\n {\n id: 'application',\n header: 'Application',\n cell: ({ row }) => (\n <div className=\"flex items-center gap-3\">\n <AppIcon app={row.original} className=\"size-6\" />\n <div className=\"flex flex-col\">\n <div className=\"flex items-center gap-2\">\n <span className=\"font-medium\">\n <HighlightedText\n text={\n row.original.abbreviation ||\n row.original.displayName ||\n 'Unnamed App'\n }\n searchQuery={searchQuery}\n />\n </span>\n {row.original.deprecated &&\n (() => {\n const deprecationType =\n row.original.deprecated.type || 'deprecated'\n return (\n <span className=\"text-[0.7rem] text-muted-foreground\">\n (\n {deprecationType === 'discouraged'\n ? 'Discouraged'\n : 'Deprecated'}\n )\n </span>\n )\n })()}\n </div>\n {row.original.abbreviation && (\n <span className=\"text-xs text-muted-foreground\">\n <HighlightedText\n text={row.original.displayName}\n searchQuery={searchQuery}\n />\n </span>\n )}\n </div>\n </div>\n ),\n meta: {\n className: 'w-[300px]',\n },\n },\n {\n id: 'description',\n header: 'Description',\n cell: ({ row }) => (\n <div>\n <span className=\"text-sm text-muted-foreground line-clamp-2\">\n <HighlightedText\n text={\n row.original.description\n ? markdownToPlainText(row.original.description)\n : '—'\n }\n searchQuery={searchQuery}\n />\n </span>\n {matchedSubResourceMap.get(row.original.slug) && (\n <div className=\"text-xs text-primary mt-0.5\">\n Matched sub-resource:{' '}\n {matchedSubResourceMap.get(row.original.slug)}\n </div>\n )}\n </div>\n ),\n },\n {\n // Secondary \"launch\" action (#31): the primary row click opens the\n // detail panel (how to get access); this quiet ↗ button is the fast\n // \"I just want the URL\" jump. stopPropagation so it doesn't also open\n // the panel. Only shown when the resource has a URL.\n id: 'launch',\n header: '',\n cell: ({ row }) =>\n row.original.appUrl ? (\n <a\n href={row.original.appUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label={`Open ${row.original.displayName} in a new tab`}\n title={`Open ${row.original.displayName}`}\n onClick={(e) => {\n e.stopPropagation()\n recordLaunch(row.original.slug)\n }}\n className=\"inline-flex size-8 items-center justify-center rounded-full border text-muted-foreground opacity-0 transition-opacity hover:border-primary hover:text-primary group-hover:opacity-100 focus-visible:opacity-100\"\n >\n <ExternalLink className=\"size-4\" />\n </a>\n ) : null,\n meta: {\n className: 'w-[56px] text-right',\n },\n },\n ],\n [searchQuery, matchedSubResourceMap, recordLaunch],\n )\n\n // Create a single table instance with all apps\n const table = useReactTable({\n data: apps,\n columns,\n getCoreRowModel: getCoreRowModel(),\n getRowId: (row) => row.id,\n })\n\n // Panel visibility state - derive from selectedApp and explicit close\n const [hasUserClosed, setHasUserClosed] = useState(false)\n\n // Auto-open when app is selected, unless user explicitly closed\n const isPanelOpen = selectedApp !== null && !hasUserClosed\n\n // Reset close flag when selectedApp changes\n React.useEffect(() => {\n if (selectedApp) {\n setHasUserClosed(false)\n }\n }, [selectedApp])\n\n // Auto-scroll to selected app (only on initial load)\n const hasScrolledRef = React.useRef(false)\n React.useEffect(() => {\n // Only scroll once on initial load if there's a selection\n if (selectedAppSlug && !hasScrolledRef.current) {\n const rowElement = rowRefs.current.get(selectedAppSlug)\n if (rowElement) {\n rowElement.scrollIntoView({ behavior: 'smooth', block: 'center' })\n }\n hasScrolledRef.current = true\n }\n }, [selectedAppSlug, rowRefs])\n\n const handleAppClick = (app: Resource) => {\n onAppClick?.(app)\n }\n\n const handleClosePanel = () => {\n setHasUserClosed(true)\n onClosePanel?.()\n }\n\n return (\n <ResizablePanelGroup orientation=\"horizontal\" className=\"h-full w-full\">\n {/* Left Panel - Table */}\n <ResizablePanel\n defaultSize={isPanelOpen ? 60 : 100}\n minSize={30}\n className=\"overflow-hidden\"\n >\n <div className=\"h-full overflow-y-auto pr-2 pb-6 [scrollbar-gutter:stable]\">\n <Table>\n <TableHeader className=\"sticky top-0 border-b bg-background z-10\">\n {table.getHeaderGroups().map((headerGroup) => (\n <TableRow key={headerGroup.id}>\n {headerGroup.headers.map((header) => (\n <TableHead\n key={header.id}\n className={cn(\n 'px-4 py-3 text-left font-medium text-sm',\n header.column.columnDef.meta?.className,\n )}\n >\n {header.isPlaceholder\n ? null\n : flexRender(\n header.column.columnDef.header,\n header.getContext(),\n )}\n </TableHead>\n ))}\n </TableRow>\n ))}\n </TableHeader>\n\n <TableBody>\n {groupedApps.map((group) => (\n <React.Fragment key={group.groupName}>\n {/* Group Header Row */}\n <TableRow className=\"bg-muted/50 hover:bg-muted/50\">\n <TableCell\n colSpan={columns.length}\n className=\"px-4 py-6 sticky top-[49px] bg-muted/90 backdrop-blur z-10\"\n >\n <div className=\"flex items-center justify-center\">\n <span className=\"font-serif font-semibold text-lg tracking-widest uppercase leading-loose text-muted-foreground\">\n {group.groupName}\n </span>\n </div>\n </TableCell>\n </TableRow>\n\n {/* Group Apps */}\n {group.apps.map((app) => {\n const row = table\n .getRowModel()\n .rows.find((r) => r.id === app.id)\n if (!row) return null\n\n return (\n <TableRow\n key={row.id}\n ref={(el) => {\n if (el && row.original.slug) {\n rowRefs.current.set(row.original.slug, el)\n } else if (row.original.slug) {\n rowRefs.current.delete(row.original.slug)\n }\n }}\n onClick={() => handleAppClick(row.original)}\n className={cn(\n 'group border-b cursor-pointer transition-colors',\n selectedApp?.id === row.original.id\n ? 'bg-blue-100 dark:bg-blue-950 hover:bg-blue-200 dark:hover:bg-blue-900'\n : 'hover:bg-muted/30',\n )}\n >\n {row.getVisibleCells().map((cell) => (\n <TableCell\n key={cell.id}\n className={cn(\n 'px-4 py-4',\n cell.column.columnDef.meta?.className,\n )}\n >\n {flexRender(\n cell.column.columnDef.cell,\n cell.getContext(),\n )}\n </TableCell>\n ))}\n </TableRow>\n )\n })}\n </React.Fragment>\n ))}\n\n {/* Clear Filters Row */}\n {(totalAppsCount ?? 0) > apps.length && onClearFilters && (\n <TableRow>\n <TableCell\n colSpan={columns.length}\n className=\"px-4 py-8 text-center\"\n >\n <Button\n variant=\"outline\"\n onClick={onClearFilters}\n className=\"gap-2\"\n >\n <X className=\"h-4 w-4\" />\n Clear filters to show all apps ({totalAppsCount})\n </Button>\n </TableCell>\n </TableRow>\n )}\n </TableBody>\n </Table>\n </div>\n </ResizablePanel>\n\n {/* Right Panel - Details (only render when panel is open) */}\n {isPanelOpen && (\n <>\n {/* Resizable Handle */}\n <ResizableHandle withHandle />\n\n <ResizablePanel\n defaultSize={40}\n minSize={25}\n className=\"overflow-hidden\"\n >\n <div className=\"h-full overflow-y-auto border-l bg-background pl-4\">\n {selectedApp ? (\n <div className=\"relative\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"absolute top-4 right-4 z-10 hover:bg-accent\"\n onClick={handleClosePanel}\n aria-label=\"Close details panel\"\n >\n <X className=\"h-5 w-5\" />\n </Button>\n <AppDetails\n app={selectedApp}\n onAppClick={onAppClick}\n onClosePanel={handleClosePanel}\n />\n </div>\n ) : null}\n </div>\n </ResizablePanel>\n </>\n )}\n </ResizablePanelGroup>\n )\n}\n"],"names":["React","_a"],"mappings":";;;;;;;;;;;;;;;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;AAAA,QAAA;AAAA,UACC,aAAa;AAAA,UACb,SAAS;AAAA,UACT,WAAU;AAAA,UAEV,UAAA,oBAAC,SAAI,WAAU,sDACZ,wBACC,qBAAC,OAAA,EAAI,WAAU,YACb,UAAA;AAAA,YAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,SAAQ;AAAA,gBACR,MAAK;AAAA,gBACL,WAAU;AAAA,gBACV,SAAS;AAAA,gBACT,cAAW;AAAA,gBAEX,UAAA,oBAAC,GAAA,EAAE,WAAU,UAAA,CAAU;AAAA,cAAA;AAAA,YAAA;AAAA,YAEzB;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,KAAK;AAAA,gBACL;AAAA,gBACA,cAAc;AAAA,cAAA;AAAA,YAAA;AAAA,UAChB,EAAA,CACF,IACE,KAAA,CACN;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,EAAA,CACF;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"AppCatalogGrid.js","sources":["../../../../../../src/modules/appCatalog/ui/grid/AppCatalogGrid.tsx"],"sourcesContent":["import type {\n GroupingTagDefinition,\n Resource,\n} from '@igstack/app-catalog-backend-core'\nimport type { ColumnDef } from '@tanstack/react-table'\nimport {\n flexRender,\n getCoreRowModel,\n useReactTable,\n} from '@tanstack/react-table'\nimport { AppWindow, Clock, ExternalLink, Plus, Trash2, X } from 'lucide-react'\nimport React, { useState } from 'react'\nimport { useHotkeys } from 'react-hotkeys-hook'\nimport { cn } from '~/lib/utils'\nimport type {} from '~/types/table'\nimport { Badge } from '~/ui/badge'\nimport { Button } from '~/ui/button'\nimport {\n ResizableHandle,\n ResizablePanel,\n ResizablePanelGroup,\n} from '~/ui/resizable'\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from '~/ui/table'\nimport { AccessRequestSection } from '../components/AccessRequestSection'\nimport { AccessPrerequisiteChain } from '../components/AccessPrerequisiteChain'\nimport { useAppCatalogFilters } from '../context/AppCatalogFiltersContext'\nimport { PersonBadge } from '../components/PersonBadge'\nimport { useUser } from '~/modules/auth'\nimport { InlineEditableField } from '../components/InlineEditableField'\nimport { MarkdownText } from '../components/MarkdownText'\nimport { ScreenshotGallery } from '../components/ScreenshotGallery'\nimport { useUpdateApp } from '../../hooks/useUpdateApp'\nimport { useAppCatalogContext } from '../../context/AppCatalogContext'\nimport { useAppClickHistory } from '../../hooks/useAppClickHistory'\nimport { useKeyboardNavigation } from '../hooks/useKeyboardNavigation'\nimport { highlightText } from '../../utils/searchApps'\nimport { markdownToPlainText } from '../../utils/markdownToPlainText'\nimport { formatRelativeTime } from '../../utils/formatRelativeTime'\nimport { TierVariantsSection } from '../components/TierVariantsSection'\nimport { SubResourcesSection } from '../components/SubResourcesSection'\nimport { getChildResources } from '../../utils/resolveHelpers'\n\nexport interface AppCatalogGridProps {\n apps: Resource[]\n selectedAppSlug?: string\n groupingDefinition?: GroupingTagDefinition\n onAppClick?: (app: Resource) => void\n /** Whether search is active (affects group sorting) */\n hasSearch?: boolean\n /** Search query for highlighting matches */\n searchQuery?: string\n /** Total count of apps before filtering */\n totalAppsCount?: number\n /** Callback to clear all filters and search */\n onClearFilters?: () => void\n /** Called when the user closes the detail panel (Esc or X) — e.g. to navigate back to the catalog URL */\n onClosePanel?: () => void\n}\n\nfunction getIconUrl(iconName: string): string {\n return `/api/icons/${iconName}`\n}\n\nfunction HighlightedText({\n text,\n searchQuery,\n}: {\n text: string\n searchQuery?: string\n}) {\n if (!searchQuery) {\n return <>{text}</>\n }\n\n const segments = highlightText(text, searchQuery)\n\n return (\n <>\n {segments.map((segment, index) =>\n segment.highlight ? (\n <mark\n key={index}\n className=\"bg-yellow-300 dark:bg-yellow-600/60 font-semibold text-gray-900 dark:text-gray-100\"\n >\n {segment.text}\n </mark>\n ) : (\n <React.Fragment key={index}>{segment.text}</React.Fragment>\n ),\n )}\n </>\n )\n}\n\nfunction AppIcon({ app, className }: { app: Resource; className?: string }) {\n const [imageError, setImageError] = React.useState(false)\n\n // Use iconName from backend if available\n if (app.iconName && !imageError) {\n return (\n <div className={cn('size-12 shrink-0', className)}>\n <img\n src={getIconUrl(app.iconName)}\n alt={`${app.abbreviation || app.displayName} icon`}\n className=\"size-12 rounded-lg object-contain\"\n onError={() => setImageError(true)}\n />\n </div>\n )\n }\n\n // Fallback icon\n return (\n <div\n className={cn(\n 'flex items-center justify-center rounded-lg bg-primary/10 text-primary size-12 shrink-0',\n className,\n )}\n >\n <AppWindow className=\"size-6\" />\n </div>\n )\n}\n\nfunction AppScreenshot({ app }: { app: Resource }) {\n const [imageError, setImageError] = React.useState(false)\n const [isLoadingImage, setIsLoadingImage] = React.useState(true)\n\n // Check if app has screenshots\n const screenshotId = app.screenshotIds?.[0]\n if (!screenshotId) {\n return (\n <div className=\"w-full bg-muted/50 rounded-lg overflow-hidden flex items-center justify-center min-h-64\">\n <div className=\"w-full h-64 bg-muted/30 flex items-center justify-center text-muted-foreground text-sm\">\n No screenshot available\n </div>\n </div>\n )\n }\n\n const screenshotImageUrl = `/api/screenshots/${screenshotId}?size=512`\n\n return (\n <div className=\"w-full flex justify-center\">\n <div className=\"rounded-lg overflow-hidden inline-flex items-center justify-center min-h-64\">\n {!imageError ? (\n <img\n src={screenshotImageUrl}\n alt={`${app.abbreviation || app.displayName} screenshot`}\n className=\"h-64 object-contain\"\n onError={() => {\n setImageError(true)\n setIsLoadingImage(false)\n }}\n onLoad={() => setIsLoadingImage(false)}\n />\n ) : null}\n {(imageError || isLoadingImage) && (\n <div className=\"w-full h-64 bg-muted/30 flex items-center justify-center text-muted-foreground text-sm\">\n {isLoadingImage\n ? 'Loading screenshot...'\n : 'No screenshot available'}\n </div>\n )}\n </div>\n </div>\n )\n}\n\nfunction TiersAndSubResourcesPanel({ app }: { app: Resource }) {\n const { resources } = useAppCatalogContext()\n // #38 item C: the active catalog search term. When the user reached this app\n // by searching something that matched a child, seed the sub-resource filter\n // with it so the matched child is revealed.\n const { state: filterState } = useAppCatalogFilters()\n const appSubResources = React.useMemo(\n () => getChildResources(resources, app.slug),\n [resources, app.slug],\n )\n\n return (\n <>\n {app.tiers && app.tiers.length > 0 && (\n <div className=\"mt-6\">\n <TierVariantsSection tiers={app.tiers} />\n </div>\n )}\n {appSubResources.length > 0 && (\n <div className=\"mt-6\">\n <SubResourcesSection\n subResources={appSubResources}\n initialSearch={filterState.searchValue}\n />\n </div>\n )}\n </>\n )\n}\n\nexport function AppDetails({\n app,\n onAppClick,\n onClosePanel,\n}: {\n app: Resource\n onAppClick?: (app: Resource) => void\n onClosePanel: () => void\n}) {\n const [isGalleryOpen, setIsGalleryOpen] = React.useState(false)\n const [galleryInitialIndex, setGalleryInitialIndex] = React.useState(0)\n const { approvalMethods, resources: allResources } = useAppCatalogContext()\n const { recordClick } = useAppClickHistory()\n const updateApp = useUpdateApp()\n const [draftSource, setDraftSource] = React.useState<string | null>(null)\n const user = useUser()\n const isAdmin = user?.isAdmin ?? false\n\n const sourceUrls: string[] =\n app.sources?.map((s) => (typeof s === 'string' ? s : s.url)) ?? []\n const displaySources =\n draftSource !== null ? [...sourceUrls, draftSource] : sourceUrls\n\n // Enter: open screenshot gallery\n useHotkeys(\n 'enter',\n () => {\n const tag = document.activeElement?.tagName\n if (\n tag === 'BUTTON' ||\n tag === 'A' ||\n tag === 'INPUT' ||\n tag === 'SELECT' ||\n tag === 'TEXTAREA'\n )\n return\n\n if (app.screenshotIds && app.screenshotIds.length > 0) {\n setGalleryInitialIndex(0)\n setIsGalleryOpen(true)\n }\n },\n { enabled: !isGalleryOpen },\n [app, isGalleryOpen],\n )\n\n // Esc: close the details panel (only when gallery is NOT open)\n useHotkeys(\n 'escape',\n () => {\n onClosePanel()\n },\n { enabled: !isGalleryOpen },\n [isGalleryOpen, onClosePanel],\n )\n\n const handleScreenshotClick = (index: number) => {\n setGalleryInitialIndex(index)\n setIsGalleryOpen(true)\n }\n\n // Find replacement app if deprecated\n const replacementApp = app.deprecated?.replacementSlug\n ? allResources.find((a) => a.slug === app.deprecated?.replacementSlug)\n : null\n\n return (\n <>\n <div className=\"flex h-full flex-col p-6\">\n {/* Icon and Title */}\n <div className=\"border-b pb-6\">\n <div className=\"flex items-center gap-3\">\n <AppIcon app={app} className=\"size-16\" />\n <div className=\"-mx-3 flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 px-3\">\n <div className=\"font-serif text-2xl font-semibold min-w-0\">\n {app.abbreviation\n ? `${app.displayName} (${app.abbreviation})`\n : app.displayName}\n </div>\n {app.deprecated && (\n <Badge\n variant={\n app.deprecated.type === 'discouraged'\n ? 'secondary'\n : 'destructive'\n }\n >\n {app.deprecated.type === 'discouraged'\n ? 'Discouraged'\n : 'Deprecated'}\n </Badge>\n )}\n </div>\n {isAdmin && (\n <div className=\"mt-1 px-3\">\n <span className=\"text-xs text-muted-foreground mr-2\">\n Slug:\n </span>\n <InlineEditableField\n value={app.slug}\n onSave={(slug) =>\n updateApp.mutate({ id: app.id, data: { slug } })\n }\n className=\"text-sm\"\n />\n </div>\n )}\n <div className=\"mt-1 px-3\">\n {isAdmin ? (\n <InlineEditableField\n value={app.appUrl ?? ''}\n onSave={(appUrl) =>\n updateApp.mutate({ id: app.id, data: { appUrl } })\n }\n placeholder=\"App URL\"\n renderView={(url) =>\n url ? (\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={() => recordClick(app.slug)}\n className=\"inline-flex items-center gap-1 rounded-md py-1 text-sm text-blue-600 hover:bg-accent/30 hover:underline dark:text-blue-400 transition-all\"\n >\n {url.replace(/https?:\\/\\//g, '')}\n <ExternalLink className=\"size-3.5 shrink-0 opacity-40 group-hover:opacity-100 transition-opacity\" />\n </a>\n ) : (\n <span className=\"text-muted-foreground\">—</span>\n )\n }\n />\n ) : app.appUrl ? (\n <a\n href={app.appUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={() => recordClick(app.slug)}\n className=\"inline-flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1 text-xs text-muted-foreground hover:border-primary hover:text-primary transition-all\"\n title=\"Open app in new tab (secondary — see access info below)\"\n >\n {app.appUrl.replace(/https?:\\/\\//g, '')}\n <ExternalLink className=\"size-3 shrink-0 opacity-60\" />\n </a>\n ) : (\n <span className=\"text-muted-foreground\">—</span>\n )}\n </div>\n {/* Freshness date near the header (this is the same signal that\n drives \"New this week\"), so the date is visible in the card\n itself, not only in the muted footer. */}\n {app.freshness?.lastCheckedAt && (\n <div className=\"mt-1 px-3\">\n <span\n className=\"inline-flex items-center gap-1 text-xs text-muted-foreground\"\n title={app.freshness.lastCheckedAt}\n >\n <Clock className=\"size-3\" />\n Updated {formatRelativeTime(app.freshness.lastCheckedAt)}\n {app.freshness.isStale && (\n <span className=\"italic opacity-75\">\n {' '}\n · may be out of date\n </span>\n )}\n </span>\n </div>\n )}\n </div>\n </div>\n </div>\n\n {/* Deprecation/Discouraged Warning */}\n {app.deprecated &&\n (() => {\n const deprecationType = app.deprecated.type || 'deprecated'\n const isDiscouraged = deprecationType === 'discouraged'\n return (\n <div\n className={\n isDiscouraged\n ? 'mt-6 p-4 border border-yellow-500/50 rounded-lg bg-yellow-50 dark:bg-yellow-950/20'\n : 'mt-6 p-4 border border-destructive/50 rounded-lg bg-destructive/10'\n }\n >\n <h3\n className={\n isDiscouraged\n ? 'text-sm font-semibold text-yellow-700 dark:text-yellow-500 mb-2'\n : 'text-sm font-semibold text-destructive mb-2'\n }\n >\n {isDiscouraged\n ? 'Usage discouraged'\n : 'This application is deprecated'}\n </h3>\n <p className=\"text-sm text-muted-foreground mb-3\">\n {app.deprecated.comment}\n </p>\n {replacementApp && (\n <button\n type=\"button\"\n onClick={() => onAppClick?.(replacementApp)}\n className=\"text-sm font-medium text-primary hover:underline inline-flex items-center gap-1\"\n >\n View replacement: {replacementApp.displayName}\n <ExternalLink className=\"size-3\" />\n </button>\n )}\n </div>\n )\n })()}\n\n {/* Two-step access (#38 D): for a nested resource, show the parent-first\n prerequisite chain before this resource's own access instructions. */}\n <AccessPrerequisiteChain resource={app} onOpenParent={onAppClick} />\n\n {/* Access Request Section — hero of the detail, shown before description */}\n <AccessRequestSection app={app} approvalMethods={approvalMethods} />\n\n {/* Description */}\n <div className=\"mt-6\">\n <h3 className=\"mb-2 text-sm font-medium\">Description</h3>\n {isAdmin ? (\n <InlineEditableField\n value={app.description ?? ''}\n onSave={(description) =>\n updateApp.mutate({ id: app.id, data: { description } })\n }\n multiline\n placeholder=\"Description\"\n className=\"min-h-[4rem] resize-y text-sm text-muted-foreground\"\n />\n ) : app.description ? (\n <MarkdownText className=\"prose prose-sm max-w-none text-sm text-muted-foreground [&_p]:m-0\">\n {app.description}\n </MarkdownText>\n ) : (\n <p className=\"text-sm text-muted-foreground\">—</p>\n )}\n </div>\n\n {/* Screenshots - Clickable preview */}\n {app.screenshotIds && app.screenshotIds.length > 0 && (\n <div className=\"mt-6\">\n <h3 className=\"mb-2 text-sm font-medium\">\n Screenshots ({app.screenshotIds.length})\n </h3>\n <div\n className=\"cursor-pointer hover:opacity-80 transition-opacity\"\n onClick={() => handleScreenshotClick(0)}\n >\n <AppScreenshot app={app} />\n {app.screenshotIds.length > 1 && (\n <p className=\"text-xs text-muted-foreground mt-2 text-center\">\n Click to view all {app.screenshotIds.length} screenshots\n </p>\n )}\n </div>\n </div>\n )}\n\n {/* Owner — who is responsible for this resource. Distinct from the\n access approver (who decides access requests); see domain model. */}\n {app.ownerPersonSlug && (\n <div className=\"mt-6\">\n <h3 className=\"mb-1 text-sm font-medium\">Owner</h3>\n <p className=\"mb-2 text-xs text-muted-foreground\">\n Who is responsible for this resource\n </p>\n <PersonBadge slug={app.ownerPersonSlug} />\n </div>\n )}\n\n {/* Tier Variants and Sub-Resources */}\n <TiersAndSubResourcesPanel app={app} />\n\n {/* Links */}\n {app.links && app.links.length > 0 && (\n <div className=\"mt-4\">\n <h3 className=\"mb-1 text-xs font-medium text-muted-foreground\">\n Links\n </h3>\n <div className=\"space-y-0.5\">\n {app.links.map((link) => (\n <a\n key={link.url}\n href={link.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"flex items-center gap-1 text-xs text-muted-foreground hover:text-primary truncate\"\n >\n <ExternalLink className=\"size-3 shrink-0\" />\n {link.title || link.url.replace(/https?:\\/\\//g, '')}\n </a>\n ))}\n </div>\n </div>\n )}\n\n {/* Tags */}\n {app.tags && app.tags.length > 0 && (\n <div className=\"mt-6\">\n <h3 className=\"mb-2 text-sm font-medium\">Tags</h3>\n <div className=\"flex flex-wrap gap-2\">\n {app.tags.map((tag) => (\n <Badge key={tag} variant=\"secondary\" className=\"text-xs\">\n {tag}\n </Badge>\n ))}\n </div>\n </div>\n )}\n\n {/* Teams */}\n {app.teams && app.teams.length > 0 && (\n <div className=\"mt-6\">\n <h3 className=\"mb-2 text-sm font-medium\">Teams</h3>\n <div className=\"flex flex-wrap gap-2\">\n {app.teams.map((team) => (\n <Badge key={team} variant=\"outline\" className=\"text-xs\">\n {team}\n </Badge>\n ))}\n </div>\n </div>\n )}\n\n {/* Sources */}\n <div className=\"mt-6\">\n <h3 className=\"mb-2 text-sm font-medium\">Sources</h3>\n {isAdmin ? (\n <>\n <ul className=\"space-y-2\">\n {displaySources.map((url, index) => {\n const isDraft =\n draftSource !== null && index === sourceUrls.length\n return (\n <li\n key={isDraft ? 'draft' : `${index}-${url}`}\n className=\"flex items-center gap-2 text-xs\"\n >\n <span className=\"text-muted-foreground shrink-0 tabular-nums\">\n {index + 1}.\n </span>\n <InlineEditableField\n value={url}\n initialEditMode={isDraft}\n onCancel={\n isDraft ? () => setDraftSource(null) : undefined\n }\n onSave={(newUrl) => {\n if (isDraft) {\n setDraftSource(null)\n if (newUrl) {\n updateApp.mutate({\n id: app.id,\n data: { sources: [...sourceUrls, newUrl] },\n })\n }\n } else {\n const next = [...sourceUrls]\n next[index] = newUrl\n updateApp.mutate({\n id: app.id,\n data: { sources: next.filter(Boolean) },\n })\n }\n }}\n placeholder=\"https://...\"\n viewClassName=\"flex-1 min-w-0\"\n renderView={(val) =>\n val ? (\n <a\n href={val}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"hover:text-primary inline-flex items-center gap-1 truncate\"\n >\n {val.replace(/https?:\\/\\//g, '')}\n <ExternalLink className=\"size-3 shrink-0\" />\n </a>\n ) : (\n <span className=\"text-muted-foreground\">—</span>\n )\n }\n />\n {!isDraft && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label=\"Remove source\"\n className=\"shrink-0 text-muted-foreground hover:text-destructive\"\n onClick={() => {\n const next = sourceUrls.filter(\n (_, i) => i !== index,\n )\n updateApp.mutate({\n id: app.id,\n data: { sources: next },\n })\n }}\n >\n <Trash2 className=\"size-3.5\" />\n </Button>\n )}\n </li>\n )\n })}\n </ul>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"mt-2 gap-1 text-muted-foreground\"\n onClick={() => setDraftSource('')}\n >\n <Plus className=\"size-3.5\" />\n Add source\n </Button>\n </>\n ) : (\n <ul className=\"space-y-2\">\n {sourceUrls.map((url, index) => (\n <li key={index} className=\"flex items-center gap-2 text-xs\">\n <span className=\"text-muted-foreground shrink-0 tabular-nums\">\n {index + 1}.\n </span>\n {url ? (\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"hover:text-primary inline-flex items-center gap-1 truncate\"\n >\n {url.replace(/https?:\\/\\//g, '')}\n <ExternalLink className=\"size-3 shrink-0\" />\n </a>\n ) : (\n <span className=\"text-muted-foreground\">—</span>\n )}\n </li>\n ))}\n </ul>\n )}\n </div>\n\n {/* Freshness now shown near the header (see \"Updated …\" above). */}\n </div>\n\n {/* Screenshot Gallery Dialog */}\n <ScreenshotGallery\n app={app}\n screenshotIds={app.screenshotIds || []}\n open={isGalleryOpen}\n onOpenChange={setIsGalleryOpen}\n initialIndex={galleryInitialIndex}\n title={`${app.abbreviation || app.displayName} - Screenshots`}\n />\n </>\n )\n}\n\ninterface GroupedApps {\n groupName: string\n apps: Resource[]\n}\n\nfunction groupApps(\n apps: Resource[],\n groupingDef?: GroupingTagDefinition,\n hasSearch?: boolean,\n): GroupedApps[] {\n // When search is active, skip grouping and preserve relevance order\n if (hasSearch) {\n return [{ groupName: 'All Apps', apps: [...apps] }]\n }\n\n if (!groupingDef) {\n // No grouping definition - sort alphabetically\n const sortedApps = [...apps].sort((a, b) =>\n a.displayName.localeCompare(b.displayName),\n )\n return [{ groupName: 'All Apps', apps: sortedApps }]\n }\n\n const grouped = new Map<string, Resource[]>()\n const ungrouped: Resource[] = []\n\n for (const app of apps) {\n const matchingTag = app.tags?.find((tag) =>\n tag.startsWith(`${groupingDef.prefix}:`),\n )\n\n if (matchingTag) {\n const value = matchingTag.split(':')[1]\n if (value) {\n const tagValue = groupingDef.values.find((v) => v.value === value)\n const displayName = tagValue?.displayName || value\n\n if (!grouped.has(displayName)) {\n grouped.set(displayName, [])\n }\n grouped.get(displayName)!.push(app)\n } else {\n ungrouped.push(app)\n }\n } else {\n ungrouped.push(app)\n }\n }\n\n const result: GroupedApps[] = []\n for (const [groupName, appsInGroup] of grouped) {\n // Sort alphabetically within each group\n const sortedGroupApps = appsInGroup.sort((a, b) =>\n a.displayName.localeCompare(b.displayName),\n )\n result.push({ groupName, apps: sortedGroupApps })\n }\n\n if (ungrouped.length > 0) {\n // Sort alphabetically\n const sortedUngrouped = ungrouped.sort((a, b) =>\n a.displayName.localeCompare(b.displayName),\n )\n result.push({ groupName: 'Other', apps: sortedUngrouped })\n }\n\n // Sort groups by app count descending\n result.sort((a, b) => b.apps.length - a.apps.length)\n\n return result\n}\n\nexport function AppCatalogGrid({\n apps,\n selectedAppSlug,\n groupingDefinition,\n onAppClick,\n hasSearch = false,\n searchQuery,\n totalAppsCount,\n onClearFilters,\n onClosePanel,\n}: AppCatalogGridProps) {\n // Full, unfiltered resource set — the detail panel must resolve the open app\n // from this, not only from the filtered `apps`. Navigating to /app/<slug>\n // (e.g. a deprecated app's \"View replacement\" link, or any deep link) should\n // render that app like typing the URL in the browser, regardless of the\n // active search/filters (#12).\n const { resources: allResourcesForDetail } = useAppCatalogContext()\n const selectedApp = selectedAppSlug\n ? (apps.find((a) => a.slug === selectedAppSlug) ??\n allResourcesForDetail.find((a) => a.slug === selectedAppSlug))\n : null\n\n const groupedApps = groupApps(apps, groupingDefinition, hasSearch)\n\n // Flatten grouped apps to get display order for keyboard navigation\n const appsInDisplayOrder = React.useMemo(\n () => groupedApps.flatMap((group) => group.apps),\n [groupedApps],\n )\n\n // Use keyboard navigation hook with apps in display order\n const { rowRefs } = useKeyboardNavigation({\n apps: appsInDisplayOrder,\n selectedAppSlug,\n onAppClick,\n })\n\n // Launch history for the secondary \"open in new tab\" action on each row.\n const { recordClick: recordLaunch } = useAppClickHistory()\n\n // Build a map of parentSlug -> matched child resource displayName for search annotation\n const { resources: allResources2 } = useAppCatalogContext()\n const matchedSubResourceMap = React.useMemo(() => {\n const map = new Map<string, string>()\n if (!searchQuery?.trim() || allResources2.length === 0) return map\n const queryTerms = searchQuery\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter(Boolean)\n const allTermsMatch = (text: string): boolean =>\n queryTerms.every((term) => text.includes(term))\n\n for (const r of allResources2) {\n if (!r.parentSlug) continue\n if (map.has(r.parentSlug)) continue\n const nameMatch = allTermsMatch(r.displayName.toLowerCase())\n const aliasMatch = (r.aliases ?? []).some((a) =>\n allTermsMatch(a.toLowerCase()),\n )\n const descMatch = r.description\n ? allTermsMatch(r.description.toLowerCase())\n : false\n if (nameMatch || aliasMatch || descMatch) {\n map.set(r.parentSlug, r.displayName)\n }\n }\n return map\n }, [searchQuery, allResources2])\n\n // Define columns\n const columns = React.useMemo<ColumnDef<Resource>[]>(\n () => [\n {\n id: 'application',\n header: 'Application',\n cell: ({ row }) => (\n <div className=\"flex items-center gap-3\">\n <AppIcon app={row.original} className=\"size-6\" />\n <div className=\"flex flex-col\">\n <div className=\"flex items-center gap-2\">\n <span className=\"font-medium\">\n <HighlightedText\n text={\n row.original.abbreviation ||\n row.original.displayName ||\n 'Unnamed App'\n }\n searchQuery={searchQuery}\n />\n </span>\n {row.original.deprecated &&\n (() => {\n const deprecationType =\n row.original.deprecated.type || 'deprecated'\n return (\n <span className=\"text-[0.7rem] text-muted-foreground\">\n (\n {deprecationType === 'discouraged'\n ? 'Discouraged'\n : 'Deprecated'}\n )\n </span>\n )\n })()}\n </div>\n {row.original.abbreviation && (\n <span className=\"text-xs text-muted-foreground\">\n <HighlightedText\n text={row.original.displayName}\n searchQuery={searchQuery}\n />\n </span>\n )}\n </div>\n </div>\n ),\n meta: {\n className: 'w-[300px]',\n },\n },\n {\n id: 'description',\n header: 'Description',\n cell: ({ row }) => (\n <div>\n <span className=\"text-sm text-muted-foreground line-clamp-2\">\n <HighlightedText\n text={\n row.original.description\n ? markdownToPlainText(row.original.description)\n : '—'\n }\n searchQuery={searchQuery}\n />\n </span>\n {matchedSubResourceMap.get(row.original.slug) && (\n <div className=\"text-xs text-primary mt-0.5\">\n Matched sub-resource:{' '}\n {matchedSubResourceMap.get(row.original.slug)}\n </div>\n )}\n </div>\n ),\n },\n {\n // Secondary \"launch\" action (#31): the primary row click opens the\n // detail panel (how to get access); this quiet ↗ button is the fast\n // \"I just want the URL\" jump. stopPropagation so it doesn't also open\n // the panel. Only shown when the resource has a URL.\n id: 'launch',\n header: '',\n cell: ({ row }) =>\n row.original.appUrl ? (\n <a\n href={row.original.appUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label={`Open ${row.original.displayName} in a new tab`}\n title={`Open ${row.original.displayName}`}\n onClick={(e) => {\n e.stopPropagation()\n recordLaunch(row.original.slug)\n }}\n className=\"inline-flex size-8 items-center justify-center rounded-full border text-muted-foreground opacity-0 transition-opacity hover:border-primary hover:text-primary group-hover:opacity-100 focus-visible:opacity-100\"\n >\n <ExternalLink className=\"size-4\" />\n </a>\n ) : null,\n meta: {\n className: 'w-[56px] text-right',\n },\n },\n ],\n [searchQuery, matchedSubResourceMap, recordLaunch],\n )\n\n // Create a single table instance with all apps\n const table = useReactTable({\n data: apps,\n columns,\n getCoreRowModel: getCoreRowModel(),\n getRowId: (row) => row.id,\n })\n\n // Panel visibility state - derive from selectedApp and explicit close\n const [hasUserClosed, setHasUserClosed] = useState(false)\n\n // Auto-open when app is selected, unless user explicitly closed\n const isPanelOpen = selectedApp !== null && !hasUserClosed\n\n // Reset close flag when selectedApp changes\n React.useEffect(() => {\n if (selectedApp) {\n setHasUserClosed(false)\n }\n }, [selectedApp])\n\n // Auto-scroll to selected app (only on initial load)\n const hasScrolledRef = React.useRef(false)\n React.useEffect(() => {\n // Only scroll once on initial load if there's a selection\n if (selectedAppSlug && !hasScrolledRef.current) {\n const rowElement = rowRefs.current.get(selectedAppSlug)\n if (rowElement) {\n rowElement.scrollIntoView({ behavior: 'smooth', block: 'center' })\n }\n hasScrolledRef.current = true\n }\n }, [selectedAppSlug, rowRefs])\n\n const handleAppClick = (app: Resource) => {\n onAppClick?.(app)\n }\n\n const handleClosePanel = () => {\n setHasUserClosed(true)\n onClosePanel?.()\n }\n\n return (\n <ResizablePanelGroup orientation=\"horizontal\" className=\"h-full w-full\">\n {/* Left Panel - Table */}\n <ResizablePanel\n defaultSize={isPanelOpen ? 60 : 100}\n minSize={30}\n className=\"overflow-hidden\"\n >\n <div className=\"h-full overflow-y-auto pr-2 pb-6 [scrollbar-gutter:stable]\">\n <Table>\n <TableHeader className=\"sticky top-0 border-b bg-background z-10\">\n {table.getHeaderGroups().map((headerGroup) => (\n <TableRow key={headerGroup.id}>\n {headerGroup.headers.map((header) => (\n <TableHead\n key={header.id}\n className={cn(\n 'px-4 py-3 text-left font-medium text-sm',\n header.column.columnDef.meta?.className,\n )}\n >\n {header.isPlaceholder\n ? null\n : flexRender(\n header.column.columnDef.header,\n header.getContext(),\n )}\n </TableHead>\n ))}\n </TableRow>\n ))}\n </TableHeader>\n\n <TableBody>\n {groupedApps.map((group) => (\n <React.Fragment key={group.groupName}>\n {/* Group Header Row */}\n <TableRow className=\"bg-muted/50 hover:bg-muted/50\">\n <TableCell\n colSpan={columns.length}\n className=\"px-4 py-6 sticky top-[49px] bg-muted/90 backdrop-blur z-10\"\n >\n <div className=\"flex items-center justify-center\">\n <span className=\"font-serif font-semibold text-lg tracking-widest uppercase leading-loose text-muted-foreground\">\n {group.groupName}\n </span>\n </div>\n </TableCell>\n </TableRow>\n\n {/* Group Apps */}\n {group.apps.map((app) => {\n const row = table\n .getRowModel()\n .rows.find((r) => r.id === app.id)\n if (!row) return null\n\n return (\n <TableRow\n key={row.id}\n ref={(el) => {\n if (el && row.original.slug) {\n rowRefs.current.set(row.original.slug, el)\n } else if (row.original.slug) {\n rowRefs.current.delete(row.original.slug)\n }\n }}\n onClick={() => handleAppClick(row.original)}\n className={cn(\n 'group border-b cursor-pointer transition-colors',\n selectedApp?.id === row.original.id\n ? 'bg-blue-100 dark:bg-blue-950 hover:bg-blue-200 dark:hover:bg-blue-900'\n : 'hover:bg-muted/30',\n )}\n >\n {row.getVisibleCells().map((cell) => (\n <TableCell\n key={cell.id}\n className={cn(\n 'px-4 py-4',\n cell.column.columnDef.meta?.className,\n )}\n >\n {flexRender(\n cell.column.columnDef.cell,\n cell.getContext(),\n )}\n </TableCell>\n ))}\n </TableRow>\n )\n })}\n </React.Fragment>\n ))}\n\n {/* Clear Filters Row */}\n {(totalAppsCount ?? 0) > apps.length && onClearFilters && (\n <TableRow>\n <TableCell\n colSpan={columns.length}\n className=\"px-4 py-8 text-center\"\n >\n <Button\n variant=\"outline\"\n onClick={onClearFilters}\n className=\"gap-2\"\n >\n <X className=\"h-4 w-4\" />\n Clear filters to show all apps ({totalAppsCount})\n </Button>\n </TableCell>\n </TableRow>\n )}\n </TableBody>\n </Table>\n </div>\n </ResizablePanel>\n\n {/* Right Panel - Details (only render when panel is open) */}\n {isPanelOpen && (\n <>\n {/* Resizable Handle */}\n <ResizableHandle withHandle />\n\n <ResizablePanel\n defaultSize={40}\n minSize={25}\n className=\"overflow-hidden\"\n >\n <div className=\"h-full overflow-y-auto border-l bg-background pl-4\">\n {selectedApp ? (\n <div className=\"relative\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"absolute top-4 right-4 z-10 hover:bg-accent\"\n onClick={handleClosePanel}\n aria-label=\"Close details panel\"\n >\n <X className=\"h-5 w-5\" />\n </Button>\n <AppDetails\n app={selectedApp}\n onAppClick={onAppClick}\n onClosePanel={handleClosePanel}\n />\n </div>\n ) : null}\n </div>\n </ResizablePanel>\n </>\n )}\n </ResizablePanelGroup>\n )\n}\n"],"names":["React","_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEA,SAAS,WAAW,UAA0B;AAC5C,SAAO,cAAc,QAAQ;AAC/B;AAEA,SAAS,gBAAgB;AAAA,EACvB;AAAA,EACA;AACF,GAGG;AACD,MAAI,CAAC,aAAa;AAChB,2CAAU,UAAA,KAAA,CAAK;AAAA,EACjB;AAEA,QAAM,WAAW,cAAc,MAAM,WAAW;AAEhD,yCAEK,UAAA,SAAS;AAAA,IAAI,CAAC,SAAS,UACtB,QAAQ,YACN;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,WAAU;AAAA,QAET,UAAA,QAAQ;AAAA,MAAA;AAAA,MAHJ;AAAA,IAAA,IAMP,oBAACA,eAAM,UAAN,EAA4B,UAAA,QAAQ,QAAhB,KAAqB;AAAA,EAAA,GAGhD;AAEJ;AAEA,SAAS,QAAQ,EAAE,KAAK,aAAoD;AAC1E,QAAM,CAAC,YAAY,aAAa,IAAIA,eAAM,SAAS,KAAK;AAGxD,MAAI,IAAI,YAAY,CAAC,YAAY;AAC/B,+BACG,OAAA,EAAI,WAAW,GAAG,oBAAoB,SAAS,GAC9C,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAK,WAAW,IAAI,QAAQ;AAAA,QAC5B,KAAK,GAAG,IAAI,gBAAgB,IAAI,WAAW;AAAA,QAC3C,WAAU;AAAA,QACV,SAAS,MAAM,cAAc,IAAI;AAAA,MAAA;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WAAU;AAAA,gBAEV,UAAA;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,SAAQ;AAAA,oBACR,SAAS;AAAA,oBACT,WAAU;AAAA,oBAEV,UAAA;AAAA,sBAAA,oBAAC,GAAA,EAAE,WAAU,UAAA,CAAU;AAAA,sBAAE;AAAA,sBACQ;AAAA,sBAAe;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAClD;AAAA,YAAA,EACF,CACF;AAAA,UAAA,EAAA,CAEJ;AAAA,QAAA,EAAA,CACF,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,IAID,eACC,qBAAA,UAAA,EAEE,UAAA;AAAA,MAAA,oBAAC,iBAAA,EAAgB,YAAU,KAAA,CAAC;AAAA,MAE5B;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,aAAa;AAAA,UACb,SAAS;AAAA,UACT,WAAU;AAAA,UAEV,UAAA,oBAAC,SAAI,WAAU,sDACZ,wBACC,qBAAC,OAAA,EAAI,WAAU,YACb,UAAA;AAAA,YAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,SAAQ;AAAA,gBACR,MAAK;AAAA,gBACL,WAAU;AAAA,gBACV,SAAS;AAAA,gBACT,cAAW;AAAA,gBAEX,UAAA,oBAAC,GAAA,EAAE,WAAU,UAAA,CAAU;AAAA,cAAA;AAAA,YAAA;AAAA,YAEzB;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,KAAK;AAAA,gBACL;AAAA,gBACA,cAAc;AAAA,cAAA;AAAA,YAAA;AAAA,UAChB,EAAA,CACF,IACE,KAAA,CACN;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,EAAA,CACF;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -1,9 +1,13 @@
1
1
  import { Resource } from '@igstack/app-catalog-backend-core';
2
2
  /**
3
- * Slide-over detail panel for the launcher (#38, item B). Renders the rich
4
- * AppDetails (access-hero, sub-resources, tiers — increments 3/4) as a right
5
- * slide-over over the launcher backdrop, matching the option-a prototype,
6
- * instead of dropping the user into the old grid + resizable split-pane.
3
+ * Centered detail card for the launcher (#38, item B). Renders the rich
4
+ * AppDetails (access-hero, sub-resources, tiers) as a large centered modal card
5
+ * over the launcher backdrop, instead of the old grid + resizable split-pane.
6
+ *
7
+ * Escape handling: this component does NOT globally bind Escape. Escape-to-close
8
+ * is owned by AppDetails' own key handling (which first closes an open
9
+ * screenshot gallery, then closes the card), so pressing Esc inside the gallery
10
+ * returns to the card — not all the way to the home page (#38 Esc-stacking bug).
7
11
  */
8
12
  export declare function LauncherDetailPanel({ app, onClose, onAppClick, }: {
9
13
  app: Resource;
@@ -1,36 +1,28 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { useEffect } from "react";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
3
2
  import { AppDetails } from "../grid/AppCatalogGrid.js";
4
3
  function LauncherDetailPanel({
5
4
  app,
6
5
  onClose,
7
6
  onAppClick
8
7
  }) {
9
- useEffect(() => {
10
- const onKey = (e) => {
11
- if (e.key === "Escape") onClose();
12
- };
13
- document.addEventListener("keydown", onKey);
14
- return () => document.removeEventListener("keydown", onKey);
15
- }, [onClose]);
16
- return /* @__PURE__ */ jsxs(Fragment, { children: [
8
+ return /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-4 sm:p-6 md:p-10", children: [
17
9
  /* @__PURE__ */ jsx(
18
10
  "button",
19
11
  {
20
12
  type: "button",
21
13
  "aria-label": "Close details panel",
22
14
  onClick: onClose,
23
- className: "fixed inset-0 z-40 bg-black/30 backdrop-blur-[2px] animate-in fade-in"
15
+ className: "fixed inset-0 -z-10 bg-black/40 backdrop-blur-[2px] animate-in fade-in"
24
16
  }
25
17
  ),
26
18
  /* @__PURE__ */ jsx(
27
- "aside",
19
+ "div",
28
20
  {
29
21
  role: "dialog",
30
22
  "aria-modal": "true",
31
23
  "aria-label": `${app.displayName} details`,
32
- className: "fixed right-0 top-0 z-50 h-full w-[min(560px,100%)] bg-background shadow-2xl border-l border-border flex flex-col animate-in slide-in-from-right duration-200",
33
- children: /* @__PURE__ */ jsx("div", { className: "overflow-y-auto flex-1 px-6 py-5", children: /* @__PURE__ */ jsx(
24
+ className: "relative w-full max-w-[760px] my-auto rounded-[var(--radius)] border border-border bg-background shadow-2xl animate-in fade-in zoom-in-95 duration-200",
25
+ children: /* @__PURE__ */ jsx("div", { className: "max-h-[85vh] overflow-y-auto px-6 py-5 sm:px-8 sm:py-7", children: /* @__PURE__ */ jsx(
34
26
  AppDetails,
35
27
  {
36
28
  app,
@@ -1 +1 @@
1
- {"version":3,"file":"LauncherDetailPanel.js","sources":["../../../../../../src/modules/appCatalog/ui/launcher/LauncherDetailPanel.tsx"],"sourcesContent":["import type { Resource } from '@igstack/app-catalog-backend-core'\nimport { useEffect } from 'react'\nimport { AppDetails } from '../grid/AppCatalogGrid'\n\n/**\n * Slide-over detail panel for the launcher (#38, item B). Renders the rich\n * AppDetails (access-hero, sub-resources, tiers — increments 3/4) as a right\n * slide-over over the launcher backdrop, matching the option-a prototype,\n * instead of dropping the user into the old grid + resizable split-pane.\n */\nexport function LauncherDetailPanel({\n app,\n onClose,\n onAppClick,\n}: {\n app: Resource\n onClose: () => void\n onAppClick?: (app: Resource) => void\n}) {\n // Close on Escape.\n useEffect(() => {\n const onKey = (e: KeyboardEvent) => {\n if (e.key === 'Escape') onClose()\n }\n document.addEventListener('keydown', onKey)\n return () => document.removeEventListener('keydown', onKey)\n }, [onClose])\n\n return (\n <>\n {/* scrim */}\n <button\n type=\"button\"\n aria-label=\"Close details panel\"\n onClick={onClose}\n className=\"fixed inset-0 z-40 bg-black/30 backdrop-blur-[2px] animate-in fade-in\"\n />\n {/* panel */}\n <aside\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={`${app.displayName} details`}\n className=\"fixed right-0 top-0 z-50 h-full w-[min(560px,100%)] bg-background shadow-2xl border-l border-border flex flex-col animate-in slide-in-from-right duration-200\"\n >\n <div className=\"overflow-y-auto flex-1 px-6 py-5\">\n <AppDetails\n app={app}\n onAppClick={onAppClick}\n onClosePanel={onClose}\n />\n </div>\n </aside>\n </>\n )\n}\n"],"names":[],"mappings":";;;AAUO,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AACF,GAIG;AAED,YAAU,MAAM;AACd,UAAM,QAAQ,CAAC,MAAqB;AAClC,UAAI,EAAE,QAAQ,SAAU,SAAA;AAAA,IAC1B;AACA,aAAS,iBAAiB,WAAW,KAAK;AAC1C,WAAO,MAAM,SAAS,oBAAoB,WAAW,KAAK;AAAA,EAC5D,GAAG,CAAC,OAAO,CAAC;AAEZ,SACE,qBAAA,UAAA,EAEE,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,cAAW;AAAA,QACX,SAAS;AAAA,QACT,WAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAGZ;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,cAAW;AAAA,QACX,cAAY,GAAG,IAAI,WAAW;AAAA,QAC9B,WAAU;AAAA,QAEV,UAAA,oBAAC,OAAA,EAAI,WAAU,oCACb,UAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA,cAAc;AAAA,UAAA;AAAA,QAAA,EAChB,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"LauncherDetailPanel.js","sources":["../../../../../../src/modules/appCatalog/ui/launcher/LauncherDetailPanel.tsx"],"sourcesContent":["import type { Resource } from '@igstack/app-catalog-backend-core'\nimport { AppDetails } from '../grid/AppCatalogGrid'\n\n/**\n * Centered detail card for the launcher (#38, item B). Renders the rich\n * AppDetails (access-hero, sub-resources, tiers) as a large centered modal card\n * over the launcher backdrop, instead of the old grid + resizable split-pane.\n *\n * Escape handling: this component does NOT globally bind Escape. Escape-to-close\n * is owned by AppDetails' own key handling (which first closes an open\n * screenshot gallery, then closes the card), so pressing Esc inside the gallery\n * returns to the card — not all the way to the home page (#38 Esc-stacking bug).\n */\nexport function LauncherDetailPanel({\n app,\n onClose,\n onAppClick,\n}: {\n app: Resource\n onClose: () => void\n onAppClick?: (app: Resource) => void\n}) {\n return (\n <div className=\"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-4 sm:p-6 md:p-10\">\n {/* scrim */}\n <button\n type=\"button\"\n aria-label=\"Close details panel\"\n onClick={onClose}\n className=\"fixed inset-0 -z-10 bg-black/40 backdrop-blur-[2px] animate-in fade-in\"\n />\n {/* centered card */}\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={`${app.displayName} details`}\n className=\"relative w-full max-w-[760px] my-auto rounded-[var(--radius)] border border-border bg-background shadow-2xl animate-in fade-in zoom-in-95 duration-200\"\n >\n <div className=\"max-h-[85vh] overflow-y-auto px-6 py-5 sm:px-8 sm:py-7\">\n <AppDetails\n app={app}\n onAppClick={onAppClick}\n onClosePanel={onClose}\n />\n </div>\n </div>\n </div>\n )\n}\n"],"names":[],"mappings":";;AAaO,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,SACE,qBAAC,OAAA,EAAI,WAAU,yFAEb,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,cAAW;AAAA,QACX,SAAS;AAAA,QACT,WAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAGZ;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,cAAW;AAAA,QACX,cAAY,GAAG,IAAI,WAAW;AAAA,QAC9B,WAAU;AAAA,QAEV,UAAA,oBAAC,OAAA,EAAI,WAAU,0DACb,UAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA,cAAc;AAAA,UAAA;AAAA,QAAA,EAChB,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
@@ -7,7 +7,7 @@ import { markdownToPlainText } from "../../utils/markdownToPlainText.js";
7
7
  import { ResourceIcon } from "./ResourceIcon.js";
8
8
  import { searchResources } from "../../utils/searchApps.js";
9
9
  const typeLabel = (t) => {
10
- if (!t || t === "application") return "App";
10
+ if (!t || t === "application") return null;
11
11
  return t.charAt(0).toUpperCase() + t.slice(1);
12
12
  };
13
13
  function LaunchButton({
@@ -16,14 +16,15 @@ function LaunchButton({
16
16
  className
17
17
  }) {
18
18
  if (!app.appUrl) return null;
19
+ const prettyUrl = app.appUrl.replace(/^https?:\/\//, "");
19
20
  return /* @__PURE__ */ jsx(
20
21
  "a",
21
22
  {
22
23
  href: app.appUrl,
23
24
  target: "_blank",
24
25
  rel: "noopener noreferrer",
25
- title: `Open ${app.displayName} in a new tab`,
26
- "aria-label": `Open ${app.displayName} in a new tab`,
26
+ title: `Open → ${prettyUrl}`,
27
+ "aria-label": `Open ${app.displayName} in a new tab (${prettyUrl})`,
27
28
  onClick: (e) => {
28
29
  e.stopPropagation();
29
30
  onLaunch(app);
@@ -72,7 +73,7 @@ function ResourceRow({
72
73
  app.description && /* @__PURE__ */ jsx("span", { className: "block text-[13px] text-muted-foreground truncate", children: markdownToPlainText(app.description) })
73
74
  ] }),
74
75
  showNew && /* @__PURE__ */ jsx("span", { className: "text-[11px] font-bold text-[#65a443] bg-[#65a443]/12 rounded-full px-2.5 py-0.5", children: "New" }),
75
- /* @__PURE__ */ jsx("span", { className: "text-[12px] text-muted-foreground bg-muted rounded-full px-2.5 py-0.5 whitespace-nowrap", children: typeLabel(app.type) }),
76
+ typeLabel(app.type) && /* @__PURE__ */ jsx("span", { className: "text-[12px] text-muted-foreground bg-muted rounded-full px-2.5 py-0.5 whitespace-nowrap", children: typeLabel(app.type) }),
76
77
  /* @__PURE__ */ jsx(LaunchButton, { app, onLaunch, className: "size-8" })
77
78
  ]
78
79
  }
@@ -90,6 +91,21 @@ function SearchResultsList({
90
91
  () => searchResources(apps, searchValue),
91
92
  [apps, searchValue]
92
93
  );
94
+ const matchedChildrenByParent = useMemo(() => {
95
+ const q = searchValue.trim().toLowerCase();
96
+ const map = /* @__PURE__ */ new Map();
97
+ if (!q) return map;
98
+ const resultSlugs = new Set(results.map((r) => r.slug));
99
+ for (const r of apps) {
100
+ if (!r.parentSlug || !resultSlugs.has(r.parentSlug)) continue;
101
+ const hay = `${r.displayName} ${r.abbreviation ?? ""} ${(r.aliases ?? []).join(" ")} ${r.description ?? ""}`.toLowerCase();
102
+ if (!hay.includes(q)) continue;
103
+ const list = map.get(r.parentSlug) ?? [];
104
+ list.push(r);
105
+ map.set(r.parentSlug, list);
106
+ }
107
+ return map;
108
+ }, [apps, results, searchValue]);
93
109
  const didDeprecatedFallback = useMemo(
94
110
  () => results.length > 0 && results.every((r) => Boolean(r.deprecated)),
95
111
  [results]
@@ -163,9 +179,25 @@ function SearchResultsList({
163
179
  ")"
164
180
  ] })
165
181
  ] }),
166
- app.description && /* @__PURE__ */ jsx("span", { className: "block text-[12.5px] text-muted-foreground truncate", children: markdownToPlainText(app.description) })
182
+ app.description && /* @__PURE__ */ jsx("span", { className: "block text-[12.5px] text-muted-foreground truncate", children: markdownToPlainText(app.description) }),
183
+ (() => {
184
+ const kids = matchedChildrenByParent.get(app.slug);
185
+ if (!kids || kids.length === 0) return null;
186
+ const names = kids.map((k) => k.displayName);
187
+ const shown = names.slice(0, 3).join(", ");
188
+ const extra = names.length > 3 ? ` +${names.length - 3} more` : "";
189
+ return /* @__PURE__ */ jsxs("span", { className: "mt-0.5 block text-[12px] text-primary truncate", children: [
190
+ "Matched ",
191
+ kids.length,
192
+ " sub-resource",
193
+ kids.length === 1 ? "" : "s",
194
+ ": ",
195
+ shown,
196
+ extra
197
+ ] });
198
+ })()
167
199
  ] }),
168
- /* @__PURE__ */ jsx("span", { className: "text-[11.5px] text-muted-foreground bg-muted rounded-full px-2.5 py-0.5 whitespace-nowrap shrink-0", children: typeLabel(app.type) }),
200
+ typeLabel(app.type) && /* @__PURE__ */ jsx("span", { className: "text-[11.5px] text-muted-foreground bg-muted rounded-full px-2.5 py-0.5 whitespace-nowrap shrink-0", children: typeLabel(app.type) }),
169
201
  /* @__PURE__ */ jsx(
170
202
  LaunchButton,
171
203
  {
@@ -1 +1 @@
1
- {"version":3,"file":"LauncherHome.js","sources":["../../../../../../src/modules/appCatalog/ui/launcher/LauncherHome.tsx"],"sourcesContent":["import type { Resource } from '@igstack/app-catalog-backend-core'\nimport { ArrowUpRight, Search } from 'lucide-react'\nimport { useEffect, useMemo, useRef, useState } from 'react'\nimport { cn } from '~/lib/utils'\nimport { useAppClickHistory } from '../../hooks/useAppClickHistory'\nimport { markdownToPlainText } from '../../utils/markdownToPlainText'\nimport { ResourceIcon } from './ResourceIcon'\nimport { searchResources } from '../../utils/searchApps'\n\n/**\n * Adaptive-home discovery spine (issue #38, increment 1) — matches the\n * option-a-launcher prototype:\n * Your apps (frequent) → New this week → Browse all\n * Rendered by AppCatalogPage when there is no active search and no open detail.\n * The hero search box drives the same `searchValue` used elsewhere; typing hands\n * off to the results view (increment 2 refines the morph).\n */\n\nconst typeLabel = (t?: string): string => {\n if (!t || t === 'application') return 'App'\n return t.charAt(0).toUpperCase() + t.slice(1)\n}\n\nexport interface LauncherHomeProps {\n /** All root (non-child) resources, already filtered for deprecated per settings. */\n apps: Resource[]\n /**\n * All resources INCLUDING children/sub-resources. Passed to search so a query\n * matching a sub-resource (e.g. an AWS account, an alias/account ID) surfaces\n * its parent — preserving the existing cross-sub-resource search behavior.\n * Falls back to `apps` when omitted.\n */\n allResources?: Resource[]\n searchValue: string\n onSearchChange: (v: string) => void\n onAppClick: (app: Resource) => void\n onLaunch: (app: Resource) => void\n /** Total resource count for the \"Browse all\" label. */\n totalCount: number\n}\n\nfunction LaunchButton({\n app,\n onLaunch,\n className,\n}: {\n app: Resource\n onLaunch: (app: Resource) => void\n className?: string\n}) {\n if (!app.appUrl) return null\n return (\n <a\n href={app.appUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n title={`Open ${app.displayName} in a new tab`}\n aria-label={`Open ${app.displayName} in a new tab`}\n onClick={(e) => {\n e.stopPropagation()\n onLaunch(app)\n }}\n className={cn(\n 'grid place-items-center rounded-full border border-border bg-card text-muted-foreground',\n 'hover:bg-primary hover:text-primary-foreground hover:border-primary transition-colors',\n className,\n )}\n >\n <ArrowUpRight className=\"size-3.5\" />\n </a>\n )\n}\n\nfunction SectionHead({\n title,\n count,\n action,\n}: {\n title: string\n count?: string\n action?: React.ReactNode\n}) {\n return (\n <div className=\"flex items-center gap-2.5 mb-4\">\n <h2 className=\"font-serif font-semibold text-[15px] tracking-tight m-0\">\n {title}\n </h2>\n {count && (\n <span className=\"text-[13px] text-muted-foreground bg-muted rounded-full px-2.5 py-0.5\">\n {count}\n </span>\n )}\n {action && <div className=\"ml-auto\">{action}</div>}\n </div>\n )\n}\n\n/** Small row used by \"New this week\" and \"Browse all\". */\nfunction ResourceRow({\n app,\n onAppClick,\n onLaunch,\n showNew = false,\n}: {\n app: Resource\n onAppClick: (app: Resource) => void\n onLaunch: (app: Resource) => void\n showNew?: boolean\n}) {\n return (\n <button\n type=\"button\"\n onClick={() => onAppClick(app)}\n title={`View ${app.displayName}`}\n className={cn(\n 'group flex items-center gap-3.5 w-full text-left',\n 'bg-card border border-border rounded-[var(--radius)] px-3.5 py-3',\n 'hover:border-ring hover:shadow-sm transition-all',\n )}\n >\n <ResourceIcon app={app} size={38} />\n <span className=\"flex-1 min-w-0\">\n <span className=\"block text-[14.5px] font-semibold truncate\">\n {app.displayName}\n </span>\n {app.description && (\n <span className=\"block text-[13px] text-muted-foreground truncate\">\n {markdownToPlainText(app.description)}\n </span>\n )}\n </span>\n {showNew && (\n <span className=\"text-[11px] font-bold text-[#65a443] bg-[#65a443]/12 rounded-full px-2.5 py-0.5\">\n New\n </span>\n )}\n <span className=\"text-[12px] text-muted-foreground bg-muted rounded-full px-2.5 py-0.5 whitespace-nowrap\">\n {typeLabel(app.type)}\n </span>\n <LaunchButton app={app} onLaunch={onLaunch} className=\"size-8\" />\n </button>\n )\n}\n\n/**\n * Keyboard-navigable search results list — increment 2 of the launcher redesign.\n * Appears below the hero search box when the user types, replacing the\n * discovery spine. Pressing ↑↓ navigates, ↵ opens detail, Esc clears.\n */\nfunction SearchResultsList({\n apps,\n searchValue,\n onAppClick,\n onLaunch,\n onClear,\n}: {\n apps: Resource[]\n searchValue: string\n onAppClick: (app: Resource) => void\n onLaunch: (app: Resource) => void\n onClear: () => void\n}) {\n const [focusedIndex, setFocusedIndex] = useState(-1)\n\n const results = useMemo(\n () => searchResources(apps, searchValue),\n [apps, searchValue],\n )\n\n // #11 deprecated fallback: when EVERY match is a deprecated app (i.e. there\n // are no active matches for the query, only deprecated ones), surface a\n // notice so the user understands why they're seeing archived tools. The\n // deprecated apps are already in `results` because the launcher feeds search\n // the full resource set; this just labels the situation.\n const didDeprecatedFallback = useMemo(\n () => results.length > 0 && results.every((r) => Boolean(r.deprecated)),\n [results],\n )\n\n // Reset focus when results change\n useEffect(() => {\n setFocusedIndex(-1)\n }, [searchValue])\n\n useEffect(() => {\n const onKey = (e: KeyboardEvent) => {\n if (results.length === 0) return\n if (e.key === 'ArrowDown') {\n e.preventDefault()\n setFocusedIndex((i) => Math.min(i + 1, results.length - 1))\n } else if (e.key === 'ArrowUp') {\n e.preventDefault()\n setFocusedIndex((i) => Math.max(i - 1, 0))\n } else if (e.key === 'Enter') {\n if (focusedIndex >= 0 && results[focusedIndex]) {\n onAppClick(results[focusedIndex])\n }\n } else if (e.key === 'Escape') {\n onClear()\n }\n }\n document.addEventListener('keydown', onKey)\n return () => document.removeEventListener('keydown', onKey)\n }, [results, focusedIndex, onAppClick, onClear])\n\n return (\n <div className=\"max-w-[620px] mx-auto mt-3\">\n {/* Meta line */}\n <div className=\"text-[13px] text-muted-foreground mb-2 px-1\">\n {results.length === 0\n ? `No results for \"${searchValue}\"`\n : `${results.length} result${results.length === 1 ? '' : 's'}`}\n </div>\n\n {/* #11: deprecated-only fallback notice */}\n {didDeprecatedFallback && (\n <div\n role=\"status\"\n className=\"text-[13px] text-muted-foreground mb-2 px-1\"\n >\n No active apps for &quot;{searchValue}&quot; — showing deprecated\n matches.\n </div>\n )}\n\n {/* Results */}\n <div\n className=\"flex flex-col gap-1.5\"\n role=\"listbox\"\n aria-label=\"Search results\"\n >\n {results.map((app, i) => (\n <button\n key={app.slug}\n type=\"button\"\n role=\"option\"\n title={`View ${app.displayName}`}\n aria-selected={focusedIndex === i}\n onMouseEnter={() => setFocusedIndex(i)}\n onClick={() => onAppClick(app)}\n className={cn(\n 'group flex items-center gap-3.5 w-full text-left',\n 'bg-card border rounded-[var(--radius)] px-3.5 py-2.5',\n 'transition-all',\n focusedIndex === i\n ? 'border-ring shadow-sm bg-muted/30'\n : 'border-border hover:border-ring hover:shadow-sm',\n )}\n >\n <ResourceIcon app={app} size={40} />\n <span className=\"flex-1 min-w-0\">\n <span className=\"block text-[14px] font-semibold truncate\">\n {app.displayName}\n {app.abbreviation && app.abbreviation !== app.displayName && (\n <span className=\"ml-1.5 text-[12px] font-normal text-muted-foreground\">\n ({app.abbreviation})\n </span>\n )}\n </span>\n {app.description && (\n <span className=\"block text-[12.5px] text-muted-foreground truncate\">\n {markdownToPlainText(app.description)}\n </span>\n )}\n </span>\n <span className=\"text-[11.5px] text-muted-foreground bg-muted rounded-full px-2.5 py-0.5 whitespace-nowrap shrink-0\">\n {typeLabel(app.type)}\n </span>\n <LaunchButton\n app={app}\n onLaunch={onLaunch}\n className=\"size-7 shrink-0 opacity-0 group-hover:opacity-100\"\n />\n </button>\n ))}\n </div>\n\n {/* Keyboard hint */}\n {results.length > 0 && (\n <p className=\"text-[11.5px] text-muted-foreground/60 text-center mt-3\">\n ↑↓ navigate · ↵ view access · esc clear\n </p>\n )}\n </div>\n )\n}\n\nexport function LauncherHome({\n apps,\n allResources,\n searchValue,\n onSearchChange,\n onAppClick,\n onLaunch,\n totalCount,\n}: LauncherHomeProps) {\n const { getTopApps } = useAppClickHistory()\n const [topSlugs, setTopSlugs] = useState<string[]>([])\n\n useEffect(() => {\n void getTopApps(5).then(setTopSlugs)\n }, [getTopApps])\n\n const bySlug = useMemo(() => {\n const m = new Map<string, Resource>()\n for (const a of apps) m.set(a.slug, a)\n return m\n }, [apps])\n\n // Your apps: frequently-clicked (personalized). Empty on a cold new machine.\n const frequent = useMemo(\n () =>\n topSlugs\n .map((s) => bySlug.get(s))\n .filter((a): a is Resource => Boolean(a))\n .slice(0, 5),\n [topSlugs, bySlug],\n )\n\n // New this week: apps whose sources were checked in the last 7 days, as a\n // proxy for \"recently added/updated\" (frontend Resource has no createdAt yet;\n // see #38). Falls back to empty (section hidden) when no freshness data.\n const fresh = useMemo(() => {\n const weekAgo = Date.now() - 7 * 24 * 60 * 60 * 1000\n return apps\n .filter((a) => {\n const t = a.freshness?.lastCheckedAt\n return t ? new Date(t).getTime() >= weekAgo : false\n })\n .sort((a, b) => {\n const ta = new Date(a.freshness?.lastCheckedAt ?? 0).getTime()\n const tb = new Date(b.freshness?.lastCheckedAt ?? 0).getTime()\n return tb - ta\n })\n .slice(0, 6)\n }, [apps])\n\n // Browse all: everything not already promoted to \"Your apps\", alpha by name.\n const browse = useMemo(() => {\n const promoted = new Set(frequent.map((a) => a.slug))\n return [...apps]\n .filter((a) => !promoted.has(a.slug))\n .sort((a, b) => a.displayName.localeCompare(b.displayName))\n }, [apps, frequent])\n\n const browseLeft = browse.filter((_, i) => i % 2 === 0)\n const browseRight = browse.filter((_, i) => i % 2 === 1)\n\n const isSearching = searchValue.trim() !== ''\n const searchRef = useRef<HTMLInputElement>(null)\n\n // ⌘K / Ctrl+K focuses the hero search box from anywhere on the page.\n useEffect(() => {\n const onKey = (e: KeyboardEvent) => {\n if ((e.metaKey || e.ctrlKey) && e.key === 'k') {\n e.preventDefault()\n searchRef.current?.focus()\n }\n }\n document.addEventListener('keydown', onKey)\n return () => document.removeEventListener('keydown', onKey)\n }, [])\n\n return (\n <div className=\"mx-auto w-full max-w-[1000px] pb-24\">\n {/* hero */}\n <div className=\"text-center pt-10 pb-1.5\">\n <h1 className=\"font-serif font-semibold text-[30px] tracking-tight m-0 mb-1.5\">\n What do you need to get into?\n </h1>\n <p className=\"text-muted-foreground m-0 mb-6 text-[15px]\">\n Find any tool, see how to request access, or jump straight in.\n </p>\n <div className=\"max-w-[620px] mx-auto\">\n <div className=\"flex items-center gap-3 bg-card border-[1.5px] border-input rounded-full px-5 h-14 shadow-sm focus-within:border-primary focus-within:ring-4 focus-within:ring-primary/15 transition-colors\">\n <Search className=\"size-5 shrink-0 text-muted-foreground\" />\n <input\n type=\"text\"\n value={searchValue}\n onChange={(e) => onSearchChange(e.target.value)}\n placeholder=\"Search apps, databases, cloud accounts, account IDs…\"\n autoComplete=\"off\"\n autoFocus\n ref={searchRef}\n aria-label=\"Search apps\"\n className=\"flex-1 bg-transparent border-0 outline-none text-[16px] text-foreground placeholder:text-muted-foreground\"\n />\n {!isSearching && (\n <kbd className=\"hidden sm:inline-flex items-center gap-0.5 text-[11px] text-muted-foreground/60 border border-muted-foreground/20 rounded px-1.5 py-0.5 font-mono shrink-0\">\n {typeof navigator !== 'undefined' &&\n navigator.platform.includes('Mac')\n ? '⌘K'\n : 'Ctrl+K'}\n </kbd>\n )}\n </div>\n </div>\n </div>\n\n {/* Search morph: when typing, show compact results list instead of the discovery spine */}\n {isSearching && (\n <SearchResultsList\n apps={allResources ?? apps}\n searchValue={searchValue}\n onAppClick={onAppClick}\n onLaunch={onLaunch}\n onClear={() => onSearchChange('')}\n />\n )}\n\n {/* Discovery spine: only shown when not searching */}\n {!isSearching && (\n <>\n {/* Your apps */}\n {frequent.length > 0 && (\n <section className=\"mt-9\">\n <SectionHead title=\"Your apps\" count=\"frequent\" />\n <div className=\"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 gap-3.5\">\n {frequent.map((app) => (\n <button\n type=\"button\"\n key={app.slug}\n onClick={() => onAppClick(app)}\n title={`View ${app.displayName}`}\n className=\"group relative bg-card border border-border rounded-[var(--radius)] px-3.5 pt-[18px] pb-4 text-center shadow-sm hover:-translate-y-0.5 hover:shadow-md transition-all\"\n >\n <LaunchButton\n app={app}\n onLaunch={onLaunch}\n className=\"absolute top-2.5 right-2.5 size-[26px] opacity-0 group-hover:opacity-100\"\n />\n <ResourceIcon\n app={app}\n size={46}\n className=\"mx-auto mb-3\"\n />\n <span className=\"block text-[13.5px] font-bold truncate\">\n {app.displayName}\n </span>\n </button>\n ))}\n </div>\n </section>\n )}\n\n {/* New this week */}\n {fresh.length > 0 && (\n <section className=\"mt-9\">\n <SectionHead\n title=\"New this week\"\n count={`${fresh.length} added`}\n />\n <div className=\"flex flex-col gap-2\">\n {fresh.map((app) => (\n <ResourceRow\n key={app.slug}\n app={app}\n onAppClick={onAppClick}\n onLaunch={onLaunch}\n showNew\n />\n ))}\n </div>\n </section>\n )}\n\n {/* Browse all */}\n <section className=\"mt-9\">\n <SectionHead title=\"Browse all\" count={`${totalCount} resources`} />\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-2\">\n <div className=\"flex flex-col gap-2\">\n {browseLeft.map((app) => (\n <ResourceRow\n key={app.slug}\n app={app}\n onAppClick={onAppClick}\n onLaunch={onLaunch}\n />\n ))}\n </div>\n <div className=\"flex flex-col gap-2\">\n {browseRight.map((app) => (\n <ResourceRow\n key={app.slug}\n app={app}\n onAppClick={onAppClick}\n onLaunch={onLaunch}\n />\n ))}\n </div>\n </div>\n </section>\n </>\n )}\n </div>\n )\n}\n"],"names":[],"mappings":";;;;;;;;AAkBA,MAAM,YAAY,CAAC,MAAuB;AACxC,MAAI,CAAC,KAAK,MAAM,cAAe,QAAO;AACtC,SAAO,EAAE,OAAO,CAAC,EAAE,gBAAgB,EAAE,MAAM,CAAC;AAC9C;AAoBA,SAAS,aAAa;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,MAAI,CAAC,IAAI,OAAQ,QAAO;AACxB,S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YAHK,IAAI;AAAA,UAAA,CAKZ,GACH;AAAA,8BACC,OAAA,EAAI,WAAU,uBACZ,UAAA,YAAY,IAAI,CAAC,QAChB;AAAA,YAAC;AAAA,YAAA;AAAA,cAEC;AAAA,cACA;AAAA,cACA;AAAA,YAAA;AAAA,YAHK,IAAI;AAAA,UAAA,CAKZ,EAAA,CACH;AAAA,QAAA,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"LauncherHome.js","sources":["../../../../../../src/modules/appCatalog/ui/launcher/LauncherHome.tsx"],"sourcesContent":["import type { Resource } from '@igstack/app-catalog-backend-core'\nimport { ArrowUpRight, Search } from 'lucide-react'\nimport { useEffect, useMemo, useRef, useState } from 'react'\nimport { cn } from '~/lib/utils'\nimport { useAppClickHistory } from '../../hooks/useAppClickHistory'\nimport { markdownToPlainText } from '../../utils/markdownToPlainText'\nimport { ResourceIcon } from './ResourceIcon'\nimport { searchResources } from '../../utils/searchApps'\n\n/**\n * Adaptive-home discovery spine (issue #38, increment 1) — matches the\n * option-a-launcher prototype:\n * Your apps (frequent) → New this week → Browse all\n * Rendered by AppCatalogPage when there is no active search and no open detail.\n * The hero search box drives the same `searchValue` used elsewhere; typing hands\n * off to the results view (increment 2 refines the morph).\n */\n\n// Type pill text. Plain \"application\" resources are the common case and don't\n// need a badge (the user asked not to show a bare \"App\" badge); only surface a\n// pill for distinctive types (database, cloud, service, …).\nconst typeLabel = (t?: string): string | null => {\n if (!t || t === 'application') return null\n return t.charAt(0).toUpperCase() + t.slice(1)\n}\n\nexport interface LauncherHomeProps {\n /** All root (non-child) resources, already filtered for deprecated per settings. */\n apps: Resource[]\n /**\n * All resources INCLUDING children/sub-resources. Passed to search so a query\n * matching a sub-resource (e.g. an AWS account, an alias/account ID) surfaces\n * its parent — preserving the existing cross-sub-resource search behavior.\n * Falls back to `apps` when omitted.\n */\n allResources?: Resource[]\n searchValue: string\n onSearchChange: (v: string) => void\n onAppClick: (app: Resource) => void\n onLaunch: (app: Resource) => void\n /** Total resource count for the \"Browse all\" label. */\n totalCount: number\n}\n\nfunction LaunchButton({\n app,\n onLaunch,\n className,\n}: {\n app: Resource\n onLaunch: (app: Resource) => void\n className?: string\n}) {\n if (!app.appUrl) return null\n // Show the destination URL on hover (user ask) — the native title tooltip\n // reveals where the ↗ jumps to, e.g. \"Open → console.aws.amazon.com\".\n const prettyUrl = app.appUrl.replace(/^https?:\\/\\//, '')\n return (\n <a\n href={app.appUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n title={`Open → ${prettyUrl}`}\n aria-label={`Open ${app.displayName} in a new tab (${prettyUrl})`}\n onClick={(e) => {\n e.stopPropagation()\n onLaunch(app)\n }}\n className={cn(\n 'grid place-items-center rounded-full border border-border bg-card text-muted-foreground',\n 'hover:bg-primary hover:text-primary-foreground hover:border-primary transition-colors',\n className,\n )}\n >\n <ArrowUpRight className=\"size-3.5\" />\n </a>\n )\n}\n\nfunction SectionHead({\n title,\n count,\n action,\n}: {\n title: string\n count?: string\n action?: React.ReactNode\n}) {\n return (\n <div className=\"flex items-center gap-2.5 mb-4\">\n <h2 className=\"font-serif font-semibold text-[15px] tracking-tight m-0\">\n {title}\n </h2>\n {count && (\n <span className=\"text-[13px] text-muted-foreground bg-muted rounded-full px-2.5 py-0.5\">\n {count}\n </span>\n )}\n {action && <div className=\"ml-auto\">{action}</div>}\n </div>\n )\n}\n\n/** Small row used by \"New this week\" and \"Browse all\". */\nfunction ResourceRow({\n app,\n onAppClick,\n onLaunch,\n showNew = false,\n}: {\n app: Resource\n onAppClick: (app: Resource) => void\n onLaunch: (app: Resource) => void\n showNew?: boolean\n}) {\n return (\n <button\n type=\"button\"\n onClick={() => onAppClick(app)}\n title={`View ${app.displayName}`}\n className={cn(\n 'group flex items-center gap-3.5 w-full text-left',\n 'bg-card border border-border rounded-[var(--radius)] px-3.5 py-3',\n 'hover:border-ring hover:shadow-sm transition-all',\n )}\n >\n <ResourceIcon app={app} size={38} />\n <span className=\"flex-1 min-w-0\">\n <span className=\"block text-[14.5px] font-semibold truncate\">\n {app.displayName}\n </span>\n {app.description && (\n <span className=\"block text-[13px] text-muted-foreground truncate\">\n {markdownToPlainText(app.description)}\n </span>\n )}\n </span>\n {showNew && (\n <span className=\"text-[11px] font-bold text-[#65a443] bg-[#65a443]/12 rounded-full px-2.5 py-0.5\">\n New\n </span>\n )}\n {typeLabel(app.type) && (\n <span className=\"text-[12px] text-muted-foreground bg-muted rounded-full px-2.5 py-0.5 whitespace-nowrap\">\n {typeLabel(app.type)}\n </span>\n )}\n <LaunchButton app={app} onLaunch={onLaunch} className=\"size-8\" />\n </button>\n )\n}\n\n/**\n * Keyboard-navigable search results list — increment 2 of the launcher redesign.\n * Appears below the hero search box when the user types, replacing the\n * discovery spine. Pressing ↑↓ navigates, ↵ opens detail, Esc clears.\n */\nfunction SearchResultsList({\n apps,\n searchValue,\n onAppClick,\n onLaunch,\n onClear,\n}: {\n apps: Resource[]\n searchValue: string\n onAppClick: (app: Resource) => void\n onLaunch: (app: Resource) => void\n onClear: () => void\n}) {\n const [focusedIndex, setFocusedIndex] = useState(-1)\n\n const results = useMemo(\n () => searchResources(apps, searchValue),\n [apps, searchValue],\n )\n\n // For each result, the child/sub-resources of it that themselves match the\n // query — so a parent surfaced only via its children (e.g. AWS Console via a\n // \"biom\" account) tells the user WHICH sub-resources matched, instead of an\n // unexplained parent. Keyed by parent slug.\n const matchedChildrenByParent = useMemo(() => {\n const q = searchValue.trim().toLowerCase()\n const map = new Map<string, Resource[]>()\n if (!q) return map\n const resultSlugs = new Set(results.map((r) => r.slug))\n for (const r of apps) {\n if (!r.parentSlug || !resultSlugs.has(r.parentSlug)) continue\n const hay = `${r.displayName} ${r.abbreviation ?? ''} ${(\n r.aliases ?? []\n ).join(' ')} ${r.description ?? ''}`.toLowerCase()\n if (!hay.includes(q)) continue\n const list = map.get(r.parentSlug) ?? []\n list.push(r)\n map.set(r.parentSlug, list)\n }\n return map\n }, [apps, results, searchValue])\n\n // #11 deprecated fallback: when EVERY match is a deprecated app (i.e. there\n // are no active matches for the query, only deprecated ones), surface a\n // notice so the user understands why they're seeing archived tools. The\n // deprecated apps are already in `results` because the launcher feeds search\n // the full resource set; this just labels the situation.\n const didDeprecatedFallback = useMemo(\n () => results.length > 0 && results.every((r) => Boolean(r.deprecated)),\n [results],\n )\n\n // Reset focus when results change\n useEffect(() => {\n setFocusedIndex(-1)\n }, [searchValue])\n\n useEffect(() => {\n const onKey = (e: KeyboardEvent) => {\n if (results.length === 0) return\n if (e.key === 'ArrowDown') {\n e.preventDefault()\n setFocusedIndex((i) => Math.min(i + 1, results.length - 1))\n } else if (e.key === 'ArrowUp') {\n e.preventDefault()\n setFocusedIndex((i) => Math.max(i - 1, 0))\n } else if (e.key === 'Enter') {\n if (focusedIndex >= 0 && results[focusedIndex]) {\n onAppClick(results[focusedIndex])\n }\n } else if (e.key === 'Escape') {\n onClear()\n }\n }\n document.addEventListener('keydown', onKey)\n return () => document.removeEventListener('keydown', onKey)\n }, [results, focusedIndex, onAppClick, onClear])\n\n return (\n <div className=\"max-w-[620px] mx-auto mt-3\">\n {/* Meta line */}\n <div className=\"text-[13px] text-muted-foreground mb-2 px-1\">\n {results.length === 0\n ? `No results for \"${searchValue}\"`\n : `${results.length} result${results.length === 1 ? '' : 's'}`}\n </div>\n\n {/* #11: deprecated-only fallback notice */}\n {didDeprecatedFallback && (\n <div\n role=\"status\"\n className=\"text-[13px] text-muted-foreground mb-2 px-1\"\n >\n No active apps for &quot;{searchValue}&quot; — showing deprecated\n matches.\n </div>\n )}\n\n {/* Results */}\n <div\n className=\"flex flex-col gap-1.5\"\n role=\"listbox\"\n aria-label=\"Search results\"\n >\n {results.map((app, i) => (\n <button\n key={app.slug}\n type=\"button\"\n role=\"option\"\n title={`View ${app.displayName}`}\n aria-selected={focusedIndex === i}\n onMouseEnter={() => setFocusedIndex(i)}\n onClick={() => onAppClick(app)}\n className={cn(\n 'group flex items-center gap-3.5 w-full text-left',\n 'bg-card border rounded-[var(--radius)] px-3.5 py-2.5',\n 'transition-all',\n focusedIndex === i\n ? 'border-ring shadow-sm bg-muted/30'\n : 'border-border hover:border-ring hover:shadow-sm',\n )}\n >\n <ResourceIcon app={app} size={40} />\n <span className=\"flex-1 min-w-0\">\n <span className=\"block text-[14px] font-semibold truncate\">\n {app.displayName}\n {app.abbreviation && app.abbreviation !== app.displayName && (\n <span className=\"ml-1.5 text-[12px] font-normal text-muted-foreground\">\n ({app.abbreviation})\n </span>\n )}\n </span>\n {app.description && (\n <span className=\"block text-[12.5px] text-muted-foreground truncate\">\n {markdownToPlainText(app.description)}\n </span>\n )}\n {(() => {\n const kids = matchedChildrenByParent.get(app.slug)\n if (!kids || kids.length === 0) return null\n const names = kids.map((k) => k.displayName)\n const shown = names.slice(0, 3).join(', ')\n const extra =\n names.length > 3 ? ` +${names.length - 3} more` : ''\n return (\n <span className=\"mt-0.5 block text-[12px] text-primary truncate\">\n Matched {kids.length} sub-resource\n {kids.length === 1 ? '' : 's'}: {shown}\n {extra}\n </span>\n )\n })()}\n </span>\n {typeLabel(app.type) && (\n <span className=\"text-[11.5px] text-muted-foreground bg-muted rounded-full px-2.5 py-0.5 whitespace-nowrap shrink-0\">\n {typeLabel(app.type)}\n </span>\n )}\n <LaunchButton\n app={app}\n onLaunch={onLaunch}\n className=\"size-7 shrink-0 opacity-0 group-hover:opacity-100\"\n />\n </button>\n ))}\n </div>\n\n {/* Keyboard hint */}\n {results.length > 0 && (\n <p className=\"text-[11.5px] text-muted-foreground/60 text-center mt-3\">\n ↑↓ navigate · ↵ view access · esc clear\n </p>\n )}\n </div>\n )\n}\n\nexport function LauncherHome({\n apps,\n allResources,\n searchValue,\n onSearchChange,\n onAppClick,\n onLaunch,\n totalCount,\n}: LauncherHomeProps) {\n const { getTopApps } = useAppClickHistory()\n const [topSlugs, setTopSlugs] = useState<string[]>([])\n\n useEffect(() => {\n void getTopApps(5).then(setTopSlugs)\n }, [getTopApps])\n\n const bySlug = useMemo(() => {\n const m = new Map<string, Resource>()\n for (const a of apps) m.set(a.slug, a)\n return m\n }, [apps])\n\n // Your apps: frequently-clicked (personalized). Empty on a cold new machine.\n const frequent = useMemo(\n () =>\n topSlugs\n .map((s) => bySlug.get(s))\n .filter((a): a is Resource => Boolean(a))\n .slice(0, 5),\n [topSlugs, bySlug],\n )\n\n // New this week: apps whose sources were checked in the last 7 days, as a\n // proxy for \"recently added/updated\" (frontend Resource has no createdAt yet;\n // see #38). Falls back to empty (section hidden) when no freshness data.\n const fresh = useMemo(() => {\n const weekAgo = Date.now() - 7 * 24 * 60 * 60 * 1000\n return apps\n .filter((a) => {\n const t = a.freshness?.lastCheckedAt\n return t ? new Date(t).getTime() >= weekAgo : false\n })\n .sort((a, b) => {\n const ta = new Date(a.freshness?.lastCheckedAt ?? 0).getTime()\n const tb = new Date(b.freshness?.lastCheckedAt ?? 0).getTime()\n return tb - ta\n })\n .slice(0, 6)\n }, [apps])\n\n // Browse all: everything not already promoted to \"Your apps\", alpha by name.\n const browse = useMemo(() => {\n const promoted = new Set(frequent.map((a) => a.slug))\n return [...apps]\n .filter((a) => !promoted.has(a.slug))\n .sort((a, b) => a.displayName.localeCompare(b.displayName))\n }, [apps, frequent])\n\n const browseLeft = browse.filter((_, i) => i % 2 === 0)\n const browseRight = browse.filter((_, i) => i % 2 === 1)\n\n const isSearching = searchValue.trim() !== ''\n const searchRef = useRef<HTMLInputElement>(null)\n\n // ⌘K / Ctrl+K focuses the hero search box from anywhere on the page.\n useEffect(() => {\n const onKey = (e: KeyboardEvent) => {\n if ((e.metaKey || e.ctrlKey) && e.key === 'k') {\n e.preventDefault()\n searchRef.current?.focus()\n }\n }\n document.addEventListener('keydown', onKey)\n return () => document.removeEventListener('keydown', onKey)\n }, [])\n\n return (\n <div className=\"mx-auto w-full max-w-[1000px] pb-24\">\n {/* hero */}\n <div className=\"text-center pt-10 pb-1.5\">\n <h1 className=\"font-serif font-semibold text-[30px] tracking-tight m-0 mb-1.5\">\n What do you need to get into?\n </h1>\n <p className=\"text-muted-foreground m-0 mb-6 text-[15px]\">\n Find any tool, see how to request access, or jump straight in.\n </p>\n <div className=\"max-w-[620px] mx-auto\">\n <div className=\"flex items-center gap-3 bg-card border-[1.5px] border-input rounded-full px-5 h-14 shadow-sm focus-within:border-primary focus-within:ring-4 focus-within:ring-primary/15 transition-colors\">\n <Search className=\"size-5 shrink-0 text-muted-foreground\" />\n <input\n type=\"text\"\n value={searchValue}\n onChange={(e) => onSearchChange(e.target.value)}\n placeholder=\"Search apps, databases, cloud accounts, account IDs…\"\n autoComplete=\"off\"\n autoFocus\n ref={searchRef}\n aria-label=\"Search apps\"\n className=\"flex-1 bg-transparent border-0 outline-none text-[16px] text-foreground placeholder:text-muted-foreground\"\n />\n {!isSearching && (\n <kbd className=\"hidden sm:inline-flex items-center gap-0.5 text-[11px] text-muted-foreground/60 border border-muted-foreground/20 rounded px-1.5 py-0.5 font-mono shrink-0\">\n {typeof navigator !== 'undefined' &&\n navigator.platform.includes('Mac')\n ? '⌘K'\n : 'Ctrl+K'}\n </kbd>\n )}\n </div>\n </div>\n </div>\n\n {/* Search morph: when typing, show compact results list instead of the discovery spine */}\n {isSearching && (\n <SearchResultsList\n apps={allResources ?? apps}\n searchValue={searchValue}\n onAppClick={onAppClick}\n onLaunch={onLaunch}\n onClear={() => onSearchChange('')}\n />\n )}\n\n {/* Discovery spine: only shown when not searching */}\n {!isSearching && (\n <>\n {/* Your apps */}\n {frequent.length > 0 && (\n <section className=\"mt-9\">\n <SectionHead title=\"Your apps\" count=\"frequent\" />\n <div className=\"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 gap-3.5\">\n {frequent.map((app) => (\n <button\n type=\"button\"\n key={app.slug}\n onClick={() => onAppClick(app)}\n title={`View ${app.displayName}`}\n className=\"group relative bg-card border border-border rounded-[var(--radius)] px-3.5 pt-[18px] pb-4 text-center shadow-sm hover:-translate-y-0.5 hover:shadow-md transition-all\"\n >\n <LaunchButton\n app={app}\n onLaunch={onLaunch}\n className=\"absolute top-2.5 right-2.5 size-[26px] opacity-0 group-hover:opacity-100\"\n />\n <ResourceIcon\n app={app}\n size={46}\n className=\"mx-auto mb-3\"\n />\n <span className=\"block text-[13.5px] font-bold truncate\">\n {app.displayName}\n </span>\n </button>\n ))}\n </div>\n </section>\n )}\n\n {/* New this week */}\n {fresh.length > 0 && (\n <section className=\"mt-9\">\n <SectionHead\n title=\"New this week\"\n count={`${fresh.length} added`}\n />\n <div className=\"flex flex-col gap-2\">\n {fresh.map((app) => (\n <ResourceRow\n key={app.slug}\n app={app}\n onAppClick={onAppClick}\n onLaunch={onLaunch}\n showNew\n />\n ))}\n </div>\n </section>\n )}\n\n {/* Browse all */}\n <section className=\"mt-9\">\n <SectionHead title=\"Browse all\" count={`${totalCount} resources`} />\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-2\">\n <div className=\"flex flex-col gap-2\">\n {browseLeft.map((app) => (\n <ResourceRow\n key={app.slug}\n app={app}\n onAppClick={onAppClick}\n onLaunch={onLaunch}\n />\n ))}\n </div>\n <div className=\"flex flex-col gap-2\">\n {browseRight.map((app) => (\n <ResourceRow\n key={app.slug}\n app={app}\n onAppClick={onAppClick}\n onLaunch={onLaunch}\n />\n ))}\n </div>\n </div>\n </section>\n </>\n )}\n </div>\n )\n}\n"],"names":[],"mappings":";;;;;;;;AAqBA,MAAM,YAAY,CAAC,MAA8B;AAC/C,MAAI,CAAC,KAAK,MAAM,cAAe,QAAO;AACtC,SAAO,EAAE,OAAO,CAAC,EAAE,gBAAgB,EAAE,MAAM,CAAC;AAC9C;AAoBA,SAAS,aAAa;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,MAAI,CAAC,IAAI,OAAQ,QAAO;AAGxB,QAAM,YAAY,IAAI,OAAO,QAAQ,gBAAgB,EAAE;AACvD,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAM,I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AAA,UAAA,CAKZ,GACH;AAAA,8BACC,OAAA,EAAI,WAAU,uBACZ,UAAA,YAAY,IAAI,CAAC,QAChB;AAAA,YAAC;AAAA,YAAA;AAAA,cAEC;AAAA,cACA;AAAA,cACA;AAAA,YAAA;AAAA,YAHK,IAAI;AAAA,UAAA,CAKZ,EAAA,CACH;AAAA,QAAA,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GAEJ;AAEJ;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@igstack/app-catalog-frontend-core",
3
- "version": "0.4.0-alpha-20260807164058",
3
+ "version": "0.4.0-alpha-20260807174540",
4
4
  "description": "Frontend core library for App Catalog",
5
5
  "homepage": "https://github.com/lislon/app-catalog",
6
6
  "repository": {
@@ -134,8 +134,8 @@
134
134
  "vite-plugin-static-copy": "^3.1.4",
135
135
  "vite-plugin-svgr": "^4.2.0",
136
136
  "vitest": "^4.1.2",
137
- "@igstack/app-catalog-backend-core": "0.4.0-alpha-20260807164058",
138
- "@igstack/app-catalog-shared-core": "0.4.0-alpha-20260807164058"
137
+ "@igstack/app-catalog-backend-core": "0.4.0-alpha-20260807174540",
138
+ "@igstack/app-catalog-shared-core": "0.4.0-alpha-20260807174540"
139
139
  },
140
140
  "peerDependencies": {
141
141
  "react": "19.1.2",
@@ -144,7 +144,7 @@
144
144
  "vite": "^6.3.5",
145
145
  "vite-plugin-svgr": "^4.2.0"
146
146
  },
147
- "gitHead": "5cb8dc7019a8d66fd773a5920a164d1660d4bf96",
147
+ "gitHead": "0a22262337b8737dc77c7d298a093f6e8ab11f22",
148
148
  "scripts": {
149
149
  "build": "vite build",
150
150
  "build:lenient": "vite build --mode lenient",
@@ -11,7 +11,7 @@ const DAY = 24 * 60 * 60 * 1000
11
11
  const iso = (msAgo: number) => new Date(Date.now() - msAgo).toISOString()
12
12
 
13
13
  describe('App freshness line', () => {
14
- it('shows a muted "Last checked" line when the app has freshness', async () => {
14
+ it('shows an "Updated" freshness line when the app has freshness', async () => {
15
15
  const { ui } = await given(
16
16
  magazine.full(({ backendCfg }) => {
17
17
  backendCfg.withApp({
@@ -24,7 +24,7 @@ describe('App freshness line', () => {
24
24
  )
25
25
 
26
26
  await waitFor(() => expect(ui.catalog.isDetailPanelOpen()).toBe(true))
27
- expect(screen.getByText(/Last checked/i)).toBeInTheDocument()
27
+ expect(screen.getByText(/Updated/i)).toBeInTheDocument()
28
28
  // fresh → no stale note
29
29
  expect(screen.queryByText(/may be out of date/i)).toBeNull()
30
30
  })
@@ -58,6 +58,6 @@ describe('App freshness line', () => {
58
58
  )
59
59
 
60
60
  await waitFor(() => expect(ui.catalog.isDetailPanelOpen()).toBe(true))
61
- expect(screen.queryByText(/Last checked/i)).toBeNull()
61
+ expect(screen.queryByText(/Updated/i)).toBeNull()
62
62
  })
63
63
  })
@@ -103,8 +103,10 @@ export class CatalogTools {
103
103
  * Returns null if the row has no launch link.
104
104
  */
105
105
  getLaunchLink(name: string): HTMLAnchorElement | null {
106
+ // The launch link's aria-label starts with "Open <name> in a new tab" and
107
+ // may append the destination URL, e.g. "… in a new tab (foo.example.com)".
106
108
  return screen.queryByLabelText<HTMLAnchorElement>(
107
- `Open ${name} in a new tab`,
109
+ new RegExp(`^Open ${name} in a new tab`),
108
110
  )
109
111
  }
110
112
 
@@ -15,6 +15,12 @@ export class GalleryTools {
15
15
  }
16
16
 
17
17
  isOpen(): boolean {
18
- return !!document.querySelector('[role="dialog"]')
18
+ // Detect the SCREENSHOT gallery specifically — not just any [role="dialog"]
19
+ // (the app detail card is also a dialog now, #38). The gallery is the only
20
+ // dialog with next/prev navigation controls.
21
+ return !!(
22
+ screen.queryByRole('button', { name: /next/i }) &&
23
+ screen.queryByRole('button', { name: /prev/i })
24
+ )
19
25
  }
20
26
  }
@@ -8,7 +8,7 @@ import {
8
8
  getCoreRowModel,
9
9
  useReactTable,
10
10
  } from '@tanstack/react-table'
11
- import { AppWindow, ExternalLink, Plus, Trash2, X } from 'lucide-react'
11
+ import { AppWindow, Clock, ExternalLink, Plus, Trash2, X } from 'lucide-react'
12
12
  import React, { useState } from 'react'
13
13
  import { useHotkeys } from 'react-hotkeys-hook'
14
14
  import { cn } from '~/lib/utils'
@@ -353,6 +353,26 @@ export function AppDetails({
353
353
  <span className="text-muted-foreground">—</span>
354
354
  )}
355
355
  </div>
356
+ {/* Freshness date near the header (this is the same signal that
357
+ drives "New this week"), so the date is visible in the card
358
+ itself, not only in the muted footer. */}
359
+ {app.freshness?.lastCheckedAt && (
360
+ <div className="mt-1 px-3">
361
+ <span
362
+ className="inline-flex items-center gap-1 text-xs text-muted-foreground"
363
+ title={app.freshness.lastCheckedAt}
364
+ >
365
+ <Clock className="size-3" />
366
+ Updated {formatRelativeTime(app.freshness.lastCheckedAt)}
367
+ {app.freshness.isStale && (
368
+ <span className="italic opacity-75">
369
+ {' '}
370
+ · may be out of date
371
+ </span>
372
+ )}
373
+ </span>
374
+ </div>
375
+ )}
356
376
  </div>
357
377
  </div>
358
378
  </div>
@@ -633,18 +653,7 @@ export function AppDetails({
633
653
  )}
634
654
  </div>
635
655
 
636
- {/* Freshness: muted "last checked" line, rarely-needed metadata. The
637
- backend owns the semantic (freshness.isStale); we only render. */}
638
- {app.freshness?.lastCheckedAt && (
639
- <p className="mt-4 text-xs text-muted-foreground">
640
- <span title={app.freshness.lastCheckedAt}>
641
- Last checked {formatRelativeTime(app.freshness.lastCheckedAt)}
642
- </span>
643
- {app.freshness.isStale && (
644
- <span className="italic opacity-75"> · may be out of date</span>
645
- )}
646
- </p>
647
- )}
656
+ {/* Freshness now shown near the header (see "Updated …" above). */}
648
657
  </div>
649
658
 
650
659
  {/* Screenshot Gallery Dialog */}
@@ -1,12 +1,15 @@
1
1
  import type { Resource } from '@igstack/app-catalog-backend-core'
2
- import { useEffect } from 'react'
3
2
  import { AppDetails } from '../grid/AppCatalogGrid'
4
3
 
5
4
  /**
6
- * Slide-over detail panel for the launcher (#38, item B). Renders the rich
7
- * AppDetails (access-hero, sub-resources, tiers — increments 3/4) as a right
8
- * slide-over over the launcher backdrop, matching the option-a prototype,
9
- * instead of dropping the user into the old grid + resizable split-pane.
5
+ * Centered detail card for the launcher (#38, item B). Renders the rich
6
+ * AppDetails (access-hero, sub-resources, tiers) as a large centered modal card
7
+ * over the launcher backdrop, instead of the old grid + resizable split-pane.
8
+ *
9
+ * Escape handling: this component does NOT globally bind Escape. Escape-to-close
10
+ * is owned by AppDetails' own key handling (which first closes an open
11
+ * screenshot gallery, then closes the card), so pressing Esc inside the gallery
12
+ * returns to the card — not all the way to the home page (#38 Esc-stacking bug).
10
13
  */
11
14
  export function LauncherDetailPanel({
12
15
  app,
@@ -17,39 +20,30 @@ export function LauncherDetailPanel({
17
20
  onClose: () => void
18
21
  onAppClick?: (app: Resource) => void
19
22
  }) {
20
- // Close on Escape.
21
- useEffect(() => {
22
- const onKey = (e: KeyboardEvent) => {
23
- if (e.key === 'Escape') onClose()
24
- }
25
- document.addEventListener('keydown', onKey)
26
- return () => document.removeEventListener('keydown', onKey)
27
- }, [onClose])
28
-
29
23
  return (
30
- <>
24
+ <div className="fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-4 sm:p-6 md:p-10">
31
25
  {/* scrim */}
32
26
  <button
33
27
  type="button"
34
28
  aria-label="Close details panel"
35
29
  onClick={onClose}
36
- className="fixed inset-0 z-40 bg-black/30 backdrop-blur-[2px] animate-in fade-in"
30
+ className="fixed inset-0 -z-10 bg-black/40 backdrop-blur-[2px] animate-in fade-in"
37
31
  />
38
- {/* panel */}
39
- <aside
32
+ {/* centered card */}
33
+ <div
40
34
  role="dialog"
41
35
  aria-modal="true"
42
36
  aria-label={`${app.displayName} details`}
43
- className="fixed right-0 top-0 z-50 h-full w-[min(560px,100%)] bg-background shadow-2xl border-l border-border flex flex-col animate-in slide-in-from-right duration-200"
37
+ className="relative w-full max-w-[760px] my-auto rounded-[var(--radius)] border border-border bg-background shadow-2xl animate-in fade-in zoom-in-95 duration-200"
44
38
  >
45
- <div className="overflow-y-auto flex-1 px-6 py-5">
39
+ <div className="max-h-[85vh] overflow-y-auto px-6 py-5 sm:px-8 sm:py-7">
46
40
  <AppDetails
47
41
  app={app}
48
42
  onAppClick={onAppClick}
49
43
  onClosePanel={onClose}
50
44
  />
51
45
  </div>
52
- </aside>
53
- </>
46
+ </div>
47
+ </div>
54
48
  )
55
49
  }
@@ -16,8 +16,11 @@ import { searchResources } from '../../utils/searchApps'
16
16
  * off to the results view (increment 2 refines the morph).
17
17
  */
18
18
 
19
- const typeLabel = (t?: string): string => {
20
- if (!t || t === 'application') return 'App'
19
+ // Type pill text. Plain "application" resources are the common case and don't
20
+ // need a badge (the user asked not to show a bare "App" badge); only surface a
21
+ // pill for distinctive types (database, cloud, service, …).
22
+ const typeLabel = (t?: string): string | null => {
23
+ if (!t || t === 'application') return null
21
24
  return t.charAt(0).toUpperCase() + t.slice(1)
22
25
  }
23
26
 
@@ -49,13 +52,16 @@ function LaunchButton({
49
52
  className?: string
50
53
  }) {
51
54
  if (!app.appUrl) return null
55
+ // Show the destination URL on hover (user ask) — the native title tooltip
56
+ // reveals where the ↗ jumps to, e.g. "Open → console.aws.amazon.com".
57
+ const prettyUrl = app.appUrl.replace(/^https?:\/\//, '')
52
58
  return (
53
59
  <a
54
60
  href={app.appUrl}
55
61
  target="_blank"
56
62
  rel="noopener noreferrer"
57
- title={`Open ${app.displayName} in a new tab`}
58
- aria-label={`Open ${app.displayName} in a new tab`}
63
+ title={`Open → ${prettyUrl}`}
64
+ aria-label={`Open ${app.displayName} in a new tab (${prettyUrl})`}
59
65
  onClick={(e) => {
60
66
  e.stopPropagation()
61
67
  onLaunch(app)
@@ -134,9 +140,11 @@ function ResourceRow({
134
140
  New
135
141
  </span>
136
142
  )}
137
- <span className="text-[12px] text-muted-foreground bg-muted rounded-full px-2.5 py-0.5 whitespace-nowrap">
138
- {typeLabel(app.type)}
139
- </span>
143
+ {typeLabel(app.type) && (
144
+ <span className="text-[12px] text-muted-foreground bg-muted rounded-full px-2.5 py-0.5 whitespace-nowrap">
145
+ {typeLabel(app.type)}
146
+ </span>
147
+ )}
140
148
  <LaunchButton app={app} onLaunch={onLaunch} className="size-8" />
141
149
  </button>
142
150
  )
@@ -167,6 +175,28 @@ function SearchResultsList({
167
175
  [apps, searchValue],
168
176
  )
169
177
 
178
+ // For each result, the child/sub-resources of it that themselves match the
179
+ // query — so a parent surfaced only via its children (e.g. AWS Console via a
180
+ // "biom" account) tells the user WHICH sub-resources matched, instead of an
181
+ // unexplained parent. Keyed by parent slug.
182
+ const matchedChildrenByParent = useMemo(() => {
183
+ const q = searchValue.trim().toLowerCase()
184
+ const map = new Map<string, Resource[]>()
185
+ if (!q) return map
186
+ const resultSlugs = new Set(results.map((r) => r.slug))
187
+ for (const r of apps) {
188
+ if (!r.parentSlug || !resultSlugs.has(r.parentSlug)) continue
189
+ const hay = `${r.displayName} ${r.abbreviation ?? ''} ${(
190
+ r.aliases ?? []
191
+ ).join(' ')} ${r.description ?? ''}`.toLowerCase()
192
+ if (!hay.includes(q)) continue
193
+ const list = map.get(r.parentSlug) ?? []
194
+ list.push(r)
195
+ map.set(r.parentSlug, list)
196
+ }
197
+ return map
198
+ }, [apps, results, searchValue])
199
+
170
200
  // #11 deprecated fallback: when EVERY match is a deprecated app (i.e. there
171
201
  // are no active matches for the query, only deprecated ones), surface a
172
202
  // notice so the user understands why they're seeing archived tools. The
@@ -262,10 +292,27 @@ function SearchResultsList({
262
292
  {markdownToPlainText(app.description)}
263
293
  </span>
264
294
  )}
295
+ {(() => {
296
+ const kids = matchedChildrenByParent.get(app.slug)
297
+ if (!kids || kids.length === 0) return null
298
+ const names = kids.map((k) => k.displayName)
299
+ const shown = names.slice(0, 3).join(', ')
300
+ const extra =
301
+ names.length > 3 ? ` +${names.length - 3} more` : ''
302
+ return (
303
+ <span className="mt-0.5 block text-[12px] text-primary truncate">
304
+ Matched {kids.length} sub-resource
305
+ {kids.length === 1 ? '' : 's'}: {shown}
306
+ {extra}
307
+ </span>
308
+ )
309
+ })()}
265
310
  </span>
266
- <span className="text-[11.5px] text-muted-foreground bg-muted rounded-full px-2.5 py-0.5 whitespace-nowrap shrink-0">
267
- {typeLabel(app.type)}
268
- </span>
311
+ {typeLabel(app.type) && (
312
+ <span className="text-[11.5px] text-muted-foreground bg-muted rounded-full px-2.5 py-0.5 whitespace-nowrap shrink-0">
313
+ {typeLabel(app.type)}
314
+ </span>
315
+ )}
269
316
  <LaunchButton
270
317
  app={app}
271
318
  onLaunch={onLaunch}