Skip to content

Develop - #41

Merged
EarMaster merged 5 commits into
mainfrom
develop
Nov 7, 2026
Merged

EarMaster merged 5 commits into
mainfrom
develop

Conversation

@EarMaster

Copy link
Copy Markdown
Owner

No description provided.

EarMaster and others added 5 commits November 7, 2026 15:41
…text

A context can now be linked to its project folder, and typing @ in a stash
suggests the files in it. Picking one writes @src/app.ts, the form Claude Code
uses, with quotes only when the path has whitespace, so an agent working in the
project opens the file directly.

The link is a device-local fact: a folder path means nothing on another
machine. It lives in its own context_folders table with no foreign key, because
every context write is INSERT OR REPLACE, which would reset a column on the row
and fire a cascade. Tests cover a save and a sync pull of the context, and that
the path never reaches the sync payload. The folder is picked in a backend
dialog and the page only ever receives file names, as handover.rs does for
files. The index comes from the ignore crate, so .gitignore is honoured.

A stash in a linked context shows an @path the folder no longer holds as
unresolved, with a same-named file elsewhere as the suggestion. Nothing is
stored beside the path. Context archives carry projectFolder; an import links it
only when the folder exists on this device and never replaces a link already
made here. Signing out asks whether to keep the links, keeping them by default.

Checked with cargo test, clippy and fmt, the frontend tests and a vite build.
Not yet run in the dev build.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A context with a linked folder gets a "Suggest description" button. It reads the
folder's README, AGENTS.md and a fixed list of project files (package.json,
Cargo.toml and similar, each cut to 4,000 characters and 16,000 in all) plus the
names in the top level, and asks the AI provider to summarise them. The result is
a proposal the user can edit, then use as the description or discard.

What may leave the machine is decided in the backend, not the page. Only the
named files are read, so a .env or a source file cannot be swept in, and a
symlink is not followed out of the folder. The folder comes from the stored link,
never from the page. A first call returns just the file names and the provider's
host, shown in a confirmation before anything is sent; Apple Intelligence says it
stays on the device. The button is hidden when no folder is linked, the folder is
gone, or AI is not set up.

ai_enhance and the new command now share one config check and one request path
in ai.rs, which also lets the backend reach Apple Intelligence. The two cap tests
count a character nothing else in the text uses; an earlier count of the letter a
included the wrapper text.

Checked with cargo test, clippy and fmt, the frontend tests and a vite build.
Not yet run against a real provider or in the dev build.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A rule value can now contain {folder}, which stands for the name of the folder
linked to that context on this device. A title rule "{folder} - Visual Studio
Code" then selects the right context for every project, and each computer keeps
its folder wherever it likes.

A rule using the variable for a context with no folder here is skipped, never
matched: expanding it to nothing would make the rule "contain" the empty string
and switch to that context on every window. In a regular expression rule the
name is escaped, so a folder called c++.app matches only itself. The name is
read from the stored path text alone, because the poller runs every second under
the database lock and must not touch the disk; a folder on an unmounted drive
still names the project whose window is on screen.

The context manager says so beside a rule that uses the variable when no folder
is linked. The matcher had no tests, so this adds some for the unchanged
behaviour as well as the new. A frontend test pins the TypeScript spelling of
the variable to the Rust constant.

Checked with cargo test, clippy and fmt, the frontend tests and a vite build.
Not yet run in the dev build.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Hovering an @path in a context with a linked folder now shows the same card
an attachment badge does: the picture for an image, the opening lines for a
text file, and "Not in the project folder" with a same-named suggestion for a
path that has moved. It replaces the native tooltip on unresolved paths.

The card body moved into a shared FilePreviewContent component and the
attachment preview builder is shared too, so there is one reader. Access
stays gated per caller: the preview command only reads files in the folder's
index, refuses symlinks and paths that leave the folder, and never reads files
named like credentials. Videos show by name, as the asset scope is the cache.

Checked: cargo test, clippy, fmt, vitest, tsc and the Vite build.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@EarMaster
EarMaster merged commit f836249 into main Nov 7, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant