Skip to content

Commit

Permalink
✨ Integrate results view with diff view & add Kai fix webview panel (#90
Browse files Browse the repository at this point in the history
)

- Add webview messaging for solution request and confirmation for
communication between all 3 webviews. New handlers created.
- When a solution is requested (getSolution command), the solution is
immediately applied.
- This triggers the opening of a kai fix viewer (webview panel) that
displays the violation and other incidents based on lightbulb click
context.
- Sets up the plumbing to allow the creation of a new webview that
supports opening a panel. Augmented the current webview provider to
allow this.
- This new panel is initialized on solution request. Resolution panel
outer webview is created on startup just like the analysis webview - Was
able to setup a new var for view type and pass that down when webview is
initialized so that our react app can conditionally render / route to
different components based on this var. So we have 2 entirely seperate
webviews that can be messaged and handle requests .. we just have to
grab it from the new map in extension state and make a request to it.
They both are fed the same react app, we just conditionally show what is
there based on the viewtype var.

- Logic to handle queue for resolution panel since it is created &
messaged at same time during solution request.
- Opening a webview panel vs a webview has its own lifecycle that made
creating the panel & then sending a message to it very interesting.
The panel needs to exist and have the listener set up before it can
receive messages, so needed to implement a queue system. Messages are
pushed to the queue if the webview panel isnt ready and then looped
through and sent once the panel exists.
- Refactor the analysis view card to use PF6 card header & expansion
techniques. Allows us the ability to use the dropdown as a part of the
card actions. This is where the fix all button currently sits which
requests solutions for all incidents within the parent violation
umbrella.
- Adds a lightbulb icon at the incident level for triggering single
incident solution requests.


TODO:
- Expand the sharedState in extension state to handle state flags for
isAnalyzing and isWaiting for solution. Make use of event emitters.
#98
- Determine how webview reacts to analysis run from command palette
directly and ensure no gaps
#99

---------

Signed-off-by: Ian Bolton <[email protected]>
Co-authored-by: Radoslaw Szwajkowski <[email protected]>
  • Loading branch information
ibolton336 and rszwajko authored Nov 19, 2024
1 parent 96c853c commit cb2c2a9
Show file tree
Hide file tree
Showing 33 changed files with 1,441 additions and 913 deletions.
10 changes: 10 additions & 0 deletions mocks/coolstore_fix_catalog_source_javax_ejb_Stateless.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"errors": [],
"changes": [
{
"original": "src/main/java/com/redhat/coolstore/service/CatalogService.java",
"modified": "src/main/java/com/redhat/coolstore/service/CatalogService.java",
"diff": "diff --git a/src/main/java/com/redhat/coolstore/service/CatalogService.java b/src/main/java/com/redhat/coolstore/service/CatalogService.java\nindex 422a3f4..9a6feff 100644\n--- a/src/main/java/com/redhat/coolstore/service/CatalogService.java\n+++ b/src/main/java/com/redhat/coolstore/service/CatalogService.java\n@@ -9,12 +9,12 @@ import javax.persistence.criteria.CriteriaBuilder;\n import javax.persistence.criteria.CriteriaQuery;\n import javax.persistence.criteria.Root;\n \n-import javax.ejb.Stateless;\n+import jakarta.enterprise.context.ApplicationScoped;\n import javax.persistence.EntityManager;\n \n import com.redhat.coolstore.model.*;\n \n-@Stateless\n+@ApplicationScoped\n public class CatalogService {\n \n @Inject\n"
}
]
}
103 changes: 103 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions shared/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Uri } from "vscode";

export interface Incident {
uri: string;
lineNumber: number;
Expand Down Expand Up @@ -82,3 +84,17 @@ export interface GetSolutionResult {
errors: string[];
changes: Change[];
}

export interface LocalChange {
modifiedUri: Uri;
originalUri: Uri;
diff: string;
}

export interface ResolutionMessage {
type: string;
solution: GetSolutionResult;
violation: Violation;
incident: Incident;
isRelevantSolution: boolean;
}
8 changes: 4 additions & 4 deletions vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@
"konveyor": [
{
"type": "webview",
"id": "konveyor.konveyorGUIView",
"name": "Konveyor",
"id": "konveyor.konveyorAnalysisView",
"name": "Konveyor Analysis View",
"visibility": "visible"
},
{
Expand All @@ -196,7 +196,7 @@
{
"command": "konveyor.toggleFullScreen",
"group": "navigation@1",
"when": "view == konveyor.konveyorGUIView"
"when": "view == konveyor.konveyorAnalysisView"
},
{
"command": "konveyor.applyAll",
Expand Down Expand Up @@ -245,7 +245,7 @@
{
"command": "konveyor.toggleFullScreen",
"group": "navigation@1",
"when": "activeWebviewPanelId == konveyor.konveyorGUIView"
"when": "activeWebviewPanelId == konveyor.konveyorAnalysisView"
}
],
"explorer/context": [
Expand Down
Loading

0 comments on commit cb2c2a9

Please sign in to comment.