Skip to content

Shared edit-config-as-JSON mechanism (FileSystemProvider) for bucket settings #103

Description

@goanpeca

Summary

Build one shared "edit config as JSON" mechanism — a FileSystemProvider-backed virtual scheme — that the bucket-settings JSON editors (#65 lifecycle, #66 CORS, #68 notifications, #78 bucketInfo) all use, instead of four ad-hoc implementations.

Why

The UX-coherence audit found these four features are near-identical "open current config → edit JSON → persist to B2" flows. Implementing them with openTextDocument({ content }) breaks: Cmd+S triggers Save As (a file dialog) instead of persisting back to B2. A FileSystemProvider under a dedicated scheme (e.g. b2-config:/<bucket>/<kind>.json) makes save write back to B2 natively, with dirty state, diff, and reload.

What it provides

  • A b2-config: FileSystemProvider: readFile fetches the live config as pretty JSON; writeFile validates and persists via the matching SDK setter (setLifecycleRules / setCORSRules / setNotificationRules / bucket update).
  • Bundled $schema per config kind (jsonValidation) for completion, hover docs, and inline validation.
  • Secret masking on read for fields like notification hmacSha256 / Authorization headers (Manage bucket event notification (webhook) rules #68) + change-only writes so masked values aren't clobbered.
  • Optimistic concurrency: capture the bucket revision on read and send ifRevisionIs on write so a save doesn't silently clobber concurrent changes (Add command to view and edit a bucket's custom bucket-info metadata #78).
  • Parse-failure → keep the doc dirty + showErrorMessage, never a partial write.

Acceptance criteria

  • Cmd+S on a b2-config: doc persists to B2 (no Save-As prompt).
  • Each config kind has a registered $schema driving completion + validation.
  • Secret fields are masked on read and not clobbered on save.
  • Concurrent-modification saves are rejected with a clear message, not silently overwritten.

Out of scope

Filed from the UX-coherence / information-architecture audit (see #87).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestpriority: highHigh prioritysdk-paritySDK capability not yet exposed in the extension UI

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions