fix: show copied foreign mappings in Your files - #145
Draft
kyuchia wants to merge 8 commits into
Draft
Conversation
Add readForeignFile(owner, path) and listForeignFiles(owner) for reading another user's public cress-mappings repo. Extract contentsUrlFor(owner, path) so own-repo ops are unchanged. No foreign write/delete by design: 'others' mappings are read-only' is enforced by the absence of those methods.
ForeignReader interface (read-only by construction) as optional MappingStorage dep; copy goes foreign read -> csvToRows -> same-name check (identical: idempotent / different: ConflictError) -> saveMapping. GitHubUserRepoBackend injected as foreignReader in wiring.
New mappingsIndex.ts reads users.csv from the public cress-mappings-index repo (one username per line, raw media type). listIndexedForeignUsers in the wiring layer returns the list minus the logged-in user. Index is personally hosted and hand-curated during testing; long-term ownership and auto-registration are deferred to the PR description.
Reword the same-name dialog to Finder-style phrasing and replace the outer glow (0 0 10px 3px) with a softer directional drop shadow.
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.
Stacked on #141 (→ #140). Merge in order: #140 → #141 → #145.
This PR's own change is the last commit (ae067c3); the other commits belong to the stacked branches below.
What
Copied foreign mappings now appear in "Your files" immediately and open in the editor like a native file.
Previously a copy was written to GitHub and the local mirror but never showed in the dashboard: the panel renders UUID-keyed tree nodes, while the copy path only wrote a name-keyed doc with no tree node.
How
After a successful copy, the dashboard creates the corresponding tree node (
materializeCopyInTree) — updating in place on Replace, creating a new UUID doc otherwise. OnlyDashboard.tschanges; the storage / GitHub write path is untouched.Testing (manual, two accounts A / B)
All Mappings view — foreign files with Copy, plus the same-name dialog (Replace / Keep both / Cancel):
Copied file appears in Your files and is written to the copier's GitHub repo with the correct content:
<name> copy; Replace updates in place (no duplicate node)tsc --noEmit --skipLibCheckcleanKnown limitations (out of scope)
saveMappingis now redundant for copied files; it's harmless (nothing renders it) and left for a follow-up.users.csv; it should move to the lab, and self-registration is TBD.