feat: store config in ~/.config/keeptui on macOS (XDG) - #40
Merged
Conversation
…on Support os.UserConfigDir() returns ~/Library/Application Support on macOS, so the config dir diverged from Linux and from what the docs claimed. Add a stdlib-only internal/configdir leaf that resolves the base dir uniformly: ~/.config/keeptui on macOS and Linux ($XDG_CONFIG_HOME else ~/.config), %AppData%\keeptui on Windows (unchanged). meta.yaml, cache.json, token and logs all route through configdir.Base(). Pure baseFor(goos, getenv, userConfigDir, userHomeDir) core + Base() wrapper, table-tested across all three GOOS branches. migrateConfigDir now targets the new base so the legacy keys->keeptui migration lands where the app reads. Docs synced (CLAUDE.md, ARCHITECTURE.md incl. the mermaid graph, README.md). No in-app migration for the old macOS path — the app isn't released yet. Co-Authored-By: Claude Opus 4.8 <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.
os.UserConfigDir()returns~/Library/Application Supporton macOS, so the config dir diverged from Linux and from what the docs claimed (~/.config/keeptui). This unifies macOS and Linux on~/.config/keeptui.Change
New stdlib-only leaf
internal/configdirresolves the base config dir:$XDG_CONFIG_HOMEelse~/.config%AppData%(os.UserConfigDir(), unchanged)Pure
baseFor(goos, getenv, userConfigDir, userHomeDir)core + thinBase()wrapper (theshellCommand/planForidiom), table-tested across all three GOOS branches. The four path sites —loader.MetaPath,versioncache + token,logx.logDir— route throughconfigdir.Base(). Test seams unchanged (they short-circuit before the resolver).migrateConfigDirnow targets the new base, so the legacykeys→keeptuimigration lands where the app reads.configdiris the new bottom leaf of the import graph;logx's only project import is now this leaf.Not included
No in-app migration from the old macOS
~/Library/Application Support/keeptui. The app isn't released yet, so there are no users to migrate (my own data was moved by hand).Docs
CLAUDE.md,ARCHITECTURE.md(package table, mermaid graph, storage table) andREADME.mdupdated: base dir per OS,configdirpackage,logxno longer "dependency-free".Testing
go build·go vet ./...·go test -race ./...·golangci-lint run— all green. Newconfigdir_test.gocovers the three GOOS branches plus the home/config error paths.🤖 Generated with Claude Code