Add --visible-to-clients to docs/uploads create (Fixes #556) - #563
Merged
Conversation
) Wire create-time client visibility for docs create and uploads create (plus the top-level upload shortcut), closing the create-side gap left by #554. The server only honors visible_to_clients in the project's docked/root Docs & Files vault; for a nested folder it silently inherits the folder's visibility, and the visibility endpoint 403s for nested docs/uploads afterward. A shared resolveVaultClientVisibility helper runs before any mutating request: with no --vault/--folder the target is the root vault (no fetch), and an explicit folder is inspected via Vaults().Get — a non-nil Parent (nested) is a hard error raised before anything is staged. The tri-state *bool preserves the server default when the flag is omitted and sends an explicit false when given. Docs updated (SKILL.md, API-COVERAGE.md) and .surface regenerated.
There was a problem hiding this comment.
Pull request overview
Adds create-time client visibility support for Files uploads and documents by wiring a new --visible-to-clients flag into files uploads create, files doc(s) create, and the top-level upload shortcut, while correctly rejecting nested-folder targets where Basecamp would silently ignore the parameter (and later remediation is not possible).
Changes:
- Add
--visible-to-clients(tri-state viaFlags().Changed+*boolrequest field) to uploads/documents create and theuploadshortcut. - Introduce
resolveVaultClientVisibilityto gate the flag to the root Docs & Files vault (errors early for nested folders, before any POSTs). - Extend unit tests to cover omission, explicit
true/false, explicit root vault, and nested-vault rejection (ensuring zero mutating requests on rejection), and update docs/API coverage +.surface.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
skills/basecamp/SKILL.md |
Documents root-only behavior and adds examples for --visible-to-clients on uploads/docs create. |
internal/commands/files.go |
Adds the flag to relevant commands and implements the root-vault gating helper + request wiring. |
internal/commands/files_test.go |
Adds a purpose-built transport and test matrix verifying tri-state behavior and “no POSTs on rejection”. |
API-COVERAGE.md |
Notes create support for --visible-to-clients on uploads/documents (root vault only). |
.surface |
Regenerates CLI surface snapshot to include the new flags across aliases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Wires create-time client visibility for
docs createanduploads create(plus the top-level
uploadshortcut), closing the create-side gap left by#554. After this, all six SDK create inputs that accept
visible_to_clientsare consumed by the CLI.
Why these two were deferred
Documents and uploads target an arbitrary folder via
--vault/--folder, andBasecamp only honors create-time
visible_to_clientsin the project'sdocked/root Docs & Files vault. For a nested folder the server ignores
the param and inherits the folder's visibility — and the client-visibility
endpoint 403s for nested docs/uploads afterward, so there's no post-hoc
remediation (
recordings visibilitydoesn't work for them). Exposing the flagunconditionally would make it a silent no-op for nested targets.
Approach
A shared
resolveVaultClientVisibilityhelper resolves the*boolbefore anymutating request:
nil(server default preserved; tri-state).--vault/--folder) → the value, no fetch needed.Vaults().Get; a non-nilParent(nested) isa hard error raised before anything is staged (no attachment POST, no
inline-image upload, no create). The remediation advises creating in the root
folder or changing the eligible top-level ancestor that controls the folder's
visibility.
An explicit
--visible-to-clients=falsereaches the wire; omitting the flagkeeps the context-dependent server default (client-authenticated callers always
create client-visible records).
Tests
files_test.gogains a method+path mock that counts every POST and tracks thevault-inspection GET, covering both commands and the shortcut: flag presence,
default omission, root
true/false, explicit-root vault, nested rejection(with zero POSTs, including for
=false), and the unchanged nested path (noflag → vault GET not called, create succeeds).
Docs
skills/basecamp/SKILL.md— Files & Documents section, root-only note.API-COVERAGE.md— uploads/documents rows note--visible-to-clients(root vault)..surfaceregenerated.bin/cigreen.Summary by cubic
Adds
--visible-to-clientstodocs create,uploads create, and the top-levelupload. The flag works only in the project’s root Docs & Files; using it on a nested folder now errors before anything is uploaded.true/false→ value sent.--vaultis checked and nested targets with the flag are rejected with a clear hint..surfaceregenerated.Written for commit 5365d71. Summary will update on new commits.