Feat/ctx desktop#110
Draft
hamzaerbay wants to merge 35 commits into
Draft
Conversation
Tauri 2 + React + TS + Tailwind v4 in ctx-desktop/. Rust adapter shells out to ctx via std::process::Command (no shell plugin); TS adapter mirrors the CLI JSON schemas. Overview screen detects the ctx binary and shows live task/decision/learning counts plus status totals, degrading gracefully when a command is missing. Run: cd ctx-desktop && npm install && npm run tauri dev Spec: specs/ctx-desktop.md Signed-off-by: hamzaerbay <hamzaerbay@gmail.com>
Left-nav routing with a shared project path/version top bar. Tasks screen lists entries with status filter, inline add (ctx task add, provenance synthesized from git in the Rust adapter), and one-click complete. Overview now takes the dir as a prop from the shell. Spec: specs/ctx-desktop.md Signed-off-by: hamzaerbay <hamzaerbay@gmail.com>
Searchable list of decisions with expandable context/rationale/ consequence, plus a three-field authoring form wired to ctx decision add (provenance synthesized from git). Registered the decisions view in the nav shell. Spec: specs/ctx-desktop.md Signed-off-by: hamzaerbay <hamzaerbay@gmail.com>
Searchable list of learnings with expandable context/lesson/ application, plus a quick-add form wired to ctx learning add (provenance synthesized from git). Registered in the nav shell. Spec: specs/ctx-desktop.md Signed-off-by: hamzaerbay <hamzaerbay@gmail.com>
The differentiator: a debounced budget slider re-runs ctx agent --format json, with a used/budget bar and per-section included/dropped affordance. Copy packet (markdown via ctx agent --budget N) and copy command actions. Spec: specs/ctx-desktop.md Signed-off-by: hamzaerbay <hamzaerbay@gmail.com>
Journal screen renders ctx journal source verbatim (no journal JSON mode upstream yet) with a limit selector. Top bar gains a doctor health pill (ok/warn/error from ctx doctor --json) that tracks the active project. Spec: specs/ctx-desktop.md Signed-off-by: hamzaerbay <hamzaerbay@gmail.com>
Top bar gains a native folder picker (tauri-plugin-dialog) and a recent-projects dropdown persisted in localStorage. Selecting or picking a project repoints every screen and the health pill. Spec: specs/ctx-desktop.md Signed-off-by: hamzaerbay <hamzaerbay@gmail.com>
Rust watcher (notify) on the active <dir>/.context emits a ctx-changed event; a debounced frontend hook bumps a reload key that every screen depends on. The GUI is one writer among several (human CLI + AI agents) and no longer shows stale state. Completes the P0 GUI surface. Spec: specs/ctx-desktop.md Signed-off-by: hamzaerbay <hamzaerbay@gmail.com>
Two decisions (std::process::Command over tauri-plugin-shell; journal rendered verbatim pending journal --json) and two learnings (Tauri 2 needs rustc >= 1.88; macOS GUI PATH must be augmented to find a user-installed ctx). Spec: specs/ctx-desktop.md Signed-off-by: hamzaerbay <hamzaerbay@gmail.com>
Choose a workspace folder; a depth-bounded Rust walk (discover_projects, skips node_modules/target/.git, caps at 200) finds every dir with a .context/ and populates a project dropdown. Switching repoints all screens, the health pill, and the watcher. Workspace + active project persist in localStorage; the manual path field stays as a fallback. Unit-tested. Spec: specs/ctx-desktop.md Signed-off-by: hamzaerbay <hamzaerbay@gmail.com>
The workspace switcher supersedes the manual path input + Open button, so they are removed. Project dropdown and Workspace button share a uniform h-8 height, with a spacer pushing the health and version pills to the right. Spec: specs/ctx-desktop.md Signed-off-by: hamzaerbay <hamzaerbay@gmail.com>
Projects with Phase sections require ctx task add --section. The Tasks form now has a section field (datalist of existing sections, defaults to Misc) and passes it through, fixing the "task requires --section flag" error. Section persists across adds for batch entry into one phase. Spec: specs/ctx-desktop.md Signed-off-by: hamzaerbay <hamzaerbay@gmail.com>
Complete now passes the task's 1-based pending-order number (computed locally to match ctx) instead of its text, fixing the "multiple tasks match" error on duplicate-text tasks. The doctor pill gains a hover tooltip listing the actual warning/error messages (filtered to warning/error, matching the count). Spec: specs/ctx-desktop.md Signed-off-by: hamzaerbay <hamzaerbay@gmail.com>
New Health screen lists every ctx doctor check, highlights warnings/errors, and offers guided fixes: inspect drift, auto-fix drift (ctx drift --fix), and compact/archive (ctx compact --archive) behind an inline confirm, with command output shown. The top-bar doctor pill is now clickable through to it. Spec: specs/ctx-desktop.md Signed-off-by: hamzaerbay <hamzaerbay@gmail.com>
Replace the Tauri stub README with prerequisites, setup, dev and production build commands, the ctx list --json CLI dependency, architecture overview, and troubleshooting notes. Spec: specs/ctx-desktop.md Signed-off-by: hamzaerbay <hamzaerbay@gmail.com>
hamzaerbay
added a commit
to hamzaerbay/ctx
that referenced
this pull request
May 31, 2026
…ktop tasks Capture the 7 confirmed findings from the security/performance/ scalability review of ctx Desktop as actionable tasks so the follow-up work survives across sessions. Two merge-blockers (argument injection via missing -- separator, hardcoded personal DEFAULT_DIR) plus CSP hardening and four caching/watcher efficiency items. Spec: specs/ctx-desktop.md Signed-off-by: hamzaerbay <hamzaerbay@gmail.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Deploying ctx with
|
| Latest commit: |
4938c8c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9f12e355.ctx-bhl.pages.dev |
| Branch Preview URL: | https://feat-ctx-desktop.ctx-bhl.pages.dev |
c67d7b2 to
9a0c16d
Compare
Completes the canonical context-file coverage in the nav (Tasks, Decisions, Learnings already had screens; Conventions and the Constitution did not). Both are read-only viewers rendered by a shared CanonicalDoc component with a minimal Markdown renderer (headings, bullets, checkboxes, rules, inline bold/code; editorial HTML comments stripped). Data comes from a new allowlisted Rust command ctx_read_doc that reads .context/<NAME>.md directly — the one read that doesn't funnel through ctx, because no ctx command returns a single file's full content (the agent packet is budget-trimmed and omits the constitution) and these files are the source of truth. A missing file shows a friendly empty state. Verified: tsc + vite build and cargo check both clean. Spec: specs/ctx-desktop.md Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
A dedicated, always-available view for `ctx drift` — inspecting stale paths, broken references, and constitution violations on demand, with the mutating `--fix` behind a confirm. The Health screen only offers drift actions when the doctor flags staleness; this screen runs drift regardless and shows the full report. Reuses the existing ctxDrift adapter (no Rust/CLI change). Nav: ... Journal · Drift · Health. Verified: tsc + vite build clean. Spec: specs/ctx-desktop.md Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
Client-side search across the canonical context — Tasks, Decisions, Learnings, Conventions, and the Constitution — with results grouped by kind, a matched snippet, and one-click jump to the owning screen. Pure frontend: aggregates data the existing adapters already expose (there is no `ctx search` CLI command), loaded once per project and filtered in-memory as you type. Nav: Overview · Search · ... Verified: tsc + vite build clean. Spec: specs/ctx-desktop.md Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
A two-pane KB browser: left rail lists the top-level kb docs (Overview, Evidence Index, Source Map/Coverage, Outstanding Questions) and the topics grouped by parent folder (the grouped reindex layout); the right pane renders the selected file's Markdown. Backed by two new Rust commands: kb_info inventories .context/kb/ (existence, present docs, recursively-walked topic slugs) and kb_read returns a kb-relative file with strict segment validation (no empty/'.'/'..'/backslash) to block traversal. A project with no kb shows a friendly empty state. Also extracts the Markdown renderer to src/lib/markdown.tsx so CanonicalDoc and the KB browser share it (no duplicate copy). Verified: tsc + vite build and cargo check both clean. Spec: specs/ctx-desktop.md Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
Rounds out the screen coverage with the remaining ctx surfaces: - Reminders: list / add / dismiss (and dismiss-all) over `ctx remind`. - Scratchpad: list / add / remove over the encrypted `ctx pad` (entries shown decrypted; noted in the UI). - Hub: read-only `ctx connection status`, with a friendly "not connected" state when no hub is configured. Eight thin shell-out commands added to the Rust adapter; args pass through std::process::Command (no shell), so reminder/entry text is safe verbatim. Verified: tsc + vite build and cargo check clean. Spec: specs/ctx-desktop.md Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
Guard each screen's load with a monotonic request id so a fast project switch (or a reload after a mutation) can't let an earlier in-flight load overwrite newer state. Applies to Overview, Tasks, Decisions, Learnings, Health, and Context Packet. Also key the Tasks list by a stable composite (section|added|text) instead of the array index. Spec: specs/ctx-desktop.md Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
Add a workspace-level Projects screen that surveys every ctx project across one or more registered workspace roots: per-project task counts, health, drift, context size, and git branch, plus a workspace-wide rollup strip and a per-project drill-down (task rows with provenance, each linked to its session journal via a new ctx_journal_show command; degrades to the journal feed on a CLI without 'task list --json'). The app now persists a list of workspace roots (migrated from the legacy single value), scans them in parallel, and de-dupes projects by path. Add/remove roots from the Projects screen or the sidebar. A 30s timeout on ctx invocations keeps one wedged project from blocking the dashboard fan-out; detached HEAD reports no branch. Spec: specs/ctx-desktop-projects.md Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
Regenerate the Tauri desktop icon set from the canonical ctx logo (assets/ctx-favicon-128.png upscaled to 1024) so the app matches ctx branding instead of the default Tauri icon. Desktop targets only; no mobile icon trees. Spec: specs/meta/chores.md Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
Replace csp:null with a restrictive policy (self origin; data:/asset: images; inline styles for Tailwind; ctx IPC) so the webview that renders arbitrary .context and kb markdown has a defined CSP instead of none. Spec: specs/ctx-desktop.md Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
Six interdependent corner-case fixes across the shared host/frontend files (split per-fix would leave intermediate commits failing clippy on unused code): - Validate a restored active project on startup (dir_is_ctx_project); a moved/deleted project clears to the chooser instead of erroring on every screen. - Watch every project's .context/ (watch_projects), not just the active one, so the dashboard reflects external writes to any project while open. - Broaden the ctx search PATH (Go/local-bin/MacPorts) and add a user-configurable ctx binary path (set_ctx_path) surfaced when ctx isn't found. - Mint the write-provenance session id once per launch instead of per call, so a session's writes share one journal id and can't collide. - Cap the dashboard fan-out above 60 projects (opt-in 'Load all') to avoid a process storm on large workspaces. - Track and flag workspace roots that fail to scan (deleted/unmounted) as missing. Spec: specs/ctx-desktop-projects.md Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
watch_projects emitted the same ctx-changed event as the active-project watch, so every per-project screen refetched on a foreign project's write. Emit ctx-projects-changed on a separate channel and have only the Projects dashboard listen to it; per-project screens keep listening to ctx-changed (active project only). Spec: specs/ctx-desktop-projects.md Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
The KB browser and canonical-doc viewer use a minimal markdown renderer that only handled headings/bullets/bold/code, so table-heavy kb docs (evidence-index, source-coverage) rendered as mush. Add GitHub-style tables (with column alignment), fenced code blocks, clickable [text](url) links that open in the system browser via the opener plugin (so they don't navigate the webview or trip the CSP), and light indentation for nested list items. Spec: specs/ctx-desktop.md Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
A table with many columns or long cells overflowed the KB doc width. Wrap tables in an overflow-x-auto container so they scroll within their own box, and let cells wrap (break-words, align-top). Spec: specs/ctx-desktop.md Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
The header health pill only re-ran ctx doctor on a project switch, so it lagged the Health screen after external writes. Subscribe it to the active-project ctx-changed channel so it updates live like the screens. Spec: specs/ctx-desktop-projects.md Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
…nd injection A line-by-line review of the desktop's API surface (the Tauri IPC commands wrapping ctx CLI spawns) found 13 issues; this pass fixes all of them without adding behavior: - run every command async off the UI thread; kill and reap timed-out children instead of leaking threads and processes - complete tasks by exact text: cached pending-numbers silently completed the wrong task when agents wrote .context/ concurrently - omit --branch/--commit for projects without usable git state so adds work where the UI itself shows "no git" - probe task list --json support once per project and gate the dependent screens instead of hard-failing on older ctx builds - separate flags from user text with a -- terminator everywhere (leading-dash text could override real flags) - attribute watcher events to a project root so only the affected card refreshes and the grid never blanks out on foreign writes - guard a stale scanAll from overwriting newer project sets - defense-in-depth: contain kb reads to the canonical kb root, bound topic recursion, invalidate stale drill-down caches, and validate a custom ctx binary before persisting it Spec: specs/ctx-desktop-api-hardening.md Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
…wn codebase The enrichment layer dated from 2026-04 (19.3k symbols); the codebase is now 27.9k. Re-ran the enrichment pass against a fresh GitNexus index: re-verified 9 danger-zone blast radii (desc.Text d=1 940, was "30+"; rc.RC newly CRITICAL), refreshed the extension inventories (42 commands, 15 MCP tools, 12 drift checks, 8 setup deployers), rebuilt the flow hotspot table, and flagged that the new hub/steering/trigger/kb subsystems have no manual baseline yet. CLAUDE.md/AGENTS.md GitNexus sections regenerated by the reindex. Spec: specs/architecture-enrichment-refresh.md Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
CodeQL flagged the single-pass comment strip in renderMarkdown and Search's docLines (js/incomplete-multi-character-sanitization): one replace pass can splice a new <!-- together from surrounding text. Share one stripHtmlComments helper that loops until stable. Spec: specs/ctx-desktop.md Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
Auto-generated counter bump from npx gitnexus analyze. Spec: specs/meta/chores.md Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
Union-merged the DECISIONS/LEARNINGS context logs (main's 2026-06-07 consolidation + this branch's desktop entries) and kept the branch's GitNexus blocks in AGENTS.md/CLAUDE.md. Spec: specs/ctx-desktop.md Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
d933049 to
4938c8c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds ctx Desktop (
ctx-desktop/), a cross-platform desktop GUI client forctx— a calm, local-first window into a project's persistent AI context. It is a thin client over thectxCLI: every read/write shells out toctx, so.context/stays the source of truth. Stack: Tauri 2 + React + TypeScript + Tailwind v4.Screens (P0)
ctx agent --format json, live preview with per-section included/dropped, copy packet / copy commandctx journal source)ctx doctorcheck with guided fixes (inspect drift,ctx drift --fix,ctx compact --archive) behind a confirmPlatform
.context/project and fills a dropdownArchitecture
ctxaccess funnels throughsrc-tauri/src/ctx_adapter.rs(Rust) +src/adapter/ctx.ts(TS).ctxviastd::process::Command(no shell plugin); writes synthesize provenance (--session-id,--branch/--commitfrom git).discover.rs(workspace scan, unit-tested) andwatcher.rs(fs-watch vianotify).Dependency note
List/count views call
ctx <artifact> list --json(added onfeat/ctx-artifact-list-json, not yet released). Authoring, Context Packet, Journal, and Health work on stockctx0.8.1.Docs & spec
ctx-desktop/README.md· Design spec:specs/ctx-desktop.mdTest plan
cd ctx-desktop && npm install && npm run tauri devlauncheslist --jsonctx installed, list/count views populate