Skip to content

Commit 923378e

Browse files
feat(resources): move Resource Details to the bottom panel
Relocate the Resource Details webview from the left activity-bar container to its own bottom-panel container (localstackPanel), giving the key/value table room to breathe. Explore and Resources stay in the sidebar, now split 50/50 by default (Resources size 2 -> 1). Selecting a resource reveals the panel via WebviewView.show(true), which brings the tab forward without stealing keyboard focus, so arrow-key browsing in the Resources tree keeps working and details follow live. The first reveal (before the view has resolved) falls back to the auto- generated <viewId>.focus command to open the panel. Also cap the Resource Details field-label column at 20% (was 33%); the fixed table layout makes that a hard cap so long labels wrap rather than widen the column. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3e66235 commit 923378e

3 files changed

Lines changed: 32 additions & 7 deletions

File tree

package.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,13 @@
137137
"title": "LocalStack",
138138
"icon": "resources/icons/localstack.svg"
139139
}
140+
],
141+
"panel": [
142+
{
143+
"id": "localstackPanel",
144+
"title": "Resource Details",
145+
"icon": "resources/icons/localstack.svg"
146+
}
140147
]
141148
},
142149
"views": {
@@ -151,14 +158,15 @@
151158
"id": "localstack.resources",
152159
"name": "Resources",
153160
"icon": "resources/icons/localstack.svg",
154-
"size": 2
155-
},
161+
"size": 1
162+
}
163+
],
164+
"localstackPanel": [
156165
{
157166
"id": "localstack.resourceDetails",
158167
"name": "Resource Details",
159168
"icon": "resources/icons/localstack.svg",
160-
"type": "webview",
161-
"size": 1
169+
"type": "webview"
162170
}
163171
]
164172
},

src/plugins/resource-browser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export default createPlugin(
4242
const item = e.selection[0];
4343
const profile = item.parent.parent.parent.profile.id;
4444
detailsProvider.setArn(profile, item.arn);
45+
detailsProvider.reveal();
4546
}
4647
}),
4748
);

src/views/resource-details/viewProvider.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { commands } from "vscode";
12
import type * as vscode from "vscode";
23

34
import ARN from "../../platforms/aws/models/arnModel.ts";
@@ -44,7 +45,7 @@ const STYLES = `
4445
border-collapse: collapse;
4546
width: 100%;
4647
/* Fixed layout makes the column widths below hard caps, so a long field
47-
* label wraps within its 33% column instead of stretching it. */
48+
* label wraps within its 20% column instead of stretching it. */
4849
table-layout: fixed;
4950
}
5051
td {
@@ -54,12 +55,12 @@ const STYLES = `
5455
}
5556
td.field {
5657
color: var(--vscode-descriptionForeground);
57-
width: 33%;
58+
width: 20%;
5859
white-space: normal;
5960
overflow-wrap: break-word;
6061
}
6162
td.value {
62-
width: 67%;
63+
width: 80%;
6364
word-break: break-word;
6465
}
6566
.mono {
@@ -119,6 +120,21 @@ export class ResourceDetailsViewProvider implements vscode.WebviewViewProvider {
119120
this.render();
120121
}
121122

123+
/**
124+
* Bring the Resource Details panel forward without stealing keyboard focus,
125+
* so the user can keep arrow-key browsing the Resources tree while details
126+
* follow live. Before the panel has ever been opened the view isn't resolved
127+
* yet, so fall back to the auto-generated focus command to open it the first
128+
* time (that one reveal does take focus).
129+
*/
130+
public reveal(): void {
131+
if (this.view) {
132+
this.view.show(true); // preserveFocus: keep focus in the Resources tree
133+
} else {
134+
void commands.executeCommand("localstack.resourceDetails.focus");
135+
}
136+
}
137+
122138
/** Render the current state into the webview (no-op until it is resolved). */
123139
private render(): void {
124140
if (!this.view) {

0 commit comments

Comments
 (0)