Skip to content

Commit cc51261

Browse files
njb90claude
andcommitted
feat: rework homescreen dashboard with search, env switcher, and AI tools panel
- Add inline search input to dashboard that focuses when triggering the search command from the library toolbar (replaces VS Code input dialog) - Add environment switcher button when 2+ environments are configured - Show folder mode (Dynamic/Fixed) subtitle under the cloud name - Add gear button in the header bottom row to open the credentials config - Rework welcome guide to focus on initial setup only; remove MCP/AI tool setup guides and simplify to credential configuration steps - Extract all homescreen inline CSS into media/styles/homescreen.css; add additionalStyles support to createWebviewDocument/WebviewDocumentOptions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 27d9661 commit cc51261

10 files changed

Lines changed: 1158 additions & 1021 deletions

File tree

media/styles/homescreen.css

Lines changed: 603 additions & 0 deletions
Large diffs are not rendered by default.

src/commands/registerCommands.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,20 @@ import registerClearSearch from "./clearSearch";
99
import registerWelcomeScreen from "./welcomeScreen";
1010
import registerConfigureAiTools from "./configureAiTools";
1111
import { CloudinaryTreeDataProvider } from "../tree/treeDataProvider";
12+
import { HomescreenViewProvider } from "../webview/homescreenView";
1213

1314
/**
1415
* Registers all Cloudinary-related commands with the VS Code command registry.
1516
* @param context - The extension context.
1617
* @param provider - The Cloudinary tree data provider.
1718
* @param statusBar - Status bar item to show current environment.
19+
* @param homescreenProvider - The homescreen webview view provider.
1820
*/
1921
function registerAllCommands(
2022
context: vscode.ExtensionContext,
2123
provider: CloudinaryTreeDataProvider,
22-
statusBar: vscode.StatusBarItem
24+
statusBar: vscode.StatusBarItem,
25+
homescreenProvider: HomescreenViewProvider
2326
) {
2427
context.subscriptions.push(
2528
vscode.commands.registerCommand("cloudinary.showHomescreen", () => {
@@ -45,7 +48,7 @@ function registerAllCommands(
4548
)
4649
);
4750

48-
registerSearch(context, provider);
51+
registerSearch(context, provider, homescreenProvider);
4952
registerClearSearch(context, provider);
5053
registerViewOptions(context, provider);
5154
registerPreview(context);

src/commands/searchAssets.ts

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
11
import * as vscode from "vscode";
22
import { CloudinaryTreeDataProvider } from "../tree/treeDataProvider";
3+
import { HomescreenViewProvider } from "../webview/homescreenView";
34

45
/**
5-
* Registers a command that allows users to search for Cloudinary assets by public ID.
6-
* @param context - The VS Code extension context.
7-
* @param provider - Cloudinary tree data provider used to refresh view based on search.
6+
* Registers the search command. Opens the dashboard and focuses its search input.
87
*/
98
function registerSearch(
109
context: vscode.ExtensionContext,
11-
provider: CloudinaryTreeDataProvider
10+
_provider: CloudinaryTreeDataProvider,
11+
homescreenProvider: HomescreenViewProvider
1212
) {
1313
context.subscriptions.push(
14-
vscode.commands.registerCommand("cloudinary.searchAssets", async () => {
15-
const query = await vscode.window.showInputBox({
16-
placeHolder: "Search for a public id",
17-
});
18-
19-
if (query !== undefined && query.trim() !== "") {
20-
provider.refresh({ searchQuery: query.trim() });
21-
} else {
22-
vscode.window.showErrorMessage("Search query cannot be empty.");
23-
}
14+
vscode.commands.registerCommand("cloudinary.searchAssets", () => {
15+
homescreenProvider.focusSearch();
2416
})
2517
);
2618
}
2719

28-
export default registerSearch;
20+
export default registerSearch;

0 commit comments

Comments
 (0)