opencaesar / oml-vision

A VS Code extension providing UI viewpoints for OML models
Other
4 stars 2 forks source link

Property Panel does not immediately open when clicking a row or node #61

Open pogi7 opened 6 months ago

pogi7 commented 6 months ago

Checklist before submitting a bug report

Context

[Give a concise summary of the bug that you have encountered] Property Panel does not immediately open when clicking a row or node

Steps to reproduce the bug

[List of the steps to reproduce the bug. If relevant, you may add OML Vision code snippets or files that exhibit the bug.]

  1. Start OML Vision for the first time
  2. Click on any row or node
  3. The property panel won't open

Current result

[What currently happens] The property panel won't open

Expected result

[What is expected to happen instead]

  1. The property panel should immediately open when you click a row or node in the TableView, TreeView, or DiagramView.

Additional context

[Any additional context. If applicable, you may provide screenshots and/or error logs.]

Possible fix

[Not required but you can suggest possible fixes for the bug or link a place in the code that could possibly be causing the bug]

context.subscriptions.push(
    vscode.commands.registerCommand(
      "oml-vision.showProperties",
      async (iri: string = "", webviewType: IWebviewType) => {
        let types: string[] = [];
        if (iri !== "") {
          const rawTypesQuery = getIriTypes(iri);
          const sparqlResult = await SparqlClient(rawTypesQuery, "query");
          types = sparqlResult.map((entry: ITableData) => entry.type);
        }

        const propertyData = {
          webviewType: webviewType,
          rowIri: iri,
          tableRowTypes: types,
        };
        provider.setPendingPayload(propertyData);

        // Try to set the properties before focusing.
        // If successful, the pendingPayload that was just set
        // above will be cleared via the receivedProperties acknowledgement
        // in the panel provider. Race condition handling :(
        provider.sendMessage({
          command: Commands.SHOW_PROPERTIES,
          payload: propertyData,
        });
        provider.showPropertyPanel();
      }
    )
  );

the method provider.showPropertyPanel(); should be called before provider.setPendingPayload(payloadData); to open the property panel immediately.

Technical data

pogi7 commented 5 months ago

This ticket should be reopened since the property panel does not immediately open