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
Binary file removed apps/web/public/update-reminder-cover.jpg
Binary file not shown.
24 changes: 24 additions & 0 deletions apps/web/src/analytics/app-version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// The app version's placeholder identity, split out of ./provider so surfaces
// that must not RENDER a placeholder can test for it without importing the
// analytics client.
//
// `useAppVersion()` reads the daemon-pinned version from /api/version at
// runtime, so it necessarily starts on a placeholder and resolves one round-trip
// later. Analytics tolerates that by awaiting the shared fetch before capture
// (see `resolveAppVersionForCapture`); UI cannot await, so any surface that
// prints the version must ask whether it has resolved yet.

export const APP_VERSION_PLACEHOLDER = '0.0.0';

/**
* Whether an app version is safe to show a user as fact.
*
* False for the pre-resolution placeholder and for anything blank, so a caller
* can pick another real source (or wait) instead of stating a version nobody
* reported.
*/
export function isResolvedAppVersion(version: string | null | undefined): boolean {
if (version == null) return false;
const trimmed = version.trim();
return trimmed.length > 0 && trimmed !== APP_VERSION_PLACEHOLDER;
}
2 changes: 1 addition & 1 deletion apps/web/src/analytics/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
setAnalyticsUserId,
setConfigureGlobals,
} from './client';
import { APP_VERSION_PLACEHOLDER } from './app-version';
import { patchExceptionTrackingAppVersion } from './error-tracking';
import type { AnalyticsConfigureGlobals } from '@open-design/contracts/analytics';
import {
Expand Down Expand Up @@ -92,7 +93,6 @@ function isSameOriginApiCall(url: unknown): boolean {
}
}

const APP_VERSION_PLACEHOLDER = '0.0.0';
let runtimeAppVersion: string | null = null;
let runtimeAppVersionPromise: Promise<string | null> | null = null;

Expand Down
5 changes: 0 additions & 5 deletions apps/web/src/components/EntryNavRail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ interface Props {
footerExtra?: ReactNode;
/** Optional notice shown above the footer controls. */
footerNotice?: ReactNode;
/** Optional compact notice pinned directly above the account row (e.g. the
* collapsed update-reminder strip). */
accountNotice?: ReactNode;
}

interface NavButtonProps {
Expand Down Expand Up @@ -440,7 +437,6 @@ export function EntryNavRail({
onOpenSettings,
footerExtra,
footerNotice,
accountNotice,
}: Props) {
const { t } = useI18n();
const brandLabel = t('app.brand');
Expand Down Expand Up @@ -705,7 +701,6 @@ export function EntryNavRail({
onMouseEnter={cancelAccountClose}
onMouseLeave={scheduleAccountClose}
>
{accountNotice}
<button
type="button"
className="entry-nav-rail__account-trigger"
Expand Down
89 changes: 4 additions & 85 deletions apps/web/src/components/EntryShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,6 @@ import { Icon } from './Icon';
import { defaultAgentModelId, effectiveAgentModelChoice } from './agentModelSelection';
import { AgentIcon } from './AgentIcon';
import { CommunityView } from './CommunityView';
import { UpdateReminderDialog, UpdateReminderStrip } from './UpdateReminderDialog';
import {
markUpdateReminderSeen,
markUpdateReminderUpdated,
readSeenUpdateReminderVersion,
readUpdatedUpdateReminderVersion,
} from '../lib/update-reminder';
import { TeamSlotPlaceholder } from './TeamSlotPlaceholder';
import {
notifyTeamProjectsChanged,
Expand Down Expand Up @@ -522,21 +515,6 @@ function inactiveViewProps(active: boolean) {
};
}

// Placeholder release payload for the update reminder. Real wiring should
// derive version/notes from the updater release feed (see ../lib/updater);
// until then this drives the dialog on the Community view and the collapsed
// strip above the nav rail's account row.
const UPDATE_REMINDER_DEMO = {
version: '1.4.6',
coverSrc: '/update-reminder-cover.jpg',
notes: [
'Faster canvas rendering with smoother pan and zoom',
'New community template filters and search',
'Fixes for project import and dark mode contrast',
],
};


export function EntryShell({
skills,
designTemplates,
Expand Down Expand Up @@ -906,50 +884,6 @@ export function EntryShell({
const [railOpen, setRailOpen] = useState<boolean>(readStoredRailOpen);
const [projectSearchOpen, setProjectSearchOpen] = useState(false);

// Update reminder lifecycle: 'dialog' (unseen version, shown on the
// Community view) → 'strip' (dismissed; collapses to the icon button above
// the nav rail's account row) → 'updating' (progress shown above the
// button) → 'hidden' (update finished). Transitions are persisted per
// version (see ../lib/update-reminder).
const [updateReminderStage, setUpdateReminderStage] =
useState<'hidden' | 'dialog' | 'strip' | 'updating'>('hidden');
const [updateReminderProgress, setUpdateReminderProgress] = useState(0);
useEffect(() => {
if (readUpdatedUpdateReminderVersion() === UPDATE_REMINDER_DEMO.version) return;
setUpdateReminderStage(
readSeenUpdateReminderVersion() === UPDATE_REMINDER_DEMO.version ? 'strip' : 'dialog',
);
}, []);
const collapseUpdateReminder = useCallback(() => {
markUpdateReminderSeen(UPDATE_REMINDER_DEMO.version);
setUpdateReminderStage('strip');
}, []);
const confirmUpdateReminder = useCallback(() => {
markUpdateReminderSeen(UPDATE_REMINDER_DEMO.version);
setUpdateReminderProgress(0);
setUpdateReminderStage('updating');
}, []);
// Simulated download progress until the reminder is wired to the real
// updater feed (see ../lib/updater): ease toward 100% in uneven steps so the
// bar reads like a live download rather than a linear animation.
useEffect(() => {
if (updateReminderStage !== 'updating') return;
const timer = window.setInterval(() => {
setUpdateReminderProgress((prev) =>
prev >= 100 ? 100 : Math.min(100, prev + Math.max(1, Math.round((100 - prev) * 0.14))),
);
}, 200);
return () => window.clearInterval(timer);
}, [updateReminderStage]);
useEffect(() => {
if (updateReminderStage !== 'updating' || updateReminderProgress < 100) return;
const done = window.setTimeout(() => {
markUpdateReminderUpdated(UPDATE_REMINDER_DEMO.version);
setUpdateReminderStage('hidden');
}, 600);
return () => window.clearTimeout(done);
}, [updateReminderStage, updateReminderProgress]);

// ⌘K / Ctrl+K opens the project search palette — same as clicking the rail
// search box.
useEffect(() => {
Expand Down Expand Up @@ -1313,9 +1247,10 @@ export function EntryShell({
// #5517: the GitHub/Discord/X/mail badges and the settings chip leave the
// rail footer. Socials live in the account menu, while settings stays
// reachable through either the account menu or the signed-out rail item.
// The updater popup host also lives here (the entry topbar is gone — the
// rail toggle is the pinned Home tab in the workspace tabs bar); it renders
// nothing until an update is in flight.
// The updater host also lives here (the entry topbar is gone — the rail
// toggle is the pinned Home tab in the workspace tabs bar), which puts the
// bottom-left rocket indicator in this slot; it renders nothing until the
// real updater reports a downloaded, unopened installer.
const railFooterActions = (
<UpdaterPopup
allowSilentUpdates={config.allowSilentUpdates}
Expand Down Expand Up @@ -1464,23 +1399,7 @@ export function EntryShell({
workspaceLoading ? <RailAccountSyncTip /> : <CloudSignInTip />
) : null
}
accountNotice={
updateReminderStage === 'strip' || updateReminderStage === 'updating' ? (
<UpdateReminderStrip
onConfirm={confirmUpdateReminder}
updating={updateReminderStage === 'updating'}
progress={updateReminderProgress}
/>
) : null
}
/>
{updateReminderStage === 'dialog' && view === 'community' ? (
<UpdateReminderDialog
content={UPDATE_REMINDER_DEMO}
onCancel={collapseUpdateReminder}
onConfirm={confirmUpdateReminder}
/>
) : null}
{projectSearchOpen ? (
<ProjectSearchModal
// The same merged catalog as the All Projects grid (own + team-
Expand Down
178 changes: 0 additions & 178 deletions apps/web/src/components/UpdateReminderDialog.module.css

This file was deleted.

Loading
Loading