{location.pathname}
; } -function renderLanding() { +/** The dialog as a host mounts the door: create mode, the app step, and Studio on the new package after save. */ +function NewAppHost() { + const navigate = useNavigate(); + const client = useMetadataClient(); + const locale = useMetadataLocale(); + const step = React.useMemo(() => newAppStep(client, locale), [client, locale]); + const [open, setOpen] = React.useState(false); + return ( + <> + +- {t('engine.studio.landing.customizations.loading', locale)} -
- ); - } - if (line.kind === 'failed') { - // Never a "0": the read did not answer. The server's sentence is the title. - return ( -- {t('engine.studio.landing.customizations.failed', locale)} -
- ); - } - if (line.counts.customized === 0 && line.counts.switchedOff === 0) { - // objectstack#34715 — a base this deployment has not changed says so in - // words; the Customize button beside it is the way in. - return ( -- {t('engine.studio.landing.customizations.none', locale)} -
- ); - } - const pair = listedPairOf(baseId); - const customized = tFormat('engine.studio.landing.customizations.customized', locale, { - customized: line.counts.customized, - }); - const linkClass = 'hover:text-foreground hover:underline'; - // objectstack#34724 — the "switched off" count leads to the items: a flow's - // switch is in the Automations pillar, an action's where the action is - // drawn (`switchedOffActionPath`: its object's Actions view, or its own - // item page when no object holds it). When every switched-off item is an - // action, the count opens it (one) or the action list (several); when - // flows are among them, the count opens Automations. Whenever the count - // alone does not land on the action, the line names each switched-off - // action as a link to where it is switched (the action list marks none of - // them), up to SWITCHED_OFF_ACTIONS_NAMED, then a "more" link to the list. - const offActions = line.counts.switchedOffActions ?? []; - const actionPath = (name: string) => switchedOffActionPath(baseId, name, line.actionObjects?.[name]); - const offOnlyActions = offActions.length > 0 && offActions.length === line.counts.switchedOff; - const nameActions = offActions.length > 1 || (offActions.length > 0 && !offOnlyActions); - const namedActions = offActions.slice(0, SWITCHED_OFF_ACTIONS_NAMED); - const moreActions = offActions.length - namedActions.length; - return ( -
- {pair ? (
-
- {customized}
-
- ) : (
- {customized}
- )}
- {t('engine.studio.landing.customizations.separator', locale)}
-
- {tFormat('engine.studio.landing.customizations.switchedOff', locale, {
- switchedOff: line.counts.switchedOff,
- })}
-
- {nameActions && (
-
- {t('engine.studio.landing.customizations.separator', locale)}
- {t('engine.studio.landing.customizations.switchedOffActionsLead', locale)}
- {namedActions.map((name, i) => (
-
- {t('engine.studio.landing.lead', locale)} -
- - {error && ( -{t('engine.studio.loading', locale)}
} - - {/* objectui#11808 — an installed (read-only) app is not a dead end, and - * it leads the page (objectstack#34715). ADR-0070 D2: code and - * installed packages take no new items, and D4's Duplicate clones a - * writable base, not them. The card's Customize button, like the card - * itself, opens the app in Studio, where its items are customized - * (ADR-0146 D2, D3: saved in its paired customization package); the - * card links into no Setup page (ADR-0146 D1). The app's id is not on - * the card's face, only in its title. The marketplace is offered only - * when this runtime serves one (`isMarketplaceEnabled`, objectui#5504): - * elsewhere that route does not exist. */} - {readonly.length > 0 && ( -- {t('engine.studio.landing.appsHint', locale)} -
-{dupErr}
} -- {tFormat(`${K}.unreadable`, locale, { name: app.name })} -
- ); - })} - - {pending && rows.length === 0 && ( -- {t(`${K}.loading`, locale)} -
- )} - - {nothing && ( -- {t(`${K}.empty`, locale)} -
- )} - - {rows.length > 0 && ( -{t(`${K}.noMatch`, locale)}
- ) : grouped ? ( - apps - .filter((app) => shown.some((r) => r.appId === app.id)) - .map((app) => ( -{t(`${K}.heading`, locale)}
+ ++ {t(`${K}.loading`, locale)} +
+ )} + {state.status === 'failed' && ( + // Never a "0": the read did not answer. The server's sentence is the title. ++ {t(`${K}.failed`, locale)} +
+ )} + {state.status === 'read' && ( ++ {state.customized === 0 && state.switchedOff === 0 + ? t(`${K}.none`, locale) + : `${tFormat(`${K}.customized`, locale, { count: state.customized })}${t(`${K}.separator`, locale)}${tFormat( + `${K}.switchedOff`, + locale, + { count: state.switchedOff }, + )}`} +
+ )} + + {rows.length > 0 && ( +{t(`${K}.noMatch`, locale)}
+ ) : ( +