Skip to content

Add a generic Recent projects widget - #59

Merged
fdussert merged 10 commits into
mainfrom
feature/recent-projects
Oct 21, 2026
Merged

fdussert merged 10 commits into
mainfrom
feature/recent-projects

Conversation

@fdussert

Copy link
Copy Markdown
Owner

A built-in Recent projects widget backed by one generic provider with pluggable sources. It supersedes #53 and fdussert/fremkit-sietch#20, where the idea and the Herdr integration come from (@LivioGama is co-author of the provider and added to the credits).

Provider recent-projects

  • Sources, each switched on per tile (only git on by default): git folders under roots the user picks, Claude Code (~/.claude/projects folder names only, never transcripts), Codex (first line of recent session files), VS Code, Cursor, JetBrains (recentProjects.xml), zoxide, tmux, Herdr.
  • Paths are canonicalised (realpath, must be a directory under the home folder), merged, deduped and capped; a failing source keeps its last good answer and reports an error code.
  • What the live sources (tmux, Herdr) showed is remembered across restarts in <dataDir>/recent-projects.json (0600), along with per-project openers.

Commands (local only: refused on 4243 and from paired devices)

  • recent-projects.open { path, app }: the path must be in the current snapshot, the app comes from a closed list (Finder, Terminal, iTerm, Ghostty, VS Code, Cursor, Zed, Xcode, the JetBrains IDEs, Herdr, tmux, Claude Code/Codex in Herdr or tmux) and must be installed. Apps open through /usr/bin/open -a <bundle>; CLIs are found at fixed absolute locations and run with execFile. Herdr reuses the pane already open on the folder before splitting one.
  • recent-projects.setOpener { path, app | null }: same checks; a project keeps its own app, or gets one suggested from the file names at its root.

Security notes

  • recent-projects is in BUILTIN_ONLY_CHANNELS (paths are personal data); the vendored copy in the Sietch follows in its own commit.
  • Installed apps are checked by fixed bundle names, never listed from disk; nothing read from disk becomes an id or a label.
  • Diagnostics carry source ids, counts and error codes only. Paths never reach the config, backups, history or shared layouts.

Tests

pnpm typecheck, pnpm test (server 2756, ui 875) green after rebasing on main. Demo fake and widget preview included.

Draft: tried on a test server with real sources; feedback welcome, especially on Herdr.

🤖 Generated with Claude Code

fdussert and others added 10 commits October 21, 2026 09:58
One channel gathers the folders worked in lately from small source
adapters — git repositories under chosen roots (dated from .git/HEAD and
index, no git process), Claude Code's project folders (decoded against
the disk, transcripts never opened), the first line of Codex sessions,
VS Code and Cursor's recent list (sqlite3 -readonly), JetBrains'
recentProjects.xml, and the zoxide, tmux and Herdr CLIs by absolute
path. Each source is read only when a shown tile ticked it; a failing
one keeps its last good answer beside an error code.

Paths are canonicalised and kept only inside the home folder or on a
volume (/Volumes/<disk>/...), where many developers keep their code;
system and temporary folders never appear, so they cannot be opened.

`open` takes a path from the last snapshot and an application from a
closed list, runs /usr/bin/open -a <bundle> or the Herdr/tmux CLI with
an argument list, and answers only a local caller. The channel joins
BUILTIN_ONLY_CHANNELS (paths are personal data; the registry's vendored
manifest.ts copy is a later commit there) and LOCAL_ONLY_CHANNELS, so a
paired device never hears it — tested in hub.test.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: LivioGama <6930498+LivioGama@users.noreply.github.com>
A ticked source shows whether it is installed, how many projects it
named and its error code. Counts only, never a path; the table goes
through redact() with the rest of the report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One finger-sized row per project: the folder's name, its parent folder
shortened under ~, which sources saw it and how long ago. A tap opens it
with the tile's chosen application (Finder when that one is missing); a
long press, which the Edge delivers as a contextmenu event, offers the
other installed applications. The bar shows the first few names.

The channel carries what every tile asked for, so each tile keeps only
the projects one of its own sources named, and a repository only when it
sits under one of its own roots. Sources are checkboxes, all off but git;
git with no root shows how to add one.

Demo mode gets invented folders under ~/Dev and the widget joins the
seeded dashboard; the library icon is Lucide's folder-clock.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tapping a project with Herdr used to split a new pane every time, even when a
pane already sat in that folder. Now the pane list is read first: a pane whose
foreground process or shell is in the folder gets its workspace and tab
focused, then the pane itself. Herdr focuses panes only by direction, so the
way there is found with `pane neighbor` (which moves nothing), walked with
`pane focus --direction`, and the focus read back; when it does not land (or
the tab is zoomed) the open stops at the tab and reports `herdr: 'tab'`.
Without such a pane, a new one is split as before.

Herdr's terminal is then brought forward with `open -a`: a new per-tile
setting picks Terminal, iTerm or Ghostty from a closed list, or detects it
by walking the herdr processes' parents in one `ps` listing up to a
terminal's bundle (no answer when none or two are found). Every call stays
an absolute path with an argument list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tmux and Herdr show only the panes open now, so the provider remembers the
folders they showed (50 per source). That memory lived in RAM and every
server restart emptied it. It is now kept in <dataDir>/recent-projects.json:
paths and their last-seen date, live sources only, written owner-only (0600)
through a temporary file and a rename, only when it changed, and loaded
before the first poll. A missing or corrupt file starts empty instead of
failing; bad entries are dropped one by one. A live source that fails right
after a restart falls back to what was remembered.

The file stays home on its own: backups carry the config and the
backgrounds by name, a shared layout is built from config keys, and
diagnostics read no data file; a backup test pins the first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Four more "open with" choices: Herdr + Claude Code, Herdr + Codex, and the
same under tmux. The agents are a closed list, each resolved to an absolute
path like Herdr is (Homebrew, /usr/local/bin, ~/.local/bin, ~/.cargo/bin,
plus ~/.claude/local/claude for Claude Code); a missing binary means the
choice is not offered and is refused.

Herdr: a new pane is split on the folder (never an existing one, which may
be busy), focused, and the agent started in it with Herdr's documented
`agent start <name> --kind claude|codex --pane <id>`, which launches the
agent of that kind itself and waits until it takes input; so the resolved
path only decides whether the choice is offered. The name is generated,
never taken from the folder, and the folder reaches a command line only as
the `--cwd` argv item. Since that start may take Herdr's 30 s, Exec gains an
optional per-call timeout. `agent_not_ready` (the agent is up, waiting at a
startup question) still counts as started.

tmux: `new-window -c <folder> <agent's absolute path>`, one argv item. tmux
hands a lone command to the shell, so an agent is offered there only when
its path holds nothing a shell would split or expand.

A folder opened in Herdr or tmux through the widget, agent launches
included, is remembered as that source's, so it stays listed after the
pane closes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ices

JetBrains IDEs were a source of recent projects but not a way to open one.
The closed list gains one fixed id per IDE: IntelliJ IDEA and its CE,
WebStorm, PyCharm and its CE, PhpStorm, GoLand, Rider, CLion, RustRover,
RubyMine, DataGrip and Android Studio. Each is offered only when one of its
known bundle names exists in /Applications, ~/Applications (where the
JetBrains Toolbox installs today) or ~/Applications/JetBrains Toolbox, and
opens the folder with /usr/bin/open -a <bundle path> <folder>, like the
other applications. Nothing read from disk becomes an id or a label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A long press on a project now offers "Always open this project with": an
application picked with the box ticked becomes that project's own, and a
plain tap uses it instead of the tile's choice; "Back to default" takes it
back. The row shows which application a tap will use when it is not the
tile's: a filled chip when chosen, a dashed one when suggested.

The association belongs to the project, not to a tile, and holds a path,
so it is kept server side in <dataDir>/recent-projects.json beside the live
sources' memory (0600, temp file + rename), never in the config: no
project path reaches a backup, the config history, a shared layout or the
diagnostics, which still carry source counts only. A new command,
recent-projects.setOpener { path, app | null }, is zod-checked and local
only like open (a paired device or the 4243 listener is refused); the path
must be in the current snapshot and canonical, the app from the closed list
and installed. At most 200 are kept, and one whose folder is gone is
dropped at the next poll. The registry is asked to republish at once.

Without an association, the names at the project's root (readdir only, no
contents, no recursion; one fixed-path existence check for an Android app
module) suggest an installed IDE: .sln/.csproj/.fsproj Rider,
.xcodeproj/.xcworkspace/Package.swift Xcode, Cargo.toml RustRover, go.mod
GoLand, pyproject.toml/requirements.txt PyCharm, composer.json PhpStorm,
Gemfile RubyMine, Gradle/pom.xml IntelliJ IDEA (Android Studio for an
Android build), CMakeLists.txt CLion. A rule whose IDE is not installed
gives way to the next; none means the tile's choice. The snapshot carries
`opener` and `suggested` per project; a new tile setting, on by default,
turns suggestions off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The recent-projects widget started as LivioGama's Herdr provider (#53).
This branch replaces that pull request with a generic version, so their
first contribution lands through it rather than through a merge of their
own: add them to the credits the About pane and the README list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Deploying fremkit with  Cloudflare Pages  Cloudflare Pages

Latest commit: e4e4252
Status: ✅  Deploy successful!
Preview URL: https://89a2e3f0.fremkit.pages.dev
Branch Preview URL: https://feature-recent-projects.fremkit.pages.dev

View logs

@fdussert
fdussert marked this pull request as ready for review October 21, 2026 11:40
@fdussert
fdussert merged commit 3f8fe5e into main Oct 21, 2026
3 checks passed
@fdussert
fdussert deleted the feature/recent-projects branch October 21, 2026 11:40
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