Skip to content

Commit b31d527

Browse files
ralyodioclaude
andcommitted
feat(ai-sidebar): IRC auto-connect + web notifications (v3.5.0)
- Auto-connect to IRC on open when a full account (nick+password) is saved, instead of requiring a manual Connect click. - Web notifications (chrome.notifications) for incoming IRC messages: fires for DMs, mentions of your nick, messages in non-active channels, or any message while the panel is hidden; skips your own echo, system lines, and server notices. Clicking a notification focuses that channel. - Add the 'notifications' permission. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 5a52f4e commit b31d527

26 files changed

Lines changed: 68 additions & 28 deletions

File tree

apps/desktop/extensions/ai-sidebar/chat.js

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,40 @@ irc.addEventListener('status', (e) => {
8585
}
8686
});
8787
irc.addEventListener('joined', (e) => { ensureBuffer(e.detail.channel); if (!active) selectChannel(e.detail.channel); });
88-
irc.addEventListener('message', (e) => appendMsg(e.detail));
88+
irc.addEventListener('message', (e) => { appendMsg(e.detail); maybeNotify(e.detail); });
89+
90+
// --- web notifications for incoming IRC messages --------------------------
91+
const isDM = (line) => line.channel && !line.channel.startsWith('#');
92+
const isMention = (line) =>
93+
irc.nick && line.text && line.text.toLowerCase().includes(irc.nick.toLowerCase());
94+
95+
function maybeNotify(line) {
96+
// Only real incoming chat — skip our own echo, system lines, and server notices.
97+
if (!line || line.self || line.sys || line.notice) return;
98+
// Don't nag for the channel the user is actively reading with the panel open.
99+
const unattended = document.hidden || line.channel !== active || isDM(line) || isMention(line);
100+
if (!unattended) return;
101+
if (!chrome?.notifications?.create) return;
102+
const dm = isDM(line);
103+
chrome.notifications.create('irc:' + line.channel, {
104+
type: 'basic',
105+
iconUrl: chrome.runtime.getURL('icons/icon-128.png'),
106+
title: dm ? `IRC · ${line.from} (DM)` : `IRC · ${line.channel}`,
107+
message: `${dm ? '' : line.from + ': '}${line.text}`.slice(0, 240),
108+
priority: dm || isMention(line) ? 2 : 0,
109+
});
110+
}
111+
112+
// Clicking a notification focuses the channel it came from.
113+
if (chrome?.notifications?.onClicked) {
114+
chrome.notifications.onClicked.addListener((id) => {
115+
if (id.startsWith('irc:')) {
116+
const chan = id.slice(4);
117+
if (buffers.has(chan)) selectChannel(chan);
118+
chrome.notifications.clear(id);
119+
}
120+
});
121+
}
89122
irc.addEventListener('system', (e) => { if (e.detail.channel) appendMsg({ channel: e.detail.channel, sys: true, text: e.detail.text }); });
90123
irc.addEventListener('topic', (e) => { if (e.detail.channel === active) $('chan-title').textContent = `${e.detail.channel}${e.detail.topic}`; });
91124

@@ -119,13 +152,19 @@ $('say-form').addEventListener('submit', (e) => {
119152
$('say-input').value = '';
120153
});
121154

122-
// Prefill from saved config.
155+
// Prefill from saved config — and auto-connect if a full account is set up.
123156
(async () => {
124157
const { [STORE_KEY]: cfg } = await chrome.storage.local.get(STORE_KEY);
125158
if (cfg) {
126159
$('irc-url').value = cfg.url || $('irc-url').value;
127160
$('irc-nick').value = cfg.nick || '';
128161
$('irc-pass').value = cfg.password || '';
129162
$('irc-chans').value = (cfg.channels || ['#general']).join(' ');
163+
$('irc-remember').checked = true;
164+
// Saved nick + password = a configured account → connect without a click.
165+
if (cfg.nick && cfg.password) {
166+
setStatus('Auto-connecting…');
167+
irc.connect(cfg);
168+
}
130169
}
131170
})();

apps/desktop/extensions/ai-sidebar/manifest.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "TronBrowser",
4-
"version": "3.4.1",
4+
"version": "3.5.0",
55
"description": "TronBrowser — privacy-first, AI-native. Branded new tab, private search, CoinPay login, and a bring-your-own-keys AI sidebar.",
66
"icons": {
77
"16": "icons/icon-16.png",
@@ -17,7 +17,8 @@
1717
"scripting",
1818
"identity",
1919
"proxy",
20-
"privacy"
20+
"privacy",
21+
"notifications"
2122
],
2223
"host_permissions": [
2324
"https://api.openai.com/*",

apps/desktop/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tronbrowser/desktop",
3-
"version": "3.4.1",
3+
"version": "3.5.0",
44
"private": true,
55
"description": "Desktop shell for the TronBrowser Chromium fork",
66
"type": "module",

apps/docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tronbrowser/docs",
3-
"version": "3.4.1",
3+
"version": "3.5.0",
44
"private": true,
55
"description": "Documentation site",
66
"type": "module",

apps/extensions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tronbrowser/extensions",
3-
"version": "3.4.1",
3+
"version": "3.5.0",
44
"private": true,
55
"description": "TronBrowser extension store — pay $1, list your MV3 extension (tronbrowser.dev/store)",
66
"type": "module",

apps/mobile/app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"slug": "tronbrowserdev",
55
"owner": "profullstack",
66
"scheme": "tronbrowser",
7-
"version": "3.4.1",
7+
"version": "3.5.0",
88
"orientation": "portrait",
99
"userInterfaceStyle": "dark",
1010
"platforms": [

apps/mobile/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tronbrowser/mobile",
3-
"version": "3.4.1",
3+
"version": "3.5.0",
44
"private": true,
55
"description": "TronBrowser mobile (Expo / React Native) — Phase 2",
66
"type": "module",

apps/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tronbrowser/web",
3-
"version": "3.4.1",
3+
"version": "3.5.0",
44
"private": true,
55
"description": "TronBrowser marketing site + web dashboard",
66
"type": "module",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tronbrowser",
3-
"version": "3.4.1",
3+
"version": "3.5.0",
44
"private": true,
55
"description": "TronBrowser.dev — open-source, privacy-first, AI-native browser",
66
"packageManager": "pnpm@9.12.0",

packages/agent-runtime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tronbrowser/agent-runtime",
3-
"version": "3.4.1",
3+
"version": "3.5.0",
44
"private": true,
55
"description": "Agent runtime: planner, executor, validator, memory, tools",
66
"type": "module",

0 commit comments

Comments
 (0)