Skip to content

fix(vscode): pre-fill artifact name and enable type-ahead in webview#183

Merged
jung-thomas merged 1 commit into
fix/vscode-subfolder-connection-resolutionfrom
fix/vscode-artifact-inspector-name-suggestions
Jul 14, 2026
Merged

fix(vscode): pre-fill artifact name and enable type-ahead in webview#183
jung-thomas merged 1 commit into
fix/vscode-subfolder-connection-resolutionfrom
fix/vscode-artifact-inspector-name-suggestions

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Stacked on #182 — base is fix/vscode-subfolder-connection-resolution. Merge #182 first; this PR's base will retarget to main automatically once #182 lands.

Problems

Two related bugs in the VS Code extension's artifact inspectors (reported after testing #182):

  1. Object name not passed to the input. Clicking an .hdbtable / .hdbmigrationtable (and other artifact files) opened the inspector but left the name input empty. The extension posted an openArtifact message that no Vue component consumed, and opened the view with no query params.

  2. No type-ahead completion. Typing in the webview inputs (schema/table/…) surfaced no suggestions. useSuggestions fetched with relative URLs, which in the webview resolve against the vscode-webview:// origin instead of the http://localhost:<port> server, so the requests never reached it.

Both are extension↔webview integration mismatches with the browser assumptions.

Fixes

  • artifactInspector.ts — pass the artifact name as a route query param the target view already reads (e.g. /inspect-table?table=NAME), matching how the browser UI navigates (Functions.vuequery: { function, schema }). Added a per-kind queryKey mapping; covers table/view/function/procedure/synonym/role/sequence. Removed the dead openArtifact post.
  • useSuggestions.ts — prefix both fetches with getAdapter().getApiBaseUrl() (same pattern as useHanaApi). Safe in the browser too, where it returns window.location.origin.

Testing

  • New app/vue/src/composables/__tests__/useSuggestions.test.ts — 2 tests (TDD red→green): asserts requests are prefixed with the adapter base URL and name-field mapping works.
  • Full vue suite: 51/51 green. CLI changeLog test green.
  • Verified end-to-end in VS Code (0.1.8): clicking an .hdbtable pre-fills the name and auto-loads; type-ahead works in the inputs. Confirmed by the reporter.

Release

Cut 4.202607.1 via scripts/prepare-release.js (the sanctioned release path — bumps root + mcp-server + server.json, prepends CHANGELOG.json, regenerates CHANGELOG.md). The entry documents these two fixes plus the unreleased #182 work (subfolder connection resolution, hana-cli.projectPath, vscode status update-check).

Two related artifact-inspector bugs in the VS Code extension:

1. Clicking an .hdbtable/.hdbview/etc. opened the inspector but left the
   object-name input empty. The extension posted an `openArtifact`
   message that no Vue component consumed. Fix: pass the name as a route
   query param the views already read (e.g. /inspect-table?table=NAME),
   matching how the browser UI navigates. Covers all artifact kinds.

2. Type-ahead suggestions never appeared in webview inputs. useSuggestions
   fetched with relative URLs, which resolve against the vscode-webview://
   origin instead of the http://localhost:<port> server. Fix: prefix
   fetches with getAdapter().getApiBaseUrl(), matching useHanaApi.

Also cut release 4.202607.1 (via scripts/prepare-release.js) documenting
these fixes plus the unreleased subfolder connection-resolution work and
`vscode status` update-check from PR #182.

Tests: new useSuggestions vitest (TDD red->green); full vue suite 51/51.
@jung-thomas jung-thomas merged commit ff59004 into fix/vscode-subfolder-connection-resolution Jul 14, 2026
8 checks passed
jung-thomas added a commit that referenced this pull request Jul 14, 2026
…02607.1 (#184)

Re-lands PR #183 onto main. #183 was merged into its stacked base branch
(fix/vscode-subfolder-connection-resolution) rather than main, so these
changes never reached main.

- artifactInspector.ts: pass artifact name as a route query param the Vue
  views already read (/inspect-table?table=NAME), fixing the empty input
- useSuggestions.ts: prefix fetches with getAdapter().getApiBaseUrl() so
  type-ahead works in the vscode-webview:// origin
- release 4.202607.1 (version bumps + CHANGELOG) via prepare-release.js

Co-authored-by: Thomas Jung <12159356+jung-thomas@users.noreply.github.com>
@jung-thomas jung-thomas deleted the fix/vscode-artifact-inspector-name-suggestions branch July 14, 2026 14:03
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