Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/adr-0048-home-app-link-packageid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@object-ui/app-shell": patch
---

ADR-0048: the console **home** page now links into apps by their canonical
package-id route segment, matching the nav. The app grid (`HomePage`) and the
"add to favorites" href (`AppCard`) were still building `/apps/<app.name>` while
the sidebar/switcher/command-palette emit `/apps/<packageId>` (via
`appRouteSegment`). So opening an app from the home page produced a name-form URL
(e.g. `/apps/studio`) instead of `/apps/com.objectstack.studio`. Both now use
`appRouteSegment(app)`.
6 changes: 4 additions & 2 deletions packages/app-shell/src/console/home/AppCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { Star, StarOff, ArrowUpRight } from 'lucide-react';
import { Card, CardContent, Button, Badge } from '@object-ui/components';
import { useObjectTranslation, useObjectLabel } from '@object-ui/i18n';
import { resolveI18nLabel } from '../../utils';
import { resolveI18nLabel, appRouteSegment } from '../../utils';
import { useFavorites } from '../../hooks/useFavorites';
import { getIcon } from '../../utils/getIcon';
import { cn } from '@object-ui/components';
Expand Down Expand Up @@ -53,7 +53,9 @@ export function AppCard({ app, onClick, isFavorite, index = 0 }: AppCardProps) {
toggleFavorite({
id: `app:${app.name}`,
label,
href: `/apps/${app.name}`,
// ADR-0048 — link to the canonical package-id route segment, not the
// app name, so the favorite opens `/apps/<packageId>` like the nav does.
href: `/apps/${appRouteSegment(app) ?? app.name}`,
type: 'object',
});
};
Expand Down
3 changes: 2 additions & 1 deletion packages/app-shell/src/console/home/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { useAuth, useIsWorkspaceAdmin } from '@object-ui/auth';
import { AppCard } from './AppCard';
import { RecentApps } from './RecentApps';
import { StarredApps } from './StarredApps';
import { appRouteSegment } from '../../utils';
import { Empty, EmptyTitle, EmptyDescription, Button } from '@object-ui/components';
import { Sparkles, Star, Clock, ArrowDown, Store, LayoutGrid, ShieldAlert, X, UploadCloud } from 'lucide-react';
import { useMetadataClient } from '../../views/metadata-admin/useMetadata';
Expand Down Expand Up @@ -406,7 +407,7 @@ export function HomePage() {
key={app.name}
app={app}
index={idx}
onClick={() => navigate(`/apps/${app.name}`)}
onClick={() => navigate(`/apps/${appRouteSegment(app) ?? app.name}`)}
isFavorite={favorites.some(f => f.id === `app:${app.name}`)}
/>
))}
Expand Down
Loading