Adds end-to-end symlink syncing driven by the "Symbolic links" setting
(real / follow / skip; default real), building on the earlier detection.
- Pull: on desktop with "real", a remote symlink is recreated as a real OS
link via Node fs (utils/symlink.ts, guarded by Platform/FileSystemAdapter);
otherwise the target path is written as content.
- Push: GitHubService.pushSymlink commits a real symlink blob (mode 120000)
through the Git Data API (blob -> tree -> commit -> ref). getFile now
reports isSymlink/symlinkTarget.
- Config 防呆: only GitHub offers "real"; on GitLab/Gitea (no API to create
symlinks) "real" resolves to "skip" via getEffectiveSymlinkHandling.
- Safety: a "follow" push never overwrites a detected remote symlink with a
regular file; it is skipped with a notice.
- Docs: docs/symlink-handling.md plus a README settings note.
Lint is satisfied without disables (Electron global require, minimal Node
type shims). Adds tests for getFile detection, the pushSymlink Git Data
sequence, and the remote-symlink push guard.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DwioG4CNKUBuKiZdowLFWe
Symlinks are Git blobs with mode 120000 whose content is the target path.
They were treated as ordinary files, which caused 404s on fetch and could
corrupt the file on pull. Add detection and let the user choose behavior.
- Settings: new "Symbolic links" option (symlinkHandling) with real
(default) / follow / skip.
- Services: listFilesDetailed() reports each entry's symlink flag from the
tree mode (120000) for GitHub and GitLab; listFiles() now delegates to it.
- Refresh/discovery: with "skip", remote symlinks are excluded from sync;
with "follow"/"real" they are included and synced as the target content.
Note: true OS-level symlink recreation on desktop and pushing files as
symlinks (Git Data API) are not yet implemented — on all platforms "real"
currently syncs the target content like "follow"; mobile has no symlink
API regardless. Tracked as a follow-up.
Add tests for symlink detection on both services and update settings fixtures.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DwioG4CNKUBuKiZdowLFWe
Loading .gitignore files probes paths that often don't exist remotely.
getFile already treats 404 as "empty file" (handleFileNotFound) and the
gitignore lookup ignores failures, but safeRequest logged every 404 as an
error — twice, because its own catch re-caught the error it had just
thrown. This produced scary "Git Service Request Failed (404): Not Found"
console output during a normal pull/refresh.
Restructure safeRequest so the catch only wraps the network call (no
double-logging of HTTP-status errors), and log an expected 404 at debug
level instead of error. Non-404 statuses are still logged as errors and
all statuses still throw so callers can handle them.
Add a debug level to the logger and regression tests for 404 vs 500.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DwioG4CNKUBuKiZdowLFWe
The ribbon button used 'list-checks' while the Sync Status view itself
uses 'git-compare' (getIcon). Use 'git-compare' for the ribbon too so the
"Open sync status" icon matches the sync status view icon.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DwioG4CNKUBuKiZdowLFWe
The shared workflow obsidian-plugin-ci.yml@v1 no longer defines the
skip-sonar input or the SONAR_TOKEN secret, which made the caller
workflow invalid ("Invalid input/secret ... is not defined in the
referenced workflow"). Remove both so the workflow validates again.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DwioG4CNKUBuKiZdowLFWe
Reading a symlinked file via Obsidian's cached vault.read(TFile) can fail
(notably on mobile), which broke both refresh and push: the status check
swallowed the error and mislabeled the file as 'unsynced', so the user
saw a Push button that then failed re-reading the symlink.
Fall back to vault.adapter.read/readBinary(path) when vault.read throws,
in both the status view and the sync manager. Also stop silently
swallowing the status-check error so the real cause is logged.
Add a regression test covering the adapter fallback on push.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DwioG4CNKUBuKiZdowLFWe
The view mixed hand-picked Unicode glyphs (✓ ⚠ ↑ ↓ ⟳ ↻ ✕ ≡ ⎇ 📁),
duplicated across files, which rendered at inconsistent sizes/weights
across platforms and could drift (e.g. the Refresh button used ↻ while
the "checking" status used ⟳).
Centralize every icon in src/ui/components/icons.ts as Lucide icon ids and
render them with Obsidian's setIcon, so status, action-bar, tab, and
info-strip icons all share one consistent icon set. Tabs now derive their
icon from statusMeta so they can no longer diverge from the file list.
Add CSS to size the SVGs uniformly.
Add setIcon to the obsidian test mock and update statusMeta expectations.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DwioG4CNKUBuKiZdowLFWe
Pushing a new file via the single-file push button failed with GitHub
HTTP 422. A 404 lookup returns sha === '' for new files, and the manual
push path (sync-manager pushFile/conflict resolution) forwarded that
empty string into the Contents API request body as "sha":"", which
GitHub rejects. Batch push avoided this via `remote.sha || undefined`.
Fix at the service layer so every caller is safe: only include sha in the
GitHub request body when it is non-empty. Apply the same guard to the
GitLab service's last_commit_id for symmetry.
Add regression tests for blank-sha pushes on both services.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DwioG4CNKUBuKiZdowLFWe
Refresh failed with the cryptic "Unexpected token '<', "<!DOCTYPE ..."
is not valid JSON" whenever the Git server returned an HTML page (login,
SSO redirect, or proxy/error page) on a 2xx/3xx response. safeRequest
only threw on status >= 400, so such bodies slipped through and crashed
at response.json.
Add BaseGitService.parseJson() which detects non-JSON/HTML bodies and
throws an actionable message, and use it for all response.json reads in
the GitHub and GitLab services. Also harden parseErrorResponse so HTML
error pages produce a clear message instead of dumping the raw document.
Add tests covering HTML 2xx responses, HTML detection by leading '<',
malformed JSON, and HTML error pages.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DwioG4CNKUBuKiZdowLFWe
Removes the eslint-disable comment and uses the standard setTimeout
which is properly typed in the DOM lib and satisfies the obsidianmd
lint rule requiring window-prefixed timer functions to use bare form.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Gitea's git/trees endpoint requires a tree or commit SHA, not a branch
name, on instances older than ~1.17. Resolve branch to commit SHA via
/branches/{branch} first, then fetch /git/trees/{commitSha}?recursive=1.
Also updates README with provider compatibility table and SVG icons for
GitHub, GitLab, and Gitea.
https://claude.ai/code/session_019Jbz6HpQvWU1wpm5M6MZpd
- Add GiteaService implementing BaseGitService/GitServiceInterface
- Uses Gitea API v1 endpoints (/api/v1/repos/{owner}/{repo}/...)
- POST for file creation, PUT for updates (differs from GitHub)
- Authorization: token {token} header
- Add giteaToken, giteaBaseUrl, giteaOwner, giteaRepo settings fields
- Add Gitea option to service type dropdown in settings UI
- Add displayGiteaSettings() panel in settings tab
- Update initializeGitService() to instantiate GiteaService
- Update getServiceName() to handle 'gitea' type
- Add comprehensive test suite (gitea-service.test.ts, 15 test cases)
- Update existing test fixtures to include new Gitea settings fields
Closes#26https://claude.ai/code/session_019Jbz6HpQvWU1wpm5M6MZpd
- Extract adapter variable and loadWith() helper in gitignore hidden-file tests
- Hoist shared ArrayBuffer constants in path.test.ts
Reduces new_duplicated_lines_density from ~78%/46% to near 0%.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move repeated beforeEach mock initialization into createSyncManagerMocks()
helper to eliminate ~45 lines of copy-paste across binary and hidden test files.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Use FileSystemAdapter.list() recursively to discover hidden files (e.g. .claude)
- Fix ensureParentDirs to use adapter.mkdir() for hidden directory creation
- Expand BINARY_EXTENSIONS with modern image, audio, video, archive, and design formats
- Exclude .agents/** from ESLint to prevent project-service parse errors
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Move contentsEqual to src/utils/path.ts (shared by sync-manager + SyncStatusView)
- Replace private isBinary in both files with isBinaryPath from path.ts
- Extract fileItemCallbacks() in SyncStatusView to remove duplicate callback objects
- Create tests/services/service-test-helpers.ts with shared testConnection,
getRepoGitignores, getFile error handling, getLastRequestCall helpers
- Refactor github/gitlab service tests to use shared helpers
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jsdom v29 uses exports field for types, incompatible with moduleResolution
"node" in CI — adding @types/jsdom provides standalone type declarations.
Cast el to HTMLInputElement directly instead of instanceof window.HTMLInputElement
to avoid unresolvable type narrowing across jsdom window context.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Render checked files incrementally below progress bar during refresh
- Progress bar now shows X/Y count and percentage
- Remove fileStatus.file guard from push/remove for unsynced files
- Fix canPush/canDelete in action bar to include hidden (string-path) files
- Fix lint: use pre-declared vi.fn() to avoid unbound-method errors
- Fix test import path and mockSettings typing for sync-manager-mapping
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds comprehensive UI component test coverage with 54 new test cases across three components to close issue #23. Includes JSDOM setup polyfills and tooltip mock utilities for DOM-dependent component testing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>