feat(favorites): linked SQL folders (#997)#999
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
# Conflicts: # CHANGELOG.md
…ab on linked open
… double-click, observation tracking
…ses existing window
…ative double-click on macOS
…primaryAction:) — pure SwiftUI, no AppKit bridge
…sed but window stays
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
Implements #997 — Linked SQL Folders, plus all 5 originally-deferred v1.1 follow-ups in a single PR.
Point TablePro at a folder of
.sqlfiles (e.g. a Git repo of shared queries) and they appear in the Favorites sidebar live. Recursive subfolder watching viaFSEventStreamCreate. Files keep their on-disk identity: clicking opens as a regular editor tab, ⌘S writes back. External modifications surface as a live banner above the tab and as a side-by-side diff at save time. Metadata can be edited inline. Drag a row onto the editor to insert content. Non-UTF-8 files load via auto-detected encoding and round-trip preserved.What's new
Core (v1)
-- @name:/-- @keyword:/-- @description:at the top of.sqlfiles for sidebar display + autocomplete keyword bindinglink.circle.filliconPolish (v1.1, all originally deferred)
Swift.CollectionDifference) instead of anNSAlert. Same three actions (Keep My Changes / Reload from Disk / Cancel).String(contentsOf: usedEncoding:)with fallback chain (UTF-8 → Latin-1). Sidebar shows a yellow warning icon on non-UTF-8 rows. Saving preserves the file's original encoding (UTF-16, ISO Latin-1, etc.). UTF-8 BOM at the start of frontmatter no longer makes metadata silently disappear.Architecture
LinkedSQLFolder,LinkedSQLFavorite,LinkedFavoriteTransferLinkedSQLFolderStorage(UserDefaults),LinkedSQLIndex(separate SQLitelinked_sql_index.dbwith mtime + encoding columns)SQLFolderWatcher(FSEventStream, recursive, 1s debounce)SQLFrontmatterParser(withparseWithBodyoverload + BOM strip)LinkedSQLFavoriteWriter(preserves body + original encoding)FileTextLoader(encoding auto-detect with fallback chain)LinkedSQLFavoritesSection(Settings),LinkedFavoriteRowView,LinkedFavoriteMetadataDialog,FileConflictDiffSheet,FileModifiedOnDiskBannerReuses existing
TabRouter.openSQLFile()+TabQueryContent.sourceFileURL+saveFileToSourceURL()for the file-backed tab pipeline. New:loadMtime: Date?andexternalModificationDetected: Boolfields onTabQueryContent. New:MainContentCoordinator.fileConflictRequestobservable for sheet presentation.Quality
internalaccess modifier, proper Task cancellation, race-condition-safe file reload, pre-computed path components, BOM offset bug, eager.draggablepayload, encoding-aware error messaging, CHANGELOG completeness.xcodebuild ... build: SUCCEEDEDswiftlint lint --strict: cleanTest plan
v1
~/sql-snippetswith subfolders → sidebar reflects hierarchy.sqlfile → appears live within ~1sdaukeyword in editor → autocomplete shows linked filev1.1
echo→ tab top shows yellow banner → Reload → tab content updates, banner clearsRegression
xcodebuild ... buildpassesswiftlint lint --strictpasses