Skip to content

Mass-screen validation, linkCommand auto-complete, API calls de-duplication, re-validation on active document change#15

Merged
unbrokenclayman merged 17 commits intomainfrom
improvements-after-meeting
Dec 4, 2025
Merged

Mass-screen validation, linkCommand auto-complete, API calls de-duplication, re-validation on active document change#15
unbrokenclayman merged 17 commits intomainfrom
improvements-after-meeting

Conversation

@anesvijskij
Copy link
Collaborator

This pull request introduces new screen validation commands for both HTML and TypeScript screens in the AcuMate VS Code extension, enhances backend action metadata utilities, and improves the extension's validation and completion features. The changes also add supporting scripts and update documentation to help users and CI workflows validate screens more easily. Additionally, the caching and concurrency logic for backend metadata fetching is improved to prevent redundant API calls.

New validation features and commands:

  • Added two new commands: acumate.validateScreens for validating HTML screens and acumate.validateTypeScriptScreens for validating TypeScript screens, both accessible from the command palette and via new npm scripts (validate:screens, validate:screens:ts). These commands run validation across all screens with progress reporting and output diagnostics to a dedicated channel. [1] [2] [3] [4] [5] [6]
  • Updated the README to document the new validation commands, their usage in VS Code and CLI, and how they integrate with CI and development workflows. [1] [2]

Backend metadata and completion improvements:

  • Enhanced backend action metadata utilities by introducing BackendActionMetadata and a new function buildBackendActionMap, which maps normalized action names to metadata, improving action lookup and completion. [1] [2] [3]
  • Added TypeScript completion support for @linkCommand decorators: when editing these decorators, the extension now provides completion items sourced from backend actions, making it easier to insert valid action names. [1] [2] [3]

Caching and concurrency enhancements:

  • Improved the LayeredDataService API client to cache and deduplicate in-flight requests for graphs, features, and graph structures, preventing redundant concurrent backend calls and ensuring consistent caching. [1] [2] [3] [4]

Validation UX improvements:

  • Refactored HTML validation to debounce validations, handle document lifecycle events (open, close, active editor changes), and clean up resources, resulting in a smoother and more efficient validation experience in the editor. [1] [2]

These changes collectively make screen validation more robust, user-friendly, and efficient, while also providing better completion and metadata support for AcuMate users.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request enhances the AcuMate VS Code extension with comprehensive screen validation capabilities, improved backend action metadata handling, and better developer experience through new completion and hover features. The changes introduce mass validation commands for both HTML and TypeScript screens, add linkCommand auto-completion, implement request deduplication for backend API calls, and enable re-validation on active document changes.

Key changes:

  • Added two new validation commands (validateScreens and validateTypeScriptScreens) accessible from the command palette and CLI, with progress reporting and cancellable execution
  • Implemented auto-completion for @linkCommand decorators sourced from backend action metadata
  • Enhanced hover providers to show backend metadata for PXView properties and PXActionState members
  • Improved caching layer to deduplicate concurrent API requests for graphs, features, and graph structures

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
acumate-plugin/src/validation/tsValidation/graph-info-validation.ts Added logic to skip diagnostics for fields with double underscores (custom fields)
acumate-plugin/src/validation/htmlValidation/html-validation.ts Commented out validation for missing required config properties to reduce noise
acumate-plugin/src/typescript/link-command-utils.ts New utility to locate @linkCommand decorator literals for completion support
acumate-plugin/src/completionItemProviders/ts-completion-provider.ts Added completion provider for linkCommand decorators with backend action suggestions
acumate-plugin/src/backend-metadata-utils.ts Introduced BackendActionMetadata interface and buildBackendActionMap function for better action lookup
acumate-plugin/src/providers/ts-hover-provider.ts Refactored to show metadata for PXView properties, PXFieldState fields, and PXActionState members
acumate-plugin/src/providers/html-completion-provider.ts Modified snippet generation to remove quotes from property names and attribute values
acumate-plugin/src/api/layered-data-service.ts Added in-flight request tracking to prevent redundant concurrent API calls
acumate-plugin/src/extension.ts Implemented new validation commands with debounced HTML validation and document lifecycle management
acumate-plugin/src/model/view.ts Added optional displayName property to View model
acumate-plugin/scripts/validate-screens.js New CLI script to run HTML screen validation via environment variable configuration
acumate-plugin/scripts/validate-ts-screens.js New CLI script to run TypeScript screen validation via environment variable configuration
acumate-plugin/src/test/suite/projectTsValidation.test.ts New test file for project-wide TypeScript validation
acumate-plugin/src/test/suite/projectScreenValidation.test.ts New test file for project-wide HTML screen validation
acumate-plugin/src/test/suite/tsGraphInfo.test.ts Added tests for double underscore field handling, hover metadata, and linkCommand completions
acumate-plugin/src/test/suite/htmlValidation.test.ts Removed test assertion for missing required config properties
acumate-plugin/src/test/fixtures/typescript/GraphInfoViewFieldDoubleUnderscore.ts New test fixture for double underscore field validation
acumate-plugin/readme.md Updated documentation with new validation commands and features
acumate-plugin/package.json Added command definitions and npm scripts for screen validation
Comments suppressed due to low confidence (1)

acumate-plugin/src/test/suite/htmlValidation.test.ts:287

  • The test assertion for missing required properties was removed, which reduces test coverage. This change should be aligned with the decision made in html-validation.ts (lines 464-474). If the validation for missing required properties is being intentionally removed, this test should either:
  1. Be updated to test that missing required properties are NOT reported (if that's the new expected behavior)
  2. Or be removed entirely if there's no validation to test

Simply removing the assertion without clarifying the expected behavior reduces test value.

	it('reports qp-button config.bind issues from control metadata', async () => {
		const document = await openFixtureDocument('TestConfigBindingInvalid.html');
		await validateHtmlFile(document);
		const diagnostics = AcuMateContext.HtmlValidator?.get(document.uri) ?? [];
		assert.ok(
			diagnostics.some(d => d.message.includes('property "bogus"')),
			'Expected diagnostic for unknown config property'
		);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
context.subscriptions.push(disposable);
}

async function runWorkspaceScreenValidation() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd consider to move most of this new code somewhere else to keep extension.ts as clean as possible.

async function runWorkspaceScreenValidation() {
const workspaceFolder = vscode.workspace.workspaceFolders?.[0];
if (!workspaceFolder) {
vscode.window.showWarningMessage('Open a workspace folder before running AcuMate screen validation.');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can get "workspace folder" even without workspace really opened, see workspaceFolderUri in create-screen.ts

@unbrokenclayman unbrokenclayman merged commit d51e675 into main Dec 4, 2025
1 check passed
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.

3 participants