Skip to content

Commit

Permalink
chore: Update @appland/components to v4.44.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinbyrne committed Jan 24, 2025
1 parent 2431375 commit 650960d
Show file tree
Hide file tree
Showing 3 changed files with 499 additions and 417 deletions.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@
"dependencies": {
"@appland/appmap": "^3.129.0",
"@appland/client": "^1.14.1",
"@appland/components": "^4.42.0",
"@appland/components": "^4.44.0",
"@appland/diagrams": "^1.8.0",
"@appland/models": "^2.10.2",
"@appland/rpc": "^1.16.0",
Expand Down Expand Up @@ -742,5 +742,8 @@
"publisherId": "f7f1004e-6038-49cd-a096-4e618fe53f77",
"isPreReleaseVersion": false
},
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"resolutions": {
"node-gyp": "^10"
}
}
26 changes: 0 additions & 26 deletions web/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,6 @@ const moduleName = body.dataset.appmapModule;
if (moduleName in modules) {
const div = document.createElement('div');
div.id = 'app';

// Well, this is kind of gross. To make sure that focus is managed properly, we need to work around two bugs in the
// way VS Code handles focus for a webview.
//
// The first is that, after activating the tab with the webview, it sets the focus to the containing iframe, which is
// our `window`. We add a listener to watch for the focus shift. When it happens, we look for an element with the
// data attribute `focus`. If we find one, and it doesn't have focus, we focus it.
//
// The second bug is that, some time after VS Code sets the focus to the iframe, it resets it to the top-level iframe
// (the one our webview is embedded in). We don't have access to that window, so there's no way to add a listener to
// it. Instead, after a short delay, we check to see if the element we focused still has focus. If it doesn't, we set
// it again.
//
// As always, when you "fix" a problem with a delay, there's a chance that it will occasionally fail. But, this seems
// to work well enough to be worthwhile.
window.addEventListener('focus', () => {
const elt = body.querySelector('[focus]');
if (elt && document.activeElement === document.body) {
elt.focus();
setTimeout(() => {
if (document.hasFocus() && document.activeElement === document.body) {
elt.focus();
}
}, 200);
}
});
body.appendChild(div);
modules[moduleName]();
}
Loading

0 comments on commit 650960d

Please sign in to comment.