Skip to content

Release Cloudinary VS Code 1.0.0#24

Open
ed-cld wants to merge 130 commits into
mainfrom
develop
Open

Release Cloudinary VS Code 1.0.0#24
ed-cld wants to merge 130 commits into
mainfrom
develop

Conversation

@ed-cld

@ed-cld ed-cld commented Jul 6, 2026

Copy link
Copy Markdown

Summary

  • Prepare the Cloudinary VS Code 1.0.0 release from develop
  • Include the webview homescreen/library/upload workflows, Docs AI integration, AI tools configuration, config/folder-mode hardening, and analytics updates
  • Add and stabilize e2e coverage for homescreen interactions, library filters/preview, upload widget controls, sidebar search, and upload flows
  • Clarify upload widget drag-and-drop guidance for VS Code: hold Shift before dropping files

Tests

  • npm run compile
  • npm test (79 passing)
  • npx tsc -p test/e2e/tsconfig.json --noEmit
  • pnpm test:e2e (6/6 specs passing)
  • pnpm test:e2e --spec ./specs/uploadWidgetControls.spec.ts

📦 Test build · v1.0.0-pr.24Download VSIX (expires in 14 days, requires GitHub login)
To install: Extensions → ··· → Install from VSIX… or code --install-extension cloudinary-develop.vsix

njb90 and others added 30 commits March 30, 2026 12:40
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- resetAllPreviewPanels now disposes panels via the openPanels Map
- HomescreenViewProvider clears _webviewView on dispose so refresh()
  no-ops safely instead of throwing "Webview is disposed" and halting
  the onDidChangeEnvironment callback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…or handling

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ed-cld added 29 commits May 8, 2026 12:01
# Conflicts:
#	esbuild.js
#	package.json
#	src/commands/registerCommands.ts
#	src/extension.ts
Wire AnalyticsService through extension activation and instrument
commands (copy, preview, upload) and webviews (Docs AI, homescreen,
library). Strips sensitive payload keys before transmission and
persists a session id in global state.
Events fired before a cloud is configured previously dropped the
cloud_name param entirely, making 'no cloud configured' indistinguishable
from a missing or dropped value. Always set cloud_name, falling back to a
'(not configured)' sentinel (parens/spaces are invalid in cloud names, so
it can't collide with a real one).
Emit config_validation_succeeded / config_validation_failed when the
extension exercises configured credentials against the folder-mode API,
so we can tell which accounts configured successfully vs. hit an error.

- detectFolderMode now returns a FolderModeResult with the validation
  outcome (success / error / skipped), HTTP status, and error reason
  (unauthorized / unexpected_status / network_error). 401/403 are now
  distinguished as unauthorized instead of being treated as fixed folders.
- Events fire only on fresh validation (cache miss) across activation,
  config-file change, and environment switch. Payload carries only
  folder_mode, error_reason, status, and entry_point; no credentials.
- Cache folder mode only on a genuine success so a transient error no
  longer permanently mislabels an account's folder mode.
Folder mode (dynamic vs fixed) was cached permanently per cloud name with
no TTL or invalidation, so accounts migrated fixed->dynamic stayed mislabeled
forever and the config watcher never re-detected after a credential change.

- Add a 12h TTL so folder mode re-validates; legacy plain-boolean cache
  entries are treated as stale so stuck installs self-heal.
- Force fresh detection on config-file change.
- Keep the last known-good value on transient detection errors.
- Add a 'Cloudinary: Refresh Folder Mode' command for on-demand re-detection.
- Extract the cache logic into config/folderModeCache.ts (shared by the
  activation path and switchEnvironment) with unit tests.
The destination-folder dropdown was filled by a deferred updateFolders push
fired immediately on panel creation, which could land before the webview's
message listener attached and be dropped — leaving the dropdown root-only
until the panel was closed and reopened.

- Register the webview message handler before setting panel.webview.html, and
  gate the deferred preset/folder load on a 'ready' handshake from the client
  so updates are only posted once the listener is guaranteed to be attached.
- Show a 'Loading folders…' hint while folders fetch; clear it when they
  arrive (or fall back to root on failure).
The homescreen status pill was derived purely from non-empty credential fields,
so deleted/renamed/junk credentials still read "Connected". And folder mode was
trusted from a cloud-name-keyed cache that could certify stale credentials.

- Always validate the current credentials on activation, config save, and
  environment switch via detectFolderModeResult; the folder-mode cache is now
  only a fallback for folder-mode continuity on transient (non-auth) failures
  and never certifies that the live API key/secret are valid.
- Add resolveFolderModeState() mapping detection outcome -> { dynamicFolders,
  credentialsValid } (success=valid, 401/403=invalid, transient=unknown).
- Track credentialsValid on CloudinaryService; thread it through activation,
  config-change, switchEnvironment, and the manual refresh command.
- Gate the 'Connected' pill via isConnected(): present credentials AND not
  actively rejected. A pending/unknown validation stays optimistic so a valid
  cloud is never flashed as 'Setup needed' during startup or a network blip;
  only a definitive rejection downgrades to 'Setup needed'.
- Clearer credential-specific error message for auth failures (isCredentialError).
- Remove the now-unused folder-mode TTL helpers (detection always runs).

Tests: add resolveFolderModeState, isConnected, and isCredentialError suites
(54 passing). Verified compile, lint, and VSIX packaging.
…e (DOC-11108)

Two issues from v0.1.6 testing:

- Platform/scope reset to auto-detected values after Apply. The client reloaded
  the panel by re-sending 'aiToolsExpanded', whose handler re-runs
  detectEditorPlatform() and forces scope back to 'project'. Add a separate
  'aiToolsRefresh' message that re-renders WITHOUT resetting the user's chosen
  platform/scope, and have the post-Apply reload use it.

- No post-install guidance. MCP servers showed as configured but appeared
  inactive in the AI tool because the editor must reload first. After a
  successful install, show an information message summarising what was installed
  and, when an MCP server landed, an explicit reload/verify next step. Message
  text is built by a pure buildAiToolsNextStepsMessage() helper with unit tests.

Tests: add buildAiToolsNextStepsMessage suite (60 passing). Verified compile,
lint, and VSIX packaging.
…iew)

Codex repro (Extension Development Host): launch with valid creds (creating a
fresh folder-mode cache), close, change only the API secret to an invalid value
for the same cloud name, relaunch -> homescreen still showed "Connected" and the
"Dynamic folders" chip even though an invalid-credentials error fired.

Root causes:
- The status was computed in _sendHomescreenData BEFORE its 'await
  loadEnvironments()' but posted AFTER, so a send that began while validation
  was still in flight (credentialsValid undefined) could post a non-rejected
  state after the post-validation refresh, winning the race.
- The pill was a 2-state boolean gated optimistically (credentialsValid !==
  false), so an unknown/pending validation rendered as "Connected".

Fix:
- Replace the boolean with a tri-state getConnectionStatus(): connected (valid),
  setupNeeded (missing OR rejected), checking (present but unvalidated/offline).
  The optimistic state is now an honest "Checking…" — never "Connected" — so
  rejected or not-yet-validated credentials can never show Connected or the
  folder-mode chip, regardless of send ordering.
- Compute the status after the await and immediately before posting.
- Status bar mirrors this: rejected creds show a warning and drop the folder
  chip; unvalidated shows the cloud with no chip. Applied to activation,
  config-change, switchEnvironment, and the manual refresh command.

Tests: connectionStatus suite rewritten for the tri-state incl. the exact
stale-cache invalid-credentials case (61 passing). Verified compile, lint, VSIX.

Note: welcomeScreen.ts has the same field-presence 'hasConfig' pattern but is a
separate first-run surface, left out of scope for this ticket.
A later hardening pass replaced the client 'ready' handshake with a fixed 250ms
delay before posting folders/presets, which re-introduced the original race: if
the webview's message listener was not attached within 250ms, the updateFolders
push was dropped and the destination dropdown stayed root-only.

Wait for the client's 'ready' message before posting (with a 5s safety timeout
so a missed handshake can't hang the load), instead of a fixed delay.
- Configure always works from a clean/empty/invalid config: register commands
  and the status bar BEFORE the environment check, and treat empty, incomplete,
  or placeholder configs as 'Not Configured' instead of returning early (which
  previously left zero commands registered, so the Configure button was dead).
- Detect folder mode from the authoritative Admin API config
  (config?settings=true -> settings.folder_mode) instead of the /folders
  200/420 hack, which misreported fixed-mode accounts as dynamic.
- Add a distinct 'invalidCredentials' connection state (rejected creds), separate
  from 'setupNeeded' (missing) and 'checking' (unvalidated); thread it through the
  homescreen pill/banner and the welcome screen.
- Debounce config-file reloads and add an fs.watch fallback so external edits to
  ~/.cloudinary/environments.json are reliably picked up.
- Extract markNotConfigured()/applyEnvironment() helpers shared by activation and
  the config-change path; add configUtils/detectFolderMode/uploadWidget tests.

Verified: compile, lint, 79 tests, and live folder_mode detection across clouds.
# Conflicts:
#	test/e2e/src/utils/wdioUtils.ts
#	test/e2e/src/webViewTabs/HomeScreenViewPage.ts
@ed-cld ed-cld requested a review from njb90 July 6, 2026 18:33
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.

2 participants