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
6 changes: 5 additions & 1 deletion desktop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ Reopening Desktop loads saved profiles without activating a private session. The

## Local Server preparation

Overview remains the initial page. In disconnected Memories, **Set up locally** opens and focuses **Settings & diagnostics → Local Server**; **Connect an existing Server** opens the existing connection editor. Selecting either path does not install software, activate a connection, run diagnostics or probe readiness.
Overview remains the initial page. Its **Get started with PowerContext** guide offers **View local setup** and **Add connection**. Local setup opens and focuses the same **Settings & diagnostics → Local Server** preparation page; installation and recovery remain unavailable in this preview pending [#2306](https://github.com/oceanbase/powercontext/pull/2306). Adding a connection opens the existing editor. A saved-profile selector opens the exact selected profile for review, checking and explicit activation; reopening never restores a private connection or Scope.

After activation, the guide opens the shared exact-Scope picker and continues to Memories only after an explicit successful selection. With a selected Scope, it displays the actual connection and full `scope_id`, opens the existing save/search/exact-read/copy workspace, and explains unavailable operations. The three steps describe the journey; they do not track first-memory completion, usage counts or a complete inventory. **Dismiss guide** collapses the tutorial while preserving next actions and recovery; **Revisit guide** restores it. This preference lasts only until Desktop closes. Keyboard focus, existing draft-discard guards, English/Chinese and theme settings apply to these entries.

In disconnected Memories, **Set up locally** opens and focuses **Settings & diagnostics → Local Server**; **Connect an existing Server** opens the existing connection editor. Selecting either path does not install software, activate a connection, run diagnostics or probe readiness.

The Local Server guidance is also available by opening Settings directly, including when native state is loading or unavailable. It explicitly marks Desktop installation, recovery and service management as unavailable; that status makes no claim about an actual local installation or running service. Settings stays at the bottom of the sidebar.

Expand Down
6 changes: 5 additions & 1 deletion desktop/README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ Scope 选择也具有应用层等待状态。Escape、关闭按钮及遮罩可

## Local Server 准备说明

默认启动页仍为总览。记忆页未连接时,“本地设置”进入并聚焦“设置与诊断 → Local Server”;“连接已有 Server”进入现有连接编辑器。选择任一路径都不会安装软件、激活连接、执行诊断或探测就绪状态。
默认启动页为总览。顶部“开始使用 PowerContext”引导提供“查看本机设置”和“添加连接”。前者打开并聚焦同一个“设置与诊断 → Local Server”准备说明页;当前预览尚未接入安装和恢复,相关集成仍由 [#2306](https://github.com/oceanbase/powercontext/pull/2306) 推进。后者进入现有连接编辑器。已保存配置可通过选择器精确打开,核对、检查后再明确启用;重新打开 Desktop 不会恢复私有连接或 Scope。

连接激活后,引导打开共享的精确 Scope 选择器,只有明确选择成功才进入记忆页。已有 Scope 时,显示实际连接和完整 `scope_id`,提供现有保存、搜索、精确读取和复制流程的入口,并说明不可用操作。“连接之后”三步卡描述操作路径,不追踪首次记忆完成情况、使用次数或完整库存。“收起引导”会收起教程并保留下一步操作和恢复入口,“重新查看引导”可展开;该偏好仅保留到 Desktop 关闭。入口沿用键盘焦点、草稿丢弃确认、中英文和主题设置。

记忆页未连接时,“本地设置”进入并聚焦“设置与诊断 → Local Server”;“连接已有 Server”进入现有连接编辑器。选择任一路径都不会安装软件、激活连接、执行诊断或探测就绪状态。

也可直接进入设置查看 Local Server 说明;即使原生状态正在加载或不可用,说明仍可访问。区域明确标注 Desktop 安装、恢复及服务管理尚未接入,不据此判断本机是否已安装 Server 或服务是否运行。侧栏设置入口保持在底部。

Expand Down
12 changes: 12 additions & 0 deletions desktop/ui/src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export function App() {
const [language, setLanguage] = useState<Language>("zh");
const [theme, setTheme] = useState<Theme>("system");
const [page, setPage] = useState<Page>("home");
const [guideDismissed, setGuideDismissed] = useState(false);
const [observationTab, setObservationTab] =
useState<ObservationTab>("runtime");
const [menu, setMenu] = useState(false);
Expand Down Expand Up @@ -364,6 +365,17 @@ export function App() {
state={desktop}
language={language}
onNavigate={navigate}
onOpenLocalServer={() =>
navigate("settings", { section: "local-server" })
}
onOpenProfile={(profileId) =>
navigate("connections", { profileId })
}
onOpenScopes={(trigger) => openScopes(trigger, true)}
stateLoading={stateLoading}
contextPending={contextPending}
guideDismissed={guideDismissed}
onGuideDismissedChange={setGuideDismissed}
refreshing={refreshing}
onRefresh={() => void refresh()}
/>
Expand Down
217 changes: 97 additions & 120 deletions desktop/ui/src/app/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { messages, type Language } from "./messages";
import { PageFeedback } from "./PageFeedback";
import { activeCheckReport, operationSupported } from "./context";
import { operationRestriction } from "./connection-messages";
import { OverviewGuide } from "./OverviewGuide";
import memoryIcon from "../assets/memory.svg";
import connectionsIcon from "../assets/connections.svg";
import retrievalIcon from "../assets/retrieval.svg";
Expand All @@ -28,13 +29,27 @@ type Props = {
state: DesktopState | null;
language: Language;
onNavigate: (page: Page) => void;
onOpenLocalServer: () => void;
onOpenProfile: (id: string) => void;
onOpenScopes: (trigger: HTMLElement) => void;
stateLoading: boolean;
contextPending: boolean;
guideDismissed: boolean;
onGuideDismissedChange: (dismissed: boolean) => void;
refreshing?: boolean;
onRefresh?: () => void;
};
export function Overview({
state,
language,
onNavigate,
onOpenLocalServer,
onOpenProfile,
onOpenScopes,
stateLoading,
contextPending,
guideDismissed,
onGuideDismissedChange,
refreshing = false,
onRefresh,
}: Props) {
Expand All @@ -43,7 +58,8 @@ export function Overview({
const profile = state?.profiles.find((p) => p.id === active?.connectionId);
const report = activeCheckReport(state);
const readiness = report?.readiness.value?.status;
const enabled = !!active?.scope && !!report?.compatibilityVerified;
const enabled =
!contextPending && !!active?.scope && !!report?.compatibilityVerified;
const principal = report?.anonymousAccess
? null
: report?.identity.value?.principal;
Expand Down Expand Up @@ -84,94 +100,88 @@ export function Overview({
];
return (
<div className="stack">
<section className="card">
<div className="card-heading">
<h2>{t.current}</h2>
<div className="actions">
{active && (
<span className={readyBadge(readiness)}>
{readiness === "ready"
? t.serviceReady
: readiness
? t.serviceNotReady
: t.unverified}
</span>
)}
{onRefresh && (
<button disabled={refreshing || !state} onClick={onRefresh}>
<span aria-hidden="true">↻ </span>
{refreshing ? t.refreshing : t.refresh}
</button>
)}
</div>
</div>
{refreshing && (
<PageFeedback compact kind="loading" title={t.refreshing} />
)}
{active && profile ? (
<>
<div className="connection-summary">
<img src={connectionsIcon} alt="" />
<div>
<p className="name">{profile.name}</p>
<p className="endpoint">{profile.endpoint}</p>
</div>
<span className="topbar-spacer" />
<button onClick={() => onNavigate("connections")}>
{t.manage}
</button>
<OverviewGuide
state={state}
language={language}
stateLoading={stateLoading}
contextPending={contextPending}
dismissed={guideDismissed}
onDismissedChange={onGuideDismissedChange}
onOpenLocalServer={onOpenLocalServer}
onOpenConnections={() => onNavigate("connections")}
onOpenProfile={onOpenProfile}
onOpenScopes={onOpenScopes}
onOpenMemories={() => onNavigate("memories")}
refreshing={refreshing}
onRefresh={onRefresh}
/>
{active && (
<section className="card">
<div className="card-heading">
<h2>{t.current}</h2>
<div className="actions">
{active && (
<span className={readyBadge(readiness)}>
{readiness === "ready"
? t.serviceReady
: readiness
? t.serviceNotReady
: t.unverified}
</span>
)}
</div>
<dl className="fact-grid">
<div className="fact">
<dt>{t.identityLabel}</dt>
<dd>{identity}</dd>
</div>
<div className="fact">
<dt>{t.authLabel}</dt>
<dd>
{profile.authentication === "bearer"
? t.authBearer
: t.authAnonymous}
</dd>
</div>
<div className="fact">
<dt>{t.currentScopeLabel}</dt>
<dd>
{active.scope
? `${active.scope.title} · ${t.exactScope}`
: t.noScopeSelected}
</dd>
</div>
<div className="fact">
<dt>{t.compatibilityLabel}</dt>
<dd>
{profile.compatibility
? `${profile.compatibility} · ${report?.compatibilityVerified ? t.compatibilityVerified : t.unverified}`
: t.noCompatibilitySelected}
</dd>
</div>
{refreshing && (
<PageFeedback compact kind="loading" title={t.refreshing} />
)}
{active && profile ? (
<>
<div className="connection-summary">
<img src={connectionsIcon} alt="" />
<div>
<p className="name">{profile.name}</p>
<p className="endpoint">{profile.endpoint}</p>
</div>
<span className="topbar-spacer" />
<button onClick={() => onNavigate("connections")}>
{t.manage}
</button>
</div>
</dl>
<p className="note-line">{t.readinessNote}</p>
</>
) : state ? (
<PageFeedback
compact
headingLevel={3}
kind="empty"
title={t.noActiveTitle}
action={
<button
className="primary"
onClick={() => onNavigate("connections")}
>
{t.connect}
</button>
}
>
<p>{t.noActiveBody}</p>
</PageFeedback>
) : null}
</section>
<dl className="fact-grid">
<div className="fact">
<dt>{t.identityLabel}</dt>
<dd>{identity}</dd>
</div>
<div className="fact">
<dt>{t.authLabel}</dt>
<dd>
{profile.authentication === "bearer"
? t.authBearer
: t.authAnonymous}
</dd>
</div>
<div className="fact">
<dt>{t.currentScopeLabel}</dt>
<dd>
{active.scope
? `${active.scope.title} · ${t.exactScope}`
: t.noScopeSelected}
</dd>
</div>
<div className="fact">
<dt>{t.compatibilityLabel}</dt>
<dd>
{profile.compatibility
? `${profile.compatibility} · ${report?.compatibilityVerified ? t.compatibilityVerified : t.unverified}`
: t.noCompatibilitySelected}
</dd>
</div>
</dl>
<p className="note-line">{t.readinessNote}</p>
</>
) : null}
</section>
)}
<div className="overview-grid">
<section className="card">
<div className="card-heading">
Expand Down Expand Up @@ -232,39 +242,6 @@ export function Overview({
<p className="note-line">{t.envNote}</p>
</section>
</div>
<section className="card">
<div className="card-heading">
<h2>{t.gettingStarted}</h2>
</div>
<p>{t.gettingStartedHint}</p>
<div className="steps">
<div className="step">
<span aria-hidden="true" className="step-no">
01
</span>
<div>
<h3>{t.stepSave}</h3>
<p>{t.stepSaveHint}</p>
</div>
</div>
<div className="step">
<span aria-hidden="true" className="step-no">
02
</span>
<div>
<h3>{t.stepSearch}</h3>
<p>{t.stepSearchHint}</p>
</div>
</div>
</div>
<p className="note-line">{t.overviewBoundary}</p>
<div className="actions getting-started-actions">
<span className="spacer" />
<button className="primary" onClick={() => onNavigate("memories")}>
{t.openMemories}
</button>
</div>
</section>
</div>
);
function readyBadge(status: string | null | undefined) {
Expand Down
Loading
Loading