Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions docs/API-Reference/view/SidebarTabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cached jQuery/DOM references held by extensions remain valid.
* [.removeTab(id)](#module_view/SidebarTabs..removeTab) ⇒ <code>boolean</code>
* [.setActiveTab(id)](#module_view/SidebarTabs..setActiveTab)
* [.getActiveTab()](#module_view/SidebarTabs..getActiveTab) ⇒ <code>string</code>
* [.getAllTabs()](#module_view/SidebarTabs..getAllTabs) ⇒ <code>Array.&lt;{id: string, label: string, iconClass: string, priority: number}&gt;</code>
* [.TabDescriptor](#module_view/SidebarTabs..TabDescriptor) ⇒ <code>Array.&lt;TabDescriptor&gt;</code>

<a name="module_view/SidebarTabs..SIDEBAR_TAB_FILES"></a>

Expand Down Expand Up @@ -146,9 +146,18 @@ tab, hides all others.
Get the currently active tab id.

**Kind**: inner method of [<code>view/SidebarTabs</code>](#module_view/SidebarTabs)
<a name="module_view/SidebarTabs..getAllTabs"></a>
<a name="module_view/SidebarTabs..TabDescriptor"></a>

### view/SidebarTabs.getAllTabs() ⇒ <code>Array.&lt;{id: string, label: string, iconClass: string, priority: number}&gt;</code>
### view/SidebarTabs.TabDescriptor ⇒ <code>Array.&lt;TabDescriptor&gt;</code>
Get an array of all registered tab descriptors.

**Kind**: inner method of [<code>view/SidebarTabs</code>](#module_view/SidebarTabs)
**Kind**: inner typedef of [<code>view/SidebarTabs</code>](#module_view/SidebarTabs)
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| id | <code>string</code> | Unique tab identifier |
| label | <code>string</code> | Display text shown in the tab bar |
| iconClass | <code>string</code> | Icon class string |
| priority | <code>number</code> | Sort priority (lower = further left) |

99 changes: 93 additions & 6 deletions docs/API-Reference/widgets/NotificationUI.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,43 @@ const NotificationUI = brackets.getModule("widgets/NotificationUI")
<a name="module_widgets/NotificationUI"></a>

## widgets/NotificationUI
The global NotificationUI can be used to create popup notifications over dom elements or generics app notifications.A global `window.EventManager` object is made available in phoenix that can be called anytime after AppStart.This global can be triggered from anywhere without using require context.## Usage### Simple exampleFor Eg. Let's say we have to create a popup notification over the HTML element with ID `showInfileTree`.We can do this with the following
The global NotificationUI can be used to create popup notifications over dom elements or generics app notifications.

A global `window.EventManager` object is made available in phoenix that can be called anytime after AppStart.
This global can be triggered from anywhere without using require context.

## Usage
### Simple example
For Eg. Let's say we have to create a popup notification over the HTML element with ID `showInfileTree`.
We can do this with the following

**Example**
```jsconst NotificationUI = brackets.getModule("widgets/NotificationUI");// or use window.NotificationUI global object has the same effect.let notification = NotificationUI.createFromTemplate("Click me to locate the file in file tree", "showInfileTree",{});notification.done(()=>{ console.log("notification is closed in ui.");})```### Advanced exampleAnother advanced example where you can specify html and interactive components in the notification
```js
const NotificationUI = brackets.getModule("widgets/NotificationUI");
// or use window.NotificationUI global object has the same effect.
let notification = NotificationUI.createFromTemplate("Click me to locate the file in file tree", "showInfileTree",{});
notification.done(()=>{
console.log("notification is closed in ui.");
})
```
### Advanced example
Another advanced example where you can specify html and interactive components in the notification
**Example**
```js// note that you can even provide an HTML Element node with// custom event handlers directly here instead of HTML text.let notification1 = NotificationUI.createFromTemplate( "<div>Click me to locate the file in file tree</div>", "showInfileTree",{ allowedPlacements: ['top', 'bottom'], dismissOnClick: false, autoCloseTimeS: 300 // auto close the popup after 5 minutes });// do stuffnotification1.done((closeReason)=>{ console.log("notification is closed in ui reason:", closeReason);})```The `createFromTemplate` API can be configured with numerous options. See API options below.
```js
// note that you can even provide an HTML Element node with
// custom event handlers directly here instead of HTML text.
let notification1 = NotificationUI.createFromTemplate(
"<div>Click me to locate the file in file tree</div>", "showInfileTree",{
allowedPlacements: ['top', 'bottom'],
dismissOnClick: false,
autoCloseTimeS: 300 // auto close the popup after 5 minutes
});
// do stuff
notification1.done((closeReason)=>{
console.log("notification is closed in ui reason:", closeReason);
})
```
The `createFromTemplate` API can be configured with numerous options. See API options below.

* [widgets/NotificationUI](#module_widgets/NotificationUI)
* [.API](#module_widgets/NotificationUI..API)
Expand All @@ -20,6 +51,7 @@ The global NotificationUI can be used to create popup notifications over dom ele
* [.createFromTemplate(title, template, [elementID], [options])](#module_widgets/NotificationUI..createFromTemplate) ⇒ <code>Notification</code>
* [.createToastFromTemplate(title, template, [options])](#module_widgets/NotificationUI..createToastFromTemplate) ⇒ <code>Notification</code>
* [.showToastOn(containerOrSelector, template, [options])](#module_widgets/NotificationUI..showToastOn) ⇒ <code>Notification</code>
* [.showHUD(iconClass, label, [options])](#module_widgets/NotificationUI..showHUD) ⇒ <code>Notification</code>

<a name="module_widgets/NotificationUI..API"></a>

Expand Down Expand Up @@ -60,7 +92,21 @@ Closing notification reason.
<a name="module_widgets/NotificationUI..createFromTemplate"></a>

### widgets/NotificationUI.createFromTemplate(title, template, [elementID], [options]) ⇒ <code>Notification</code>
Creates a new notification popup from given template.The template can either be a string or a jQuery object representing a DOM node that is *not* in the current DOM.Creating a notification popup```js// note that you can even provide an HTML Element node with// custom event handlers directly here instead of HTML text.let notification1 = NotificationUI.createFromTemplate( "<div>Click me to locate the file in file tree</div>", "showInfileTree",{ allowedPlacements: ['top', 'bottom'], dismissOnClick: false, autoCloseTimeS: 300 // auto close the popup after 5 minutes });```
Creates a new notification popup from given template.
The template can either be a string or a jQuery object representing a DOM node that is *not* in the current DOM.

Creating a notification popup

```js
// note that you can even provide an HTML Element node with
// custom event handlers directly here instead of HTML text.
let notification1 = NotificationUI.createFromTemplate(
"<div>Click me to locate the file in file tree</div>", "showInfileTree",{
allowedPlacements: ['top', 'bottom'],
dismissOnClick: false,
autoCloseTimeS: 300 // auto close the popup after 5 minutes
});
```

**Kind**: inner method of [<code>widgets/NotificationUI</code>](#module_widgets/NotificationUI)
**Returns**: <code>Notification</code> - Object with a done handler that resolves when the notification closes.
Expand All @@ -75,7 +121,20 @@ Creates a new notification popup from given template. The template can either be
<a name="module_widgets/NotificationUI..createToastFromTemplate"></a>

### widgets/NotificationUI.createToastFromTemplate(title, template, [options]) ⇒ <code>Notification</code>
Creates a new toast notification popup from given title and html message.The message can either be a string or a jQuery object representing a DOM node that is *not* in the current DOM.Creating a toast notification popup```js// note that you can even provide an HTML Element node with// custom event handlers directly here instead of HTML text.let notification1 = NotificationUI.createToastFromTemplate( "Title here", "<div>Click me to locate the file in file tree</div>", { dismissOnClick: false, autoCloseTimeS: 300 // auto close the popup after 5 minutes });```
Creates a new toast notification popup from given title and html message.
The message can either be a string or a jQuery object representing a DOM node that is *not* in the current DOM.

Creating a toast notification popup

```js
// note that you can even provide an HTML Element node with
// custom event handlers directly here instead of HTML text.
let notification1 = NotificationUI.createToastFromTemplate( "Title here",
"<div>Click me to locate the file in file tree</div>", {
dismissOnClick: false,
autoCloseTimeS: 300 // auto close the popup after 5 minutes
});
```

**Kind**: inner method of [<code>widgets/NotificationUI</code>](#module_widgets/NotificationUI)
**Returns**: <code>Notification</code> - Object with a done handler that resolves when the notification closes.
Expand All @@ -89,7 +148,15 @@ Creates a new toast notification popup from given title and html message. The me
<a name="module_widgets/NotificationUI..showToastOn"></a>

### widgets/NotificationUI.showToastOn(containerOrSelector, template, [options]) ⇒ <code>Notification</code>
Shows a small, transient inline toast notification inside a given DOM container.The toast is centered at the bottom of the container and auto-dismisses.```jsNotificationUI.showToastOn(document.getElementById("my-panel"), "Hello!", { autoCloseTimeS: 5, dismissOnClick: true});```
Shows a small, transient inline toast notification inside a given DOM container.
The toast is centered at the bottom of the container and auto-dismisses.

```js
NotificationUI.showToastOn(document.getElementById("my-panel"), "Hello!", {
autoCloseTimeS: 5,
dismissOnClick: true
});
```

**Kind**: inner method of [<code>widgets/NotificationUI</code>](#module_widgets/NotificationUI)
**Returns**: <code>Notification</code> - Object with a done handler that resolves when the toast closes.
Expand All @@ -100,3 +167,23 @@ Shows a small, transient inline toast notification inside a given DOM container.
| template | <code>string</code> \| <code>Element</code> | HTML string or DOM Element for the toast content. |
| [options] | <code>Object</code> | optional, supported options: * `autoCloseTimeS` - Time in seconds after which the toast auto-closes. Default is 5. * `dismissOnClick` - If true, clicking the toast dismisses it. Default is true. |

<a name="module_widgets/NotificationUI..showHUD"></a>

### widgets/NotificationUI.showHUD(iconClass, label, [options]) ⇒ <code>Notification</code>
Shows a large, centered HUD overlay (like macOS volume/brightness indicator) with an icon and label.
The HUD fades in/out and auto-dismisses. Only one HUD is shown at a time — calling this while a
previous HUD is visible replaces it instantly.

```js
NotificationUI.showHUD("fa-solid fa-magnifying-glass-plus", "110%");
```

**Kind**: inner method of [<code>widgets/NotificationUI</code>](#module_widgets/NotificationUI)
**Returns**: <code>Notification</code> - Object with a done handler that resolves when the HUD closes.

| Param | Type | Description |
| --- | --- | --- |
| iconClass | <code>string</code> | Font Awesome class string for the icon (e.g. "fa-solid fa-magnifying-glass-plus"). |
| label | <code>string</code> | Text to display below the icon (e.g. "110%"). |
| [options] | <code>Object</code> | optional, supported options: * `autoCloseTimeS` - Time in seconds after which the HUD auto-closes. Default is 1. |

22 changes: 20 additions & 2 deletions src-node/claude-code-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ async function _runQuery(requestId, prompt, projectPath, model, signal, locale,
const queryOptions = {
cwd: projectPath || process.cwd(),
maxTurns: undefined,
stderr: (data) => console.log("[AI stderr]", data),
allowedTools: [
"Read", "Edit", "Write", "Glob", "Grep", "Bash",
"AskUserQuestion", "Task",
Expand Down Expand Up @@ -584,10 +585,27 @@ async function _runQuery(requestId, prompt, projectPath, model, signal, locale,
let sdkPrompt = prompt;
if (images && images.length > 0) {
const contentBlocks = [{ type: "text", text: prompt }];
images.forEach(function (img) {
images.forEach(function (img, idx) {
// Infer media type from base64 header if missing
let mediaType = img.mediaType;
if (!mediaType && img.base64Data) {
if (img.base64Data.startsWith("iVBOR")) {
mediaType = "image/png";
} else if (img.base64Data.startsWith("/9j/")) {
mediaType = "image/jpeg";
} else if (img.base64Data.startsWith("R0lGOD")) {
mediaType = "image/gif";
} else if (img.base64Data.startsWith("UklGR")) {
mediaType = "image/webp";
} else {
mediaType = "image/png";
}
}
_log("Image[" + idx + "]:", "mediaType=" + mediaType,
"base64Len=" + (img.base64Data ? img.base64Data.length : "null"));
contentBlocks.push({
type: "image",
source: { type: "base64", media_type: img.mediaType, data: img.base64Data }
source: { type: "base64", media_type: mediaType, data: img.base64Data }
});
});
sdkPrompt = (async function* () {
Expand Down
6 changes: 5 additions & 1 deletion src/core-ai/AIChatPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,10 @@ define(function (require, exports, module) {
}
imageFound = true;
const blob = item.getAsFile();
// Capture mediaType synchronously — DataTransferItem properties
// become invalid after the paste event handler returns, but
// the File object's type persists across the async boundary.
const mediaType = blob.type || item.type;
const reader = new FileReader();
reader.onload = function (ev) {
const dataUrl = ev.target.result;
Expand All @@ -454,7 +458,7 @@ define(function (require, exports, module) {
_addImageIfUnique(resized.dataUrl, resized.mediaType, resized.base64Data);
});
} else {
_addImageIfUnique(dataUrl, item.type, base64Data);
_addImageIfUnique(dataUrl, mediaType, base64Data);
}
};
reader.readAsDataURL(blob);
Expand Down
8 changes: 7 additions & 1 deletion src/view/SidebarTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,13 @@ define(function (require, exports, module) {

/**
* Get an array of all registered tab descriptors.
* @return {Array.<{id: string, label: string, iconClass: string, priority: number}>}
* @typedef {Object} TabDescriptor
* @property {string} id - Unique tab identifier
* @property {string} label - Display text shown in the tab bar
* @property {string} iconClass - Icon class string
* @property {number} priority - Sort priority (lower = further left)
*
* @return {Array<TabDescriptor>}
*/
function getAllTabs() {
return _tabs.map(function (tab) {
Expand Down
Loading