Skip to content

fix: show copied foreign mappings in Your files - #145

Draft
kyuchia wants to merge 8 commits into
feat/wire-delete-to-dashboardfrom
feat/view-edit-permissions
Draft

fix: show copied foreign mappings in Your files#145
kyuchia wants to merge 8 commits into
feat/wire-delete-to-dashboardfrom
feat/view-edit-permissions

Conversation

@kyuchia

@kyuchia kyuchia commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

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. Only Dashboard.ts changes; 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):

kuciachia_cress-keepboth-and-window

Copied file appears in Your files and is written to the copier's GitHub repo with the correct content:

kuciachia_shared-01-copy-cressgithub
  • New copy appears in Your files and writes to the copier's GitHub repo
  • Opened copy renders correctly (columns aligned, content matches source)
  • Same-name dialog: Replace / Keep both / Cancel all correct
  • Keep both → <name> copy; Replace updates in place (no duplicate node)
  • Foreign files remain read-only (copy only; no edit or delete)
  • prettier and tsc --noEmit --skipLibCheck clean

Known limitations (out of scope)

  • The FileSystem tree and GitHub are not reconciled on load, so the panel reflects local tree state rather than the account's true remote, and doesn't update on account switch — a pre-existing gap in the feat: save and load mapping files to/from GitHub #140 storage layer, tracked separately.
  • The name-keyed local mirror from saveMapping is now redundant for copied files; it's harmless (nothing renders it) and left for a follow-up.
  • The central user index is temporarily on a personal account with a hand-curated users.csv; it should move to the lab, and self-registration is TBD.

kyuchia added 8 commits June 30, 2026 00:13
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.
@kyuchia
kyuchia changed the base branch from main to feat/wire-delete-to-dashboard July 8, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant