feat: per-request git-sync toggle (closes #42)#43
Merged
Conversation
Mark individual requests as local-only via .git/info/exclude + git rm --cached, so a user can keep personal scratch requests in the workspace without pushing them to teammates. UI: sidebar + tab eye-off icon, context menu entry, and ⌘⇧H shortcut. Self-heals when a file becomes tracked externally. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Closes #42.
What
A per-request "sync with git: on/off" toggle. When off, the request stays on disk and in the sidebar/tabs as usual, but git won't push it to teammates. Meant for personal scratch requests — debugging calls, local-only auth probes, half-baked experiments — that you don't want to commit but also don't want to delete.
Why this approach
The issue proposed a local-only mechanism because
.gitignoreitself syncs to the remote, leaking the ignore list. The natural fit is.git/info/exclude: git's built-in per-clone ignore file that is never pushed. We layer on top of it rather than inventing a new config file.How it works
Backend (
apps/desktop/src/main/git.ts)Three new helpers, all gated on "is this a git repo":
gitLocalHide(workspacePath, relPath)— appends the path to a managed block inside.git/info/exclude:git rm --cached -- <relPath>so any previously-tracked copy leaves the index (the file on disk is untouched). Everything outside the marker block in.git/info/excludeis preserved.gitLocalUnhide(workspacePath, relPath)— removes the entry from the managed block.gitLocalHiddenList(workspacePath)— reads the managed block and intersects withgit ls-fileson those paths. Anything git is currently tracking gets dropped from the returned list and rewritten out of the exclude file. So if yougit addthe file in a terminal, scrapeman notices on the next refresh and the icon clears automatically. "Whatever appears in git is unhidden."IPC wired through
git:localHide,git:localUnhide,git:localHiddenList. Bridge typed in@scrapeman/shared-types.State (
store.ts)hiddenRequests: Set<string>keyed by workspace-relative path.loadHiddenRequests()— called on workspace open and on everytree-changedworkspace-watcher event, so externalgit add/git rmget picked up.toggleHiddenRequest(relPath)— flips state and refreshes git status.UI
ui/EyeOffIcon.tsx— a small inline SVG "crossed eye" icon (no new dependency).components/Sidebar.tsx): unsynced request rows render italic/dimmed with the icon. Right-click menu shows "Stop syncing to git" or "Start syncing to git" depending on current state. Menu entry is hidden entirely when the workspace is not a git repo.components/TabBar.tsx): the same icon + italic title appears on the tab itself when the underlying file is unsynced — so you can see at a glance that the request you're editing won't be pushed.gitStatus.isRepo === true, so non-repo workspaces don't advertise the feature at all.How to use
git status— the file is gone from the list. Already-tracked files get removed from the index viagit rm --cached(working copy preserved).⌘⇧Hon the active tab, or justgit add <path>from a terminal (scrapeman auto-detects and clears the icon on next refresh).Test plan
git statusand the row goes italic with the eye-off icon⌘⇧Hon the tab → toggles back to syncedgit add <file>manually from a terminal while it's marked unsynced → reopen workspace or trigger a tree refresh → icon clears automatically,.git/info/excludemanaged block no longer lists the path⌘⇧His a no-op, and the command palette doesn't list the toggle# >>> scrapeman:hidden/# <<< scrapeman:hiddenmarkers in.git/info/excludeis modified by hide/unhide round-trips