Skip to content

armgit / Orkas

Public Imported from GitHub
0

Orkas is an open-source (MIT), local-first AI team for your desktop: a Commander turns your goal into to-dos and coordinates 16 built-in specialist agents plus Claude Code, Codex, OpenCode, OpenClaw and Hermes, with projects, scheduled automations and connectors. Free app for macOS & Windows; built-in models or your own keys.

fix(settings): correct notification warning and avatar entry

YToolbox28e51d0a7051
diff --git a/.gitignore b/.gitignore
index 76cbf45a..fa2c1012 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,4 +12,5 @@
/resources/runtime/ffmpeg
/resources/runtime/whisper
/resources/runtime/vc
+/src/main/native/build/
/userWorkSpace
diff --git a/src/renderer/index.html b/src/renderer/index.html
index 862b4f36..3115aa33 100644
--- a/src/renderer/index.html
+++ b/src/renderer/index.html
@@ -1025,17 +1025,6 @@
</div>
</div>
- <div class="settings-group">
- <div class="settings-group-head">
- <div class="settings-group-title" data-i18n="settings.commander_avatar.title">Commander avatar</div>
- <div class="settings-group-sub" data-i18n="settings.commander_avatar.sub">Click the avatar to pick a new color.</div>
- </div>
- <div class="settings-row">
- <span class="settings-commander-avatar-slot" id="settings-commander-avatar"></span>
- <span class="settings-status muted" id="settings-commander-avatar-hint" data-i18n="settings.commander_avatar.hint">Click the avatar on the left to change it</span>
- </div>
- </div>
-
<div class="settings-group">
<div class="settings-group-head">
<div class="settings-group-title" data-i18n="settings.localexec.title">Tool Execution Access</div>
diff --git a/src/renderer/modules/settings.js b/src/renderer/modules/settings.js
index a98c7048..0ac3a450 100644
--- a/src/renderer/modules/settings.js
+++ b/src/renderer/modules/settings.js
@@ -71,7 +71,6 @@ async function loadSettings() {
_settingsSafeCall('settings video refresh', _settingsRefreshVideoProfiles),
_settingsSafeCall('settings tts refresh', _settingsRefreshTtsProfiles),
_settingsSafeCall('settings task notifications refresh', _settingsRefreshTaskNotifications),
- _settingsSafeCall('settings commander avatar refresh', _settingsRefreshCommanderAvatar),
_settingsSafeCall('settings metacognition refresh', _settingsRefreshMetacognition),
_settingsSafeCall('settings data root refresh', _settingsRefreshDataRoot),
]);
@@ -83,7 +82,6 @@ async function loadSettings() {
await _settingsSafeCall('settings video render', _settingsRenderVideoSection);
await _settingsSafeCall('settings tts render', _settingsRenderTtsEntries);
await _settingsSafeCall('settings task notifications render', _settingsRenderTaskNotifications);
- await _settingsSafeCall('settings commander avatar render', _settingsRenderCommanderAvatar);
await _settingsSafeCall('settings metacognition render', _settingsRenderMetacognition);
await _settingsSafeCall('settings data root render', _settingsRenderDataRoot);
// Account card + subscription card (views/login/account_settings.js — absent in
@@ -152,7 +150,14 @@ function _settingsRenderTaskNotifications() {
const warning = document.getElementById('settings-task-notification-permission');
const openBtn = document.getElementById('settings-task-notification-open-settings');
- const permissionDenied = state.enabled && state.permission && state.permission.state === 'denied';
+ // Only make the definitive "system notifications are off" claim when the
+ // platform also exposes an actionable per-app settings destination. A
+ // delivery failure on an unsupported/unprobeable desktop can surface as
+ // `denied` without proving that the user disabled Orkas in system settings.
+ const permissionDenied = state.enabled
+ && state.permission
+ && state.permission.state === 'denied'
+ && state.permission.can_open_settings;
if (warning) warning.hidden = !permissionDenied;
if (openBtn) {
openBtn.hidden = !(state.permission && state.permission.can_open_settings);
@@ -220,70 +225,6 @@ function _settingsRenderTaskNotifications() {
function _settingsBindClientConfigOnce() {}
-// ── Commander avatar ──
-// Commander avatar goes through the prefs IPC and lands in
-// preferences.json. After a change we immediately push it back to the
-// cache (conversation.js's _commanderAvatarCache) so chat rows pick up
-// the new avatar without waiting for the next view switch.
-
-function _settingsCommanderDefaultAvatar() {
- if (typeof COMMANDER_DEFAULT !== 'undefined' && COMMANDER_DEFAULT) {
- return { ...COMMANDER_DEFAULT };
- }
- return { icon: 'crown', color: 'gold' };
-}
-
-async function _settingsRefreshCommanderAvatar() {
- try {
- const res = await window.orkas.invoke('prefs.getCommanderAvatar');
- _settingsState.commanderAvatar = (res && res.avatar)
- ? { icon: res.avatar.icon, color: res.avatar.color }
- : _settingsCommanderDefaultAvatar();
- } catch (_) {
- _settingsState.commanderAvatar = _settingsCommanderDefaultAvatar();
- }
-}
-
-function _settingsRenderCommanderAvatar() {
- const slot = document.getElementById('settings-commander-avatar');
- if (!slot) return;
- const cur = _settingsState.commanderAvatar || _settingsCommanderDefaultAvatar();
- if (typeof renderAvatarHtml !== 'function') return;
- slot.innerHTML = renderAvatarHtml(cur.icon, cur.color, {
- size: 44, seed: 'commander', clickable: true,
- });
- const trigger = slot.querySelector('.avatar-circle');
- if (!trigger) return;
- trigger.title = t('avatar.change');
- trigger.addEventListener('click', (e) => {
- e.stopPropagation();
- if (typeof openAvatarPicker !== 'function') return;
- if (typeof isAvatarPickerOpenFor === 'function' && isAvatarPickerOpenFor(trigger)) {
- if (typeof closeAvatarPicker === 'function') closeAvatarPicker();
- return;
- }
- // The commander avatar's icon is fixed at crown, so the picker
- // only shows the color row. Backend validation still requires both
- // tokens, so we force-write crown on save.
- openAvatarPicker(trigger, cur, { allowCommanderCombo: true, hideIcons: true }, async (next) => {
- const icon = _settingsCommanderDefaultAvatar().icon;
- _settingsState.commanderAvatar = { icon, color: next.color };
- cur.icon = icon; cur.color = next.color;
- // Update in place — the trigger's click listener is preserved so
- // the user can click a few times in a row until satisfied.
- if (typeof applyAvatarToElement === 'function') applyAvatarToElement(trigger, icon, next.color, 'commander');
- try {
- const res = await window.orkas.invoke('prefs.setCommanderAvatar', { icon, color: next.color });
- if (res?.ok && res.avatar) {
- if (typeof setCommanderAvatarCache === 'function') setCommanderAvatarCache(res.avatar);
- }
- } catch (err) {
- _settingsLog.warn('save commander avatar failed', err);
- }
- });
- });
-}
-
// ── Tool execution access permission ──
const _LOCALEXEC_MODES = ['workspace_approval', 'all_files_approval', 'all_files_auto'];
diff --git a/src/renderer/style.css b/src/renderer/style.css
index ad72c2a3..624683f1 100644
--- a/src/renderer/style.css
+++ b/src/renderer/style.css
@@ -13056,13 +13056,6 @@ body.model-not-configured .main-content { flex-direction: column; }
margin-right: 4px;
}
-/* Settings page commander avatar slot */
-.settings-commander-avatar-slot {
- display: inline-flex;
- align-items: center;
- flex-shrink: 0;
-}
-
/* ─── Avatar picker popover ───────────────────────────────────────────── */
.avatar-picker {
position: fixed;
diff --git a/test/renderer/settings-task-notifications.test.ts b/test/renderer/settings-task-notifications.test.ts
index e3e78c9d..7840ff6e 100644
--- a/test/renderer/settings-task-notifications.test.ts
+++ b/test/renderer/settings-task-notifications.test.ts
@@ -209,4 +209,17 @@ describe('Settings → General task notification toggle', () => {
expect(warning.hidden).toBe(true);
});
+
+ it('does not claim system settings disabled Orkas when no per-app settings destination is available', async () => {
+ const { sandbox, warning, openButton } = loadHarness(
+ { ok: true },
+ { state: 'denied', can_open_settings: false },
+ true,
+ );
+ await sandbox._settingsRefreshTaskNotifications();
+ sandbox._settingsRenderTaskNotifications();
+
+ expect(warning.hidden).toBe(true);
+ expect(openButton.hidden).toBe(true);
+ });
});
diff --git a/test/renderer/synced-surface-regression.test.ts b/test/renderer/synced-surface-regression.test.ts
index a9087ef7..c43da767 100644
--- a/test/renderer/synced-surface-regression.test.ts
+++ b/test/renderer/synced-surface-regression.test.ts
@@ -172,9 +172,10 @@ describe('synced PC surface regressions', () => {
expect(ttsAuth).not.toContain('Orkas · Voice');
});
- it('keeps Settings local execution modes and Open commander avatar copy usable', () => {
+ it('keeps Settings local execution modes and edits the commander avatar from AI Team', () => {
const html = read('src/renderer/index.html');
const settings = read('src/renderer/modules/settings.js');
+ const agents = read('src/renderer/modules/agents.js');
const locales = ['en', 'zh', 'ja', 'pt'].map((lang) => readJson(`src/renderer/locales/${lang}.json`));
for (const marker of [
@@ -202,12 +203,15 @@ describe('synced PC surface regressions', () => {
expect(settings).toContain("const _LOCALEXEC_MODES = ['workspace_approval', 'all_files_approval', 'all_files_auto'];");
expect(settings).toContain("'all_files_approval'");
expect(settings).not.toContain("const _LOCALEXEC_MODES = ['off', 'risk_prompt', 'allow_all'];");
+ expect(html).not.toContain('settings-commander-avatar');
+ expect(settings).not.toContain('_settingsRenderCommanderAvatar');
+ expect(settings).not.toContain('_settingsRefreshCommanderAvatar');
+ expect(agents).toContain("window.orkas.invoke('prefs.setCommanderAvatar'");
+ expect(agents).toContain('allowCommanderCombo: true');
+ expect(agents).toContain('hideIcons: true');
for (const locale of locales) {
for (const key of [
- 'settings.commander_avatar.title',
- 'settings.commander_avatar.sub',
- 'settings.commander_avatar.hint',
'settings.localexec.mode.workspace_approval',
'settings.localexec.mode.all_files_approval',
'settings.localexec.mode.all_files_auto',