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
23 changes: 23 additions & 0 deletions .changeset/36732-desktop-lands-in-last-app.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
'@object-ui/console': patch
'@object-ui/app-shell': patch
'@object-ui/auth': patch
'@object-ui/i18n': patch
---

feat(console): from 768 px up a sign-in lands in the last-used app, and the platform home page retires

Clause-②: yes (widening)
Metadata-protocol: none

From 768 px up there is no platform home page any more. A sign-in, the SSO round trip and the old `/home` address all land the person in an app their permission sets show, in this order: the app they last had open, while it is still there for them; else the app the product declares `isDefault`; else the first app somebody put into the environment (never Setup or Studio).

- A person with no such app at all stays on `/home`, which now draws only the no-apps empty state: 「No applications yet」, and for a viewer who may add an app the same doors the sidebar's 「Add app」 offers (build with AI, start from a template, the app marketplace). An administrator's first-run checklist stays above it.
- An administrator's first-run checklist, while it has open items, moves to the top of the Setup app's first page (the page Setup opens on). It is drawn from 768 px up only, and a phone is unchanged.
- `@object-ui/app-shell` exports `SetupFirstPageSlotProvider`, through which a host puts its element above the Setup app's first page.
- The console's Home affordances (⌘⇧H, the way back from a missing app, Studio's way out) go where the landing goes. Where the chrome cannot yet tell which apps a permission set hides (Studio, the AI pages, or before that answer arrives) they point at `/home`, which resolves the landing itself.
- The SSO sign-in's callback is the console root instead of `/home`, so it lands the same way.
- A phone is unchanged: it still lands in the last app first, and `/home` is still its app list.
- `@object-ui/app-shell` exports `resolveDesktopHomePath(apps, lastApp)`, the desktop's Home.
- `RedirectWithSplash` takes an optional `state`, so the hops from `/` and `/home` into the landing app keep what the visit carried (an old `/ai` address's Builder handoff).
- Every console locale gains `home.noAppsAddDescription`.
11 changes: 10 additions & 1 deletion ui/apps/console/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
DefaultSettingsPage,
DefaultAcceptInvitationPage,
useMetadata,
usePhoneViewport,
} from '@object-ui/app-shell';

import { AppContent, ConsolePermissionsRequest, ConsolePermissionsScope } from './AppContent';
Expand Down Expand Up @@ -205,14 +206,22 @@ function homeChecklist(placement: FirstRunChecklistPlacement) {
* apps on a phone (objectstack#34596). The route sits under
* `ConsolePermissionsScope`, which is what tells the checklist whether this
* session may write the settings it lists; for anyone else it draws nothing.
*
* From 768 px up the platform home page is retired (objectstack#36732): the
* address resolves like `/` does on a desktop and redirects into the
* last-used app, the declared default or the first product app, and draws the
* page — its no-apps empty state — only for a viewer with no product app. A
* phone keeps its app list here, unchanged.
*/
function HomeRoute() {
const { user } = useAuth();
return (
const phone = usePhoneViewport();
const page = (
<DefaultHomeLayout userId={user?.id}>
<DefaultHomePage checklist={homeChecklist} />
</DefaultHomeLayout>
);
return phone ? page : <RootLandingRedirect home={page} />;
}

/**
Expand Down
24 changes: 19 additions & 5 deletions ui/apps/console/src/AppContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@

import { lazy, Suspense, useEffect, useMemo, type ReactNode } from 'react';
import { Route, useParams, useLocation, Navigate } from 'react-router-dom';
import { DefaultAppContent, ENVIRONMENT_SCOPE_QUERY, LauncherAppsProvider, LoadingFallback, LoadingScreen, setupMetadataStudioPath, useAdapter } from '@object-ui/app-shell';
import { DefaultAppContent, ENVIRONMENT_SCOPE_QUERY, LauncherAppsProvider, LoadingFallback, LoadingScreen, SetupFirstPageSlotProvider, setupMetadataStudioPath, useAdapter } from '@object-ui/app-shell';
import { AdapterCtx } from '@object-ui/react';
import { MePermissionsProvider, ServerReadScope, releaseMePermissionsRequest, startMePermissionsRequest } from '@object-ui/permissions';
import { createAuthenticatedFetch, useAuth } from '@object-ui/auth';
import type { DataSource } from '@object-ui/types';
import { LocalizationFetchProvider } from './LocalizationFetchProvider';
import { FirstRunChecklist } from './pages/settings/FirstRunChecklist';
import { InAppFormRoute } from './components/InternalFormRoute';
import { APPROVAL_ACTION_OBJECT, APPROVAL_REQUEST_OBJECT, routeApprovalRecordReads } from './services/approvalRequestsDataSource';

Expand Down Expand Up @@ -417,6 +418,17 @@ export function ConsolePermissionsRequest(): null {
return null;
}

/**
* objectstack#36732 (item 5, option A) — an administrator's first-run
* checklist at the top of the Setup app's first page, now that the desktop's
* home page retired. The checklist decides who sees it (a session that may
* write the settings it lists) and hides once the list is done; this route
* sits under `ConsolePermissionsScope`, which answers the first.
*/
function setupFirstPageChecklist() {
return <FirstRunChecklist placement="top" />;
}

/**
* The console's ONE `/auth/me/permissions` source, shared by Home and every app
* (objectui#12700).
Expand Down Expand Up @@ -524,10 +536,12 @@ export function AppContent() {
<>
<LocalizationFetchProvider endpoint={localizationEndpoint}>
<ApprovalRecordReads>
<DefaultAppContent
extraRoutes={appRoutes}
extraRoutesNoApp={systemRoutes}
/>
<SetupFirstPageSlotProvider value={setupFirstPageChecklist}>
<DefaultAppContent
extraRoutes={appRoutes}
extraRoutesNoApp={systemRoutes}
/>
</SetupFirstPageSlotProvider>
</ApprovalRecordReads>
</LocalizationFetchProvider>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ vi.mock('@object-ui/app-shell', async (importOriginal) => ({
// boot fallback, which is the splash off an app route.
LoadingFallback: () => <div data-testid="loading-screen" />,
DefaultHomePage: () => <HomeRosterProbe />,
// objectstack#36732 — from 768 px up `/home` redirects into an app; the page
// these cases read is a phone's (and a desktop's with no product app), so
// they render at phone width.
usePhoneViewport: () => true,
DefaultAppContent: () => <AppContentProbe />,
BuilderLanding: () => <StudioBuilderProbe />,
StudioDesignSurface: () => <StudioBuilderProbe />,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ vi.mock('@object-ui/app-shell', async (importOriginal) => ({
SystemRedirect: () => null,
DefaultHomeLayout: passthrough,
DefaultHomePage: stub('home-page'),
// objectstack#36732 — from 768 px up `/home` redirects into an app; the page
// these cases read is a phone's (and a desktop's with no product app), so
// they render at phone width.
usePhoneViewport: () => true,
DefaultOrganizationsLayout: passthrough,
DefaultOrganizationsPage: stub('organizations-page'),
DefaultOrganizationLayout: stub('organization-layout'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ vi.mock('@object-ui/app-shell', async (importOriginal) => {
LoadingScreen: () => <div data-testid="loading-screen" />,
DefaultHomeLayout: ({ children }: { children?: ReactNode }) => <>{children}</>,
DefaultHomePage: () => <div data-testid="home-page" />,
// objectstack#36732 — from 768 px up `/home` redirects into an app; the page
// these cases read is a phone's (and a desktop's with no product app), so
// they render at phone width.
usePhoneViewport: () => true,
DefaultAppContent: () => <div data-testid="app-content" />,
DefaultOrganizationsLayout: ({ children }: { children?: ReactNode }) => <>{children}</>,
DefaultOrganizationsPage: () => <div data-testid="organizations-page" />,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ vi.mock('@object-ui/app-shell', async (importOriginal) => ({
// boot fallback, which is the splash off an app route.
LoadingFallback: () => <div data-testid="loading-screen" />,
DefaultHomePage: () => <HomeProbe />,
// objectstack#36732 — from 768 px up `/home` redirects into an app; the page
// these cases read is a phone's (and a desktop's with no product app), so
// they render at phone width.
usePhoneViewport: () => true,
DefaultAppContent: () => null,
BuilderLanding: () => null,
StudioDesignSurface: () => null,
Expand Down
Loading
Loading