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
10 changes: 1 addition & 9 deletions apps/web/src/collab/useProjectWorkspaceScope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ export interface ProjectWorkspaceScopeState {
loading: boolean;
scope: ProjectWorkspaceScope | null;
failure?: 'unsupported' | 'forbidden' | 'unavailable';
/**
* Force a fresh read of this project's scope — the same revalidation an
* identity change / reconnect / `pageshow` triggers, exposed so a UI that has
* to tell the user "we could not resolve this" can also offer them the retry.
* Optional so fixtures can describe a state without owning the read.
*/
revalidate?: () => void;
}

export function projectWorkspaceContext(
Expand Down Expand Up @@ -224,12 +217,11 @@ export function useProjectWorkspaceScope(projectId: string): ProjectWorkspaceSco
state.resolvedRevision !== refreshRevision ||
(state.scope !== null && state.scope.projectId !== projectId)
) {
return { loading: true, scope: null, revalidate };
return { loading: true, scope: null };
}
return {
loading: state.loading,
scope: state.scope,
revalidate,
...(state.failure ? { failure: state.failure } : {}),
};
}
78 changes: 0 additions & 78 deletions apps/web/src/components/AmrScopeBlockedNotice.module.css

This file was deleted.

86 changes: 0 additions & 86 deletions apps/web/src/components/AmrScopeBlockedNotice.tsx

This file was deleted.

32 changes: 2 additions & 30 deletions apps/web/src/components/ChatPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ import {
import nextStepStyles from './NextStepActions.module.css';
import { AmrGuidance } from './AmrGuidance';
import { AmrLoginPill } from './AmrLoginPill';
import { AmrScopeBlockedNotice } from './AmrScopeBlockedNotice';
import type { AmrWorkspaceScopeBlock } from '../runtime/amr-workspace-scope-gate';
import {
AMR_LOGIN_STATUS_EVENT,
amrLoginStatusEventReason,
Expand Down Expand Up @@ -509,13 +507,6 @@ interface Props {
hasActiveDesignSystem?: boolean;
activeDesignSystem?: DesignSystemSummary | null;
sendDisabled?: boolean;
// Why an Open Design Cloud send is held closed, when that is what disabled it.
// Non-null renders the composer-adjacent reason + remedy (see
// AmrScopeBlockedNotice); it never affects `sendDisabled` itself, which stays
// ProjectView's decision.
amrScopeBlock?: AmrWorkspaceScopeBlock | null;
/** Re-read the project's workspace authority — the `unresolved` remedy. */
onRetryWorkspaceScope?: () => void;
// Read-only viewer of a team-shared project. Beyond `sendDisabled` (which only
// blocks the send action), this also disables the composer input itself and
// hides the empty-state starter cards, since a member cannot start a
Expand Down Expand Up @@ -836,8 +827,6 @@ export function ChatPane({
streaming,
loading = false,
sendDisabled = false,
amrScopeBlock = null,
onRetryWorkspaceScope,
viewerOnly = false,
queuedItems = [],
error,
Expand Down Expand Up @@ -2292,23 +2281,6 @@ export function ChatPane({
/>
</>
);
// The blocked-send reason travels WITH the composer rather than sitting beside
// it in the slot: the composer is portaled into a fixed layer whenever the
// workspace pane owns the bottom of the screen, and a sibling left behind in
// the slot would be stranded under that layer.
const composerWithGateNotice = amrScopeBlock ? (
<>
<AmrScopeBlockedNotice
block={amrScopeBlock}
metricsConsent={config?.telemetry?.metrics === true}
installationId={config?.installationId}
onRetryWorkspaceScope={onRetryWorkspaceScope}
/>
{composerNode}
</>
) : (
composerNode
);
const shouldPortalComposer =
tab === 'chat'
&& composerPortalTarget !== null
Expand Down Expand Up @@ -2912,7 +2884,7 @@ export function ChatPane({
style={composerSlotStyle}
aria-hidden={shouldPortalComposer ? true : undefined}
>
{shouldPortalComposer ? null : composerWithGateNotice}
{shouldPortalComposer ? null : composerNode}
</div>
{shouldPortalComposer && composerPortalTarget && composerPortalRect
? createPortal(
Expand All @@ -2925,7 +2897,7 @@ export function ChatPane({
width: composerPortalRect.width,
}}
>
{composerWithGateNotice}
{composerNode}
</div>,
composerPortalTarget,
)
Expand Down
17 changes: 0 additions & 17 deletions apps/web/src/components/ProjectView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ import {
isAmrBalanceGateScope,
type AmrBalanceGateScope,
} from '../runtime/amr-balance-gate';
import { amrWorkspaceScopeBlock } from '../runtime/amr-workspace-scope-gate';
import { isPaidAmrPlan, resolveAmrPlan } from '../runtime/amr-low-balance-plan';
import { AmrBalanceDialog } from './AmrBalanceDialog';
import { AmrLowBalanceDialog, type AmrLowBalanceDecision } from './AmrLowBalanceDialog';
Expand Down Expand Up @@ -1548,15 +1547,6 @@ export function ProjectView({
const projectRunWorkspaceScopeReady =
!projectRunRequiresWorkspaceScope ||
projectWorkspaceScopeAuthorizesAmr(projectWorkspaceScopeState.scope);
// Holding the send closed above is deliberate; holding it closed silently is
// not. This classifies the block so the composer can name the reason and offer
// the remedy that clears it. It never feeds back into
// `projectRunWorkspaceScopeReady` — the gate stays exactly as strict.
const projectRunAmrScopeBlock = amrWorkspaceScopeBlock({
requiresWorkspaceScope: projectRunRequiresWorkspaceScope,
projectScope: projectWorkspaceScopeState,
workspaceIdentity: workspaceContextState,
});
// Onboarding first-generation funnel (spec §11.1). Consume the pending entry
// (set by the Home recommendation) exactly once on mount; the refs guard the
// two lifecycle events so each fires only for the genuine first send / first
Expand Down Expand Up @@ -9179,13 +9169,6 @@ export function ProjectView({
// A read-only viewer of a team-shared project cannot drive artifact
// changes through chat (comments go through the separate overlay).
sendDisabled={currentConversationSendDisabled || projectCollab.viewerOnly}
// Reason + remedy for a send the AMR workspace-scope gate closed.
// Suppressed for a read-only viewer: their composer is disabled by
// ownership, and an Open Design Cloud sign-in would not change that.
amrScopeBlock={
projectCollab.viewerOnly ? null : projectRunAmrScopeBlock
}
onRetryWorkspaceScope={projectWorkspaceScopeState.revalidate}
viewerOnly={projectCollab.viewerOnly}
composerPlaceholder={
projectCollab.viewerOnly
Expand Down
2 changes: 0 additions & 2 deletions apps/web/src/i18n/locales/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ export const ar: Dict = {
'chat.amrBalanceGate.signedOutMessage': 'أنت تستخدم وكيل Open Design Cloud — سجّل الدخول وستبدأ هذه المهمة فورًا.',
'chat.amrBalanceGate.signInCta': 'تسجيل الدخول',
'chat.amrBalanceGate.watchingWallet': 'سنتابع تلقائيًا فور تحديث رصيدك.',
'chat.amrScopeGate.signedOutMessage': 'لم يتم تسجيل الدخول إلى Open Design Cloud، لذا لا توجد مساحة عمل لتشغيل هذا المشروع.',
'chat.amrScopeGate.unresolvedMessage': 'لم نتمكن من تأكيد مساحة العمل التي يعمل فيها هذا المشروع، لذا تم إيقاف مهام Open Design Cloud مؤقتًا.',
'chat.amrLowBalance.title': 'رصيدك على وشك النفاد',
'chat.amrLowBalance.message': 'لم يتبقَّ سوى {balance} — قد لا يكفي لإتمام هذه المهمة. اشحن أو قم بترقية باقتك أولًا.',
'chat.amrLowBalance.rechargeCta': 'اشحن الرصيد',
Expand Down
2 changes: 0 additions & 2 deletions apps/web/src/i18n/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ export const de: Dict = {
'chat.amrBalanceGate.signedOutMessage': 'Du verwendest den Open Design Cloud-Agenten — melde dich an und diese Aufgabe kann sofort starten.',
'chat.amrBalanceGate.signInCta': 'Anmelden',
'chat.amrBalanceGate.watchingWallet': 'Sobald dein Guthaben aktualisiert ist, geht es automatisch weiter.',
'chat.amrScopeGate.signedOutMessage': 'Du bist nicht bei Open Design Cloud angemeldet, daher gibt es für dieses Projekt keinen Workspace zum Ausführen.',
'chat.amrScopeGate.unresolvedMessage': 'Wir konnten nicht bestätigen, in welchem Workspace dieses Projekt läuft — Open Design Cloud-Aufgaben sind pausiert.',
'chat.amrLowBalance.title': 'Guthaben wird knapp',
'chat.amrLowBalance.message': 'Nur noch {balance} übrig — vermutlich nicht genug für diese Aufgabe. Lade vorher auf oder upgrade deinen Plan.',
'chat.amrLowBalance.rechargeCta': 'Aufladen',
Expand Down
2 changes: 0 additions & 2 deletions apps/web/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ export const en: Dict = {
'chat.amrBalanceGate.signedOutMessage': 'You\'re using the Open Design Cloud agent — sign in and this task can start right away.',
'chat.amrBalanceGate.signInCta': 'Sign in',
'chat.amrBalanceGate.watchingWallet': 'We\'ll continue automatically once your allowance updates.',
'chat.amrScopeGate.signedOutMessage': 'Open Design Cloud isn\'t signed in, so this project has no workspace to run under.',
'chat.amrScopeGate.unresolvedMessage': 'We couldn\'t confirm which workspace this project runs under, so Open Design Cloud tasks are paused.',
'chat.amrLowBalance.title': 'Running low on allowance',
'chat.amrLowBalance.message': 'Only {balance} of allowance remains — likely not enough to finish this task. Top up or upgrade your plan first.',
'chat.amrLowBalance.rechargeCta': 'Top up',
Expand Down
2 changes: 0 additions & 2 deletions apps/web/src/i18n/locales/es-ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ export const esES: Dict = {
'chat.amrBalanceGate.signedOutMessage': 'Estás usando el agente de Open Design Cloud: inicia sesión y esta tarea podrá empezar de inmediato.',
'chat.amrBalanceGate.signInCta': 'Iniciar sesión',
'chat.amrBalanceGate.watchingWallet': 'Continuaremos automáticamente en cuanto se actualice tu saldo.',
'chat.amrScopeGate.signedOutMessage': 'No has iniciado sesión en Open Design Cloud, así que este proyecto no tiene ningún espacio de trabajo en el que ejecutarse.',
'chat.amrScopeGate.unresolvedMessage': 'No hemos podido confirmar en qué espacio de trabajo se ejecuta este proyecto, así que las tareas de Open Design Cloud están en pausa.',
'chat.amrLowBalance.title': 'Te quedan pocos créditos',
'chat.amrLowBalance.message': 'Solo quedan {balance}: probablemente no alcance para terminar esta tarea. Recarga o mejora tu plan primero.',
'chat.amrLowBalance.rechargeCta': 'Recargar',
Expand Down
2 changes: 0 additions & 2 deletions apps/web/src/i18n/locales/fa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ export const fa: Dict = {
'chat.amrBalanceGate.signedOutMessage': 'شما از ایجنت Open Design Cloud استفاده می‌کنید — وارد شوید تا این وظیفه بلافاصله شروع شود.',
'chat.amrBalanceGate.signInCta': 'ورود',
'chat.amrBalanceGate.watchingWallet': 'به‌محض به‌روزرسانی موجودی، به‌طور خودکار ادامه می‌دهیم.',
'chat.amrScopeGate.signedOutMessage': 'به Open Design Cloud وارد نشده‌اید، بنابراین فضای کاری‌ای برای اجرای این پروژه وجود ندارد.',
'chat.amrScopeGate.unresolvedMessage': 'نتوانستیم تأیید کنیم این پروژه در کدام فضای کاری اجرا می‌شود، بنابراین کارهای Open Design Cloud متوقف شده است.',
'chat.amrLowBalance.title': 'اعتبار رو به اتمام است',
'chat.amrLowBalance.message': 'فقط {balance} باقی مانده است — احتمالاً برای اتمام این وظیفه کافی نیست. ابتدا شارژ کنید یا طرح خود را ارتقا دهید.',
'chat.amrLowBalance.rechargeCta': 'شارژ کنید',
Expand Down
2 changes: 0 additions & 2 deletions apps/web/src/i18n/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ export const fr: Dict = {
'chat.amrBalanceGate.signedOutMessage': 'Vous utilisez l’agent Open Design Cloud — connectez-vous et cette tâche pourra démarrer aussitôt.',
'chat.amrBalanceGate.signInCta': 'Se connecter',
'chat.amrBalanceGate.watchingWallet': 'Nous continuerons automatiquement dès que votre solde sera mis à jour.',
'chat.amrScopeGate.signedOutMessage': 'Vous n\'êtes pas connecté à Open Design Cloud : ce projet n\'a donc aucun espace de travail pour s\'exécuter.',
'chat.amrScopeGate.unresolvedMessage': 'Impossible de confirmer l\'espace de travail de ce projet ; les tâches Open Design Cloud sont en pause.',
'chat.amrLowBalance.title': 'Crédits bientôt épuisés',
'chat.amrLowBalance.message': 'Il ne reste que {balance} — probablement pas assez pour terminer cette tâche. Rechargez ou passez à une offre supérieure d’abord.',
'chat.amrLowBalance.rechargeCta': 'Recharger',
Expand Down
2 changes: 0 additions & 2 deletions apps/web/src/i18n/locales/hu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ export const hu: Dict = {
'chat.amrBalanceGate.signedOutMessage': 'Az Open Design Cloud agentet használod — jelentkezz be, és ez a feladat azonnal indulhat.',
'chat.amrBalanceGate.signInCta': 'Bejelentkezés',
'chat.amrBalanceGate.watchingWallet': 'Az egyenleg frissülése után automatikusan folytatjuk.',
'chat.amrScopeGate.signedOutMessage': 'Nem vagy bejelentkezve az Open Design Cloudba, így ennek a projektnek nincs munkaterülete a futtatáshoz.',
'chat.amrScopeGate.unresolvedMessage': 'Nem sikerült megállapítani, melyik munkaterületen fut ez a projekt, ezért az Open Design Cloud feladatok szünetelnek.',
'chat.amrLowBalance.title': 'Fogytán a kereted',
'chat.amrLowBalance.message': 'Már csak {balance} maradt — valószínűleg nem elég a feladat befejezéséhez. Előbb tölts fel vagy válts csomagot.',
'chat.amrLowBalance.rechargeCta': 'Feltöltés',
Expand Down
2 changes: 0 additions & 2 deletions apps/web/src/i18n/locales/id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ export const id: Dict = {
'chat.amrBalanceGate.signedOutMessage': 'Anda menggunakan agen Open Design Cloud — masuk dan tugas ini bisa langsung dimulai.',
'chat.amrBalanceGate.signInCta': 'Masuk',
'chat.amrBalanceGate.watchingWallet': 'Kami akan melanjutkan otomatis begitu saldo Anda diperbarui.',
'chat.amrScopeGate.signedOutMessage': 'Anda belum masuk ke Open Design Cloud, jadi proyek ini tidak punya ruang kerja untuk dijalankan.',
'chat.amrScopeGate.unresolvedMessage': 'Kami tidak dapat memastikan ruang kerja tempat proyek ini dijalankan, jadi tugas Open Design Cloud dijeda.',
'chat.amrLowBalance.title': 'Kredit hampir habis',
'chat.amrLowBalance.message': 'Hanya tersisa {balance} — kemungkinan tidak cukup untuk menyelesaikan tugas ini. Isi ulang atau tingkatkan paket dulu.',
'chat.amrLowBalance.rechargeCta': 'Isi ulang',
Expand Down
2 changes: 0 additions & 2 deletions apps/web/src/i18n/locales/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ export const it: Dict = {
'chat.amrBalanceGate.signedOutMessage': 'Stai usando l’agente Open Design Cloud: accedi e questa attività potrà partire subito.',
'chat.amrBalanceGate.signInCta': 'Accedi',
'chat.amrBalanceGate.watchingWallet': 'Continueremo automaticamente non appena il saldo verrà aggiornato.',
'chat.amrScopeGate.signedOutMessage': 'Non hai effettuato l\'accesso a Open Design Cloud, quindi questo progetto non ha uno spazio di lavoro in cui essere eseguito.',
'chat.amrScopeGate.unresolvedMessage': 'Non è stato possibile confermare in quale spazio di lavoro viene eseguito questo progetto: le attività di Open Design Cloud sono in pausa.',
'chat.amrLowBalance.title': 'Crediti in esaurimento',
'chat.amrLowBalance.message': 'Restano solo {balance}: probabilmente non bastano per completare questa attività. Ricarica o aggiorna il piano prima.',
'chat.amrLowBalance.rechargeCta': 'Ricarica',
Expand Down
Loading
Loading