Skip to content
Draft
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
28 changes: 28 additions & 0 deletions .changeset/37227-home-drop-build-entries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
'@object-ui/app-shell': patch
'@object-ui/i18n': patch
---

fix(app-shell)!: Home no longer offers 「Build with AI」 or 「Build an app」

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

<!-- adr-0087: not-required (no-migration-prescription) the removed operands are two Home entry points and one translation key of the console's own language packs; no packages/spec schema, registered node type, stored row or ADR-0087 conversion surface names them, and no key, value or default a metadata author can write changes, so there is nothing for objectstack migrate meta to rewrite -->

**BREAKING** for a deployment that overrides the removed translation key below: the override no longer applies, because nothing reads the key any more.

The home page shows on a phone, and on a desktop as the 「No applications yet」 screen when you have no app. Two of its entries are gone from both:

- **「Build with AI」**, the button shown when the build agent is deployed. It is also gone from the buttons of the 「No applications yet」 screen. The sidebar's 「Add app」 menu still offers it.
- **「Build an app」**, the chip beside the greeting that opened Studio when the build agent is deployed.

Everything else stays. 「Start with a template」 is still there, and on the 「No applications yet」 screen it is now the first button. 「New in Studio」 still shows where the build agent is not deployed. 「Ask AI」 shows exactly where it did before.

Nothing to do on upgrade, unless your deployment overrides the key below.

## Removed translation keys

Removed from every language pack of `@object-ui/i18n` (ar, de, en, es, fr, ja, ko, pt-BR, ru, zh-Hans, zh-Hant). It shipped in 18.6.0.

- `home.build.title` (en: "Build an app")
126 changes: 55 additions & 71 deletions ui/packages/app-shell/src/console/home/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
* From 768 px up the page is retired (objectstack#36732): the host redirects
* `/home` into an app whenever the viewer has a product app, so a desktop
* reaches this page only with none, and draws the no-apps empty state
* ({@link DesktopNoApps}): build with AI, start from a template, the app
* marketplace, for the viewers who may add an app.
* ({@link DesktopNoApps}): start from a template, the app marketplace, or a
* new package in Studio, for the viewers who may add an app. Neither 「Build
* with AI」 nor 「Build an app」 is drawn on this page (objectstack#37227).
*
* @module
*/
Expand Down Expand Up @@ -83,7 +84,7 @@ import {
TooltipTrigger,
cn,
} from '@object-ui/components';
import { Sparkles, MessageSquareText, Hammer, LayoutGrid } from 'lucide-react';
import { MessageSquareText, Hammer, LayoutGrid } from 'lucide-react';
import { usePendingDrafts } from '../../preview/usePendingDrafts.js';
import { usePublishAllDrafts } from '../../preview/usePublishAllDrafts.js';
import { fetchPackages } from '../../views/studio-design/packages-io.js';
Expand All @@ -93,21 +94,21 @@ import { STUDIO_NEW_PACKAGE_PATH } from '../../views/studio-design/studioNewPack
import { useOpenAssistant } from '../../layout/chatDockControl.js';
import { isProductApp } from '../../utils/homePath.js';
import { useAddAppEntries, useMayAddApp } from '../../hooks/useAddAppEntries.js';
import { studioLandingPath } from '../../views/studio-design/studioAddress.js';
import { catalogServesBuild } from '../../hooks/surfaceAgent.js';

/**
* Which AI home CTAs to surface, driven by the live agent catalog (the single
* source of truth) — gated PER agent, because the community edition can be in
* any of three states:
* - `askAvailable` — a data/query agent (`ask`/`data_chat`) is deployed → "Ask AI".
* - `buildAvailable` — a build/authoring agent is deployed → "Build with AI".
* That's a cloud / AI-Studio feature, ABSENT on open-source builds.
* - `buildAvailable` — a build/authoring agent is deployed. That's a cloud /
* AI-Studio feature, ABSENT on open-source builds. Home draws no build
* button for it (objectstack#37227); it withholds "Ask AI" from a maker.
* - `aiEnabled` — any agent at all (AI is on here in some form).
* - `buildServed` — the catalog lists the build agent itself, alias-aware
* (`catalogServesBuild`, objectstack#36969): what the "Build an app" chip
* promises. Where in-app building is closed the catalog keeps `ask` and
* drops `build`, so `aiEnabled` alone would promise a build nothing serves.
* (`catalogServesBuild`, objectstack#36969). Where in-app building is
* closed the catalog keeps `ask` and drops `build`; there the builder chip
* takes its Studio form, "New in Studio".
* All false while the catalog loads or when AI isn't enabled, so nothing
* flashes and no AI CTA appears where there's no agent to back it.
*
Expand Down Expand Up @@ -143,8 +144,8 @@ function useHomeAiAvailability(): {

/**
* One 32 px builder chip at the greeting's right (objectui#12601): "Start with
* a template" outlined, "Build an app" on the soft primary tint with its icon in
* the primary colour. Admins only — the caller decides that.
* a template" outlined, "New in Studio" on the soft primary tint with its icon
* in the primary colour. Admins only — the caller decides that.
*
* Disabled (not hidden) when the session cannot use it: a vanished front door
* reads as a broken page, while a dimmed one explains the deployment's
Expand Down Expand Up @@ -259,12 +260,21 @@ function DesktopNoApps({
);
}

/** The 「Add app」 entry this page does not draw (see {@link NoAppsAddActions}). */
const BUILD_WITH_AI_ENTRY = 'build-with-ai';

/**
* The 「Add app」 doors as the empty state's buttons. Its own component so
* only a viewer who may add an app pays the agent-catalog read the list makes.
*
* Every door but 「Build with AI」 (objectstack#37227): the maintainer ruled it
* off the home page, so this page leaves it out of the shared list, which the
* sidebar's 「Add app」 menu reads unchanged. A way to start an app stays: the
* template entry where a marketplace is mounted, 「New in Studio」 where the
* catalog does not serve the build agent.
*/
function NoAppsAddActions() {
const entries = useAddAppEntries();
const entries = useAddAppEntries().filter((entry) => entry.key !== BUILD_WITH_AI_ENTRY);
if (entries.length === 0) return null;
return (
<div className="mt-6 flex flex-col items-center gap-3 sm:flex-row">
Expand All @@ -286,20 +296,17 @@ function NoAppsAddActions() {
}

/**
* Home AI call-to-action(s). "Build with AI" only when a build agent is
* deployed AND the session may author metadata; "Ask AI" only when a
* data/query agent is deployed. Renders nothing when neither exists (AI off, or
* only custom agents — those are reachable via the assistant launcher / FAB).
* `layout="stack"` is used by the empty-state; the hero uses the default inline
* row. Availability is passed in so the host fetches the catalog once.
* Home's AI call-to-action: "Ask AI", only when a data/query agent is
* deployed. Renders nothing when none is (AI off, or only custom agents —
* those are reachable via the assistant launcher / FAB). `layout="stack"` is
* used by the empty-state; the hero uses the default inline row. Availability
* is passed in so the host fetches the catalog once.
*
* "Build with AI" routes to the AI authoring studio, whose output is
* draft metadata nobody without `manage_metadata` can publish — so it is one of
* the "any other metadata-authoring CTA" the objectstack#8270 ruling covers.
* It is HIDDEN rather than disabled: unlike the builder chips it is not the
* page's structural front door, the chips beside it already carry the reason,
* and a disabled hero button next to a live "Ask AI" would read as a transient
* failure. "Ask AI" is read-only and never gated.
* There is no "Build with AI" button here any more (objectstack#37227): the
* maintainer ruled it off the home page. "Ask AI" keeps the gate it had beside
* it, the cloud#1674 maker convergence below: a session for which the build
* agent is deployed and that may author metadata is not offered "Ask AI",
* since the ask agent would converge that maker straight back onto build.
*/
function HomeAiActions({
askAvailable,
Expand All @@ -313,41 +320,29 @@ function HomeAiActions({
buildAvailable: boolean;
canAuthorMetadata: boolean;
/** objectstack#34608 — opens the console's chat drawer on this agent, in place. */
openAssistant: (agent: 'build' | 'ask') => void;
openAssistant: (agent: 'ask') => void;
t: (key: string, opts?: any) => string;
layout?: 'row' | 'stack';
}) {
const showBuild = buildAvailable && canAuthorMetadata;
if (!askAvailable && !showBuild) return null;
const maker = buildAvailable && canAuthorMetadata;
if (!askAvailable || maker) return null;
const container =
layout === 'stack'
? 'mt-6 flex flex-col sm:flex-row items-center gap-3'
: 'flex shrink-0 items-center gap-2';
// In the greeting row the buttons take the builder chips' 32 px height;
// In the greeting row the button takes the builder chips' 32 px height;
// below `sm` both layouts take the 44 px touch target.
const buttonClass = layout === 'stack' ? 'max-sm:h-11' : 'h-8 px-3 text-sm max-sm:h-11';
return (
<div className={container}>
{showBuild && (
<Button onClick={() => openAssistant('build')} className={buttonClass} data-testid="home-build-with-ai">
<Sparkles className="mr-2 h-4 w-4" />
{t('home.buildWithAI', { defaultValue: 'Build with AI' })}
</Button>
)}
{/* cloud#1674 maker convergence: with the build CTA shown, "Ask AI" is
not a second door — the build composer answers data questions too
(data superset since cloud#1673), and the ask agent would converge a
maker straight back onto build. Non-authoring sessions keep it. */}
{askAvailable && !showBuild && (
<Button
onClick={() => openAssistant('ask')}
className={buttonClass}
data-testid="home-ask-ai"
>
<MessageSquareText className="mr-2 h-4 w-4" />
{t('home.askAI', { defaultValue: 'Ask AI' })}
</Button>
)}
<Button
onClick={() => openAssistant('ask')}
className={buttonClass}
data-testid="home-ask-ai"
>
<MessageSquareText className="mr-2 h-4 w-4" />
{t('home.askAI', { defaultValue: 'Ask AI' })}
</Button>
</div>
);
}
Expand Down Expand Up @@ -470,7 +465,7 @@ export function HomePage({ checklist }: HomePageProps = {}) {
// objectstack#34608 — the Home AI buttons open the same right-side drawer
// every console page has (in place, no navigation).
const openAssistant = useOpenAssistant();
const openHomeAssistant = (agent: 'build' | 'ask') => openAssistant({ agent });
const openHomeAssistant = (agent: 'ask') => openAssistant({ agent });
const { t, language } = useObjectTranslation();
const metadata = useMetadata();
const { apps, loading } = metadata;
Expand Down Expand Up @@ -516,9 +511,9 @@ export function HomePage({ checklist }: HomePageProps = {}) {
// every app mount) is the only "which app is the user in" signal available
// here, and it is undefined on a cold landing straight at `/home`.
const { currentAppName } = useNavigationContext();
// AI CTA gating, per agent: "Build with AI" only when a build agent is
// deployed (cloud / AI Studio); "Ask AI" only when a data agent is; neither
// when AI isn't enabled. Community builds typically land in the ask-only state.
// AI CTA gating, per agent: "Ask AI" only when a data agent is deployed,
// and not for a maker the build agent serves; nothing when AI isn't
// enabled. Home draws no "Build with AI" (objectstack#37227).
const { aiResolved, askAvailable, buildAvailable, buildServed } = useHomeAiAvailability();
// objectstack#8270 — the authoring CTAs below are gated on the SERVER's
// capability answer, not on the admin ROLE: on the EE multi-tenant deploy an
Expand Down Expand Up @@ -965,24 +960,13 @@ export function HomePage({ checklist }: HomePageProps = {}) {
* since Studio is then the ONLY way to build, a session that
* may not author gets no chip rather than a dimmed one (the
* template chip beside it still carries the reason). With
* agents present nothing changes. The chip waits for the
* catalog's answer, so neither form flashes before the other.
*
* objectstack#36969 — the AI form is drawn only where the
* catalog serves the build agent itself (`buildServed`), not
* any agent: a deployment that closed in-app building still
* serves `ask`, and there the chip takes this Studio form. */}
{aiStudioEnabled && buildServed && (
<BuilderChip
icon={Hammer}
label={t('home.build.title', { defaultValue: 'Build an app' })}
tone="soft"
onClick={() => navigate(studioLandingPath())}
disabledReason={!canAuthorMetadata ? authoringGateReason : undefined}
reasonId={authoringReasonId}
testId="home-build-app"
/>
)}
* the build agent served, the chip's other form, "Build an
* app" to bare `/studio`, is gone (objectstack#37227): the
* maintainer ruled it off this page, with "Build with AI".
* The Studio form waits for the catalog's answer, so it
* never flashes, and is drawn only where the catalog does not
* serve the build agent itself (`buildServed`,
* objectstack#36969). */}
{aiStudioEnabled && aiResolved && !buildServed && canAuthorMetadata && (
<BuilderChip
icon={Hammer}
Expand Down
5 changes: 3 additions & 2 deletions ui/packages/app-shell/src/console/home/QuickActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ export function QuickActions() {
const navigate = useNavigate();
const { t } = useObjectTranslation();

// Manual "Create App" deprecated — the AI-first builder (Build with AI on
// /home) is the path to a new application. No "Manage Objects" card either
// Manual "Create App" deprecated — and no build entry of any kind: Home
// offers neither "Build with AI" nor "Build an app" (objectstack#37227); a
// new app starts from a template or in Studio. No "Manage Objects" card either
// (objectstack ADR-0146 D1): objects are designed in Studio, which Home
// opens from its own cover.
const actions: QuickAction[] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ vi.mock('@object-ui/auth', async (importOriginal) => ({

vi.mock('@object-ui/plugin-chatbot/core', async (importOriginal) => ({
...(await importOriginal<typeof import('@object-ui/plugin-chatbot/core')>()),
useAgents: () => ({ agents: [{ name: 'build' }] }),
// objectstack#37227 — Home draws no build chip where the catalog serves the
// build agent ("Build an app" was ruled off the page), so the chip this flag
// gates is the Studio form, "New in Studio", drawn where it does not.
useAgents: () => ({ agents: [{ name: 'custom_helper' }] }),
isAskAgent: () => false,
agentHasCapability: () => true,
}));
Expand Down Expand Up @@ -304,9 +307,10 @@ describe('Home on a runtime reporting features.aiStudio: false (objectui#5521)',
await bootOn(serverConfig({ aiStudio: false }));
});

it('withholds the "Build an app" cover entirely — not dimmed, gone', () => {
it('withholds the build chip entirely — not dimmed, gone', () => {
renderHome();

expect(screen.queryByTestId('home-build-in-studio')).toBeNull();
expect(screen.queryByTestId('home-build-app')).toBeNull();
// Counter-probe against a page that rendered NOTHING: the strip behind the
// cover is still there with the workspace's app on it.
Expand Down Expand Up @@ -352,7 +356,7 @@ describe('Home on the measured composed hosted-SaaS shape (objectui#5521)', () =
await bootOn(serverConfig({ aiStudio: false, marketplace: false, installLocal: false }));
renderHome();

expect(screen.queryByTestId('home-build-app')).toBeNull();
expect(screen.queryByTestId('home-build-in-studio')).toBeNull();
expect(screen.getByTestId('home-start-template')).toBeDisabled();
expect(screen.getByTestId('home-marketplace-disabled-reason')).toHaveTextContent(
'«home.template.marketplaceDisabled»',
Expand All @@ -363,13 +367,13 @@ describe('Home on the measured composed hosted-SaaS shape (objectui#5521)', () =
});

describe('Home on a runtime that DOES offer AI Studio', () => {
it('keeps the "Build an app" cover exactly as before', async () => {
it('keeps the build chip exactly as before', async () => {
// Same fixture, same helper, one flag flipped — so the denials above cannot
// be passing because the card never renders in this suite at all.
await bootOn(serverConfig({ aiStudio: true }));
renderHome();

const build = screen.getByTestId('home-build-app');
const build = screen.getByTestId('home-build-in-studio');
expect(build).toBeInTheDocument();
expect(build).toBeEnabled();
});
Expand All @@ -382,14 +386,14 @@ describe('Home on a runtime that DOES offer AI Studio', () => {
await bootOn(serverConfig({}));
renderHome();

expect(screen.getByTestId('home-build-app')).toBeEnabled();
expect(screen.getByTestId('home-build-in-studio')).toBeEnabled();
});

it('fails OPEN when the runtime answers no config at all', async () => {
await bootOnNoConfig();

renderHome();

expect(screen.getByTestId('home-build-app')).toBeEnabled();
expect(screen.getByTestId('home-build-in-studio')).toBeEnabled();
});
});
Loading
Loading