From 7f41d713041588c3612f2ac7ed10357c0cb4b923 Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Thu, 12 Nov 2026 04:17:50 -0500 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8=20dashboard:=20Settings=20?= =?UTF-8?q?=E2=86=92=20Inbox=20section=20for=20default=20repo,=20dibs=20UR?= =?UTF-8?q?L=20and=20rules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com> #17885 landed inbox.* config, validation, parity allowlist and /api/inbox/settings but no Settings tab section. Add Settings → Inbox reusing the Inbox drawer form and endpoint. Part of #17883. --- changelog.d/added-inbox-settings-section.md | 1 + .../dashboard-sections/workflow-and-agents.md | 1 + src/docs/inbox-voice-sources.md | 3 +- .../dashboard/inbox_settings_section_test.go | 32 ++++++++++++ .../dashboard/static-src/js/config-state.js | 3 +- .../dashboard/static-src/js/config-tabs.js | 2 + src/pkg/dashboard/static-src/js/inbox.js | 44 +++++++++++++---- src/pkg/dashboard/static/index.html | 49 +++++++++++++++---- 8 files changed, 114 insertions(+), 21 deletions(-) create mode 100644 changelog.d/added-inbox-settings-section.md create mode 100644 src/pkg/dashboard/inbox_settings_section_test.go diff --git a/changelog.d/added-inbox-settings-section.md b/changelog.d/added-inbox-settings-section.md new file mode 100644 index 0000000000..7199a8ab60 --- /dev/null +++ b/changelog.d/added-inbox-settings-section.md @@ -0,0 +1 @@ +- Settings → Inbox section to edit the default RFC repository, dibs URL and auto-routing rules from the dashboard Settings dialog. diff --git a/src/docs/dashboard-sections/workflow-and-agents.md b/src/docs/dashboard-sections/workflow-and-agents.md index c49a26bbd1..bb9ec25b24 100644 --- a/src/docs/dashboard-sections/workflow-and-agents.md +++ b/src/docs/dashboard-sections/workflow-and-agents.md @@ -213,6 +213,7 @@ Voice recordings and dictations waiting for you to file them as an RFC, send to - The sidebar count and the summary count items with no destination yet and not marked "Knowledge only". - Each item shows one pill per destination it was sent to: queued, running, filed (with a link) or failed. - Auto-routing rules run once per new item after a sync; the first matching rule wins. +- The default RFC repository, dibs URL and rules can also be edited under Settings → Inbox. **What it is good for.** Record an idea on your recorder, then turn it into an RFC with child issues (→ RFC), a dibs idea (→ dibs), or just keep it searchable (Knowledge only) without leaving the dashboard. See [Inbox and voice sources](../inbox-voice-sources.md). diff --git a/src/docs/inbox-voice-sources.md b/src/docs/inbox-voice-sources.md index bb5c95792f..4f689aa9cd 100644 --- a/src/docs/inbox-voice-sources.md +++ b/src/docs/inbox-voice-sources.md @@ -36,7 +36,8 @@ see the issue linked from the changelog entry. - **Auto-routing rules** (⚙ Auto-routing in the Inbox, or `inbox.rules`): `source?`, `title_prefix` or `tag`, `destination`, `repo?`. Rules run once for each item that arrives after a connector sync; the first match wins; - items already in the Inbox are never re-routed. + items already in the Inbox are never re-routed. The same editor, with the + default RFC repository and dibs URL, is under Settings → Inbox. ## Configuration diff --git a/src/pkg/dashboard/inbox_settings_section_test.go b/src/pkg/dashboard/inbox_settings_section_test.go new file mode 100644 index 0000000000..7a4f2fa824 --- /dev/null +++ b/src/pkg/dashboard/inbox_settings_section_test.go @@ -0,0 +1,32 @@ +package dashboard + +import ( + "strings" + "testing" +) + +func TestSettingsInboxSectionWiring(t *testing.T) { + raw, err := staticFS.ReadFile("static/index.html") + if err != nil { + t.Fatal(err) + } + page := string(raw) + for _, want := range []string{ + "'Knowledge', 'Inbox', 'Project Observability'", + "case 'Inbox': return renderGovInbox();", + "function renderGovInbox", + "function loadInboxSettingsInline", + "loadInboxSettingsInline();", + "inbox-settings-inline", + "yamlHint('inbox.spek.repo')", + "yamlHint('inbox.dibs.url')", + "yamlHint('inbox.rules')", + "Default RFC repository", + "id=\"inbox-settings-dibs-url\"", + "key: 'inbox.spek.repo'", + } { + if !strings.Contains(page, want) { + t.Errorf("Settings → Inbox wiring missing %q", want) + } + } +} diff --git a/src/pkg/dashboard/static-src/js/config-state.js b/src/pkg/dashboard/static-src/js/config-state.js index 162cf7e258..c3b76f8bfa 100644 --- a/src/pkg/dashboard/static-src/js/config-state.js +++ b/src/pkg/dashboard/static-src/js/config-state.js @@ -23,7 +23,7 @@ // which is read-only hub-synced user/role data. It sits next to Model // Gateways because both are backend configuration. const GOVERNOR_BOB_TAB = 'Bob'; - const GOVERNOR_CONFIG_TABS = ['General', 'Appearance', 'Dashboard', 'Agents', 'Thresholds', 'Labels', 'Repos', 'Workflows', 'Budget', 'Notifications', 'Health', 'Sensing', 'Logging', 'Features', 'Knowledge', 'Project Observability', 'Advisory', 'Work Source', 'Hub', 'Forge App', 'Model Gateways', GOVERNOR_BOB_TAB, 'Variables', 'Security', 'Compliance']; + const GOVERNOR_CONFIG_TABS = ['General', 'Appearance', 'Dashboard', 'Agents', 'Thresholds', 'Labels', 'Repos', 'Workflows', 'Budget', 'Notifications', 'Health', 'Sensing', 'Logging', 'Features', 'Knowledge', 'Inbox', 'Project Observability', 'Advisory', 'Work Source', 'Hub', 'Forge App', 'Model Gateways', GOVERNOR_BOB_TAB, 'Variables', 'Security', 'Compliance']; const PIPELINE_STAGES = ['resolve-beads', 'track-prs', 'stale-check', 'repo-scan', 'coverage-gate', 'prompt-compose', 'budget-check', 'api-collect', 'final-compose']; const PIPELINE_STAGE_TIPS = { 'resolve-beads': 'Fetch and inject knowledge beads (facts, patterns, gotchas) relevant to the agent\'s current task context.', @@ -82,6 +82,7 @@ { tab: 'Labels', section: 'Labels', label: 'Adoption of a maintainer\'s PR', key: 'governor.labels.stage.adoption.maintainer_policy', text: 'adoption maintainer policy adopt ask never maintainer own pr clanker disconnected offline adopt action governor.labels.stage.adoption.maintainer_policy' }, { tab: 'Labels', section: 'Labels', label: 'Contributor nudge', key: 'governor.labels.stage.contributor_nudge.enabled', text: 'contributor nudge returned-to-contributor red ci fix-pr relay interrupt renudge presence window governor.labels.stage.contributor_nudge.enabled governor.labels.stage.contributor_nudge.renudge_interval auto_merge.nudge_repeat_after governor.labels.stage.contributor_nudge.ci_failure_cooldown governor.labels.stage.presence_window' }, { tab: 'Labels', section: 'Labels', label: 'Adopt red contributor PRs', key: 'governor.labels.stage.adoption.enabled', text: 'adoption adopted-by-hive stage 074 red contributor pr grace online offline supersede takeover in place after offline unregistered heartbeat governor.labels.stage.adoption.enabled governor.labels.stage.contributor_grace_online governor.labels.stage.contributor_grace_offline governor.labels.stage.adoption.after_offline governor.labels.stage.adoption.after_unregistered governor.labels.stage.adoption.in_place governor.labels.stage.adoption.strict_attribution strict attribution governor.labels.stage.adoption.auto_merge auto merge adopted head hive authority governor.labels.stage.adoption.supersede.close_first close first superseded reopen copy failed governor.labels.stage.adoption.close_superseded close superseded on adopt on merge clanker authored opt-in label governor.labels.stage.adoption.offline_grace offline grace rebase failed twice fixer resolving conflicts governor.labels.stage.adoption.rebase_attempt_timeout rebase attempt timeout' }, + { tab: 'Inbox', section: 'Inbox', label: 'Inbox routing', key: 'inbox.spek.repo', lazy: true, text: 'inbox voice recordings plaud wispr default rfc repository spek dibs url auto-routing rules inbox.spek.repo inbox.dibs.url inbox.rules' }, { tab: 'Hub', section: 'Contributor Relay', label: 'Fix budget', key: 'contribute.max_parallel_fixes', text: 'fix budget parallel fixes focus window red pr fix-pr preempt spawn contribute.max_parallel_fixes contribute.min_focus_window' }, { tab: 'Logging', section: 'Logging', label: 'Governor logging', key: 'governor.logging.max_size_mb', text: 'governor logging directory level compression max size age backups governor.logging.compress governor.logging.dir governor.logging.level governor.logging.max_age_days governor.logging.max_backups governor.logging.max_size_mb' }, { tab: 'Advisory', section: 'Advisory', label: 'Advisory digest', key: 'governor.advisory.max_findings', text: 'advisory digest max findings show all staleness pr autoclose target linear issue retry backoff update interval rewrite floor changed digest governor.advisory.update_interval_s governor.advisory.digest_min_interval' }, diff --git a/src/pkg/dashboard/static-src/js/config-tabs.js b/src/pkg/dashboard/static-src/js/config-tabs.js index 03d69b03f3..b8ca800a08 100644 --- a/src/pkg/dashboard/static-src/js/config-tabs.js +++ b/src/pkg/dashboard/static-src/js/config-tabs.js @@ -53,6 +53,7 @@ // The Features tab's Linear Agent panel loads install/session state // from its own endpoint (owner-only; the render is a static shell). if (tabId === 'Features') loadLinearAgentStatus(); + if (tabId === 'Inbox') loadInboxSettingsInline(); // The same tab carries the upstream-watch editor and divergence view // (#9969, #11211); it loads from its own endpoint. if (tabId === 'Features') loadUpstreamWatch(); @@ -265,6 +266,7 @@ case 'Access': return renderGovSecurity(d.security || {}); case 'Features': return renderGovFeatures(d.features || {}, d.auto_merge || {}, d.review || {}); case 'Knowledge': return renderGovKnowledgeSharing(); + case 'Inbox': return renderGovInbox(); case 'Project Observability': return renderGovProjectObservability(d.project_observability || {}); case 'Advisory': return renderGovAdvisory(d.advisory || {}); case 'Work Source': return renderGovWorkSource(d.work_source || {}); diff --git a/src/pkg/dashboard/static-src/js/inbox.js b/src/pkg/dashboard/static-src/js/inbox.js index 4f38662937..2ec698a5e6 100644 --- a/src/pkg/dashboard/static-src/js/inbox.js +++ b/src/pkg/dashboard/static-src/js/inbox.js @@ -221,22 +221,47 @@ if (!host) return; host.innerHTML = _inboxDraftRules.length ? _inboxDraftRules.map(inboxRuleRowHtml).join('') : '
No rules — every item waits here for manual triage.
'; } - function inboxOpenSettings() { - const settings = (_inboxCache || {}).settings || {}; - _inboxDraftRules = (settings.rules || []).map(r => Object.assign({}, r)); - const body = 'New items are checked against these rules in order after every connector sync; the first match routes the item automatically. Items that arrived before a rule existed are never re-routed.
' + + function inboxSettingsFormHtml(settings, inline) { + const buttons = inline + ? '' + : ''; + return 'New items are checked against these rules in order after every connector sync; the first match routes the item automatically. Items that arrived before a rule existed are never re-routed.
' + 'The dibs token is read from the environment variable named by inbox.dibs.token_env' + (settings.dibs_token_set ? ' (set)' : ' (not set)') + '.
Default RFC repository, dibs URL and auto-routing rules for voice recordings. ' + yamlHint('inbox.spek.repo') + ' ' + yamlHint('inbox.dibs.url') + ' ' + yamlHint('inbox.rules') + '
' + + 'Loading…
Inbox settings unavailable: ' + escapeHtml(e.message) + '
'; + } + } function inboxAddRule() { _inboxDraftRules = inboxReadRules(); _inboxDraftRules.push({ source: '', title_prefix: 'RFC:', tag: '', destination: 'spek_rfc', repo: '' }); @@ -255,7 +280,8 @@ const r = await fetch('/api/inbox/settings', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) }); const data = await r.json().catch(() => ({})); if (!r.ok) throw new Error(data.error || ('HTTP ' + r.status)); - kbCloseModal(); + const inline = !!document.getElementById('inbox-settings-inline'); + if (!inline) kbCloseModal(); showToast('Inbox settings saved', 'success'); await fetchInbox(); } catch (e) { diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 90af378a72..cee371c608 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -46417,22 +46417,47 @@No rules — every item waits here for manual triage.
'; } - function inboxOpenSettings() { - const settings = (_inboxCache || {}).settings || {}; - _inboxDraftRules = (settings.rules || []).map(r => Object.assign({}, r)); - const body = 'New items are checked against these rules in order after every connector sync; the first match routes the item automatically. Items that arrived before a rule existed are never re-routed.
' + + function inboxSettingsFormHtml(settings, inline) { + const buttons = inline + ? '' + : ''; + return 'New items are checked against these rules in order after every connector sync; the first match routes the item automatically. Items that arrived before a rule existed are never re-routed.
' + 'The dibs token is read from the environment variable named by inbox.dibs.token_env' + (settings.dibs_token_set ? ' (set)' : ' (not set)') + '.
Default RFC repository, dibs URL and auto-routing rules for voice recordings. ' + yamlHint('inbox.spek.repo') + ' ' + yamlHint('inbox.dibs.url') + ' ' + yamlHint('inbox.rules') + '
' + + 'Loading…
Inbox settings unavailable: ' + escapeHtml(e.message) + '
'; + } + } function inboxAddRule() { _inboxDraftRules = inboxReadRules(); _inboxDraftRules.push({ source: '', title_prefix: 'RFC:', tag: '', destination: 'spek_rfc', repo: '' }); @@ -46451,7 +46476,8 @@No rules — every item waits here for manual triage.
'; } @@ -226,14 +245,14 @@ ? '' : ''; - return 'New items are checked against these rules in order after every connector sync; the first match routes the item automatically. Items that arrived before a rule existed are never re-routed.
' + + return 'New items are checked against these rules in order after every connector sync; the first match routes the item automatically. Items that arrived before a rule existed are never re-routed.
' + 'The dibs token is read from the environment variable named by inbox.dibs.token_env' + (settings.dibs_token_set ? ' (set)' : ' (not set)') + '.
Inbox settings unavailable: ' + escapeHtml(e.message) + '
'; } @@ -273,15 +292,16 @@ inboxRenderRules(); } async function inboxSaveSettings() { - const errEl = document.getElementById('inbox-settings-error'); - const rules = inboxReadRules().map(r => { const o = {}; for (const k of Object.keys(r)) if (r[k]) o[k] = r[k]; return o; }); - const payload = { rules, spek_repo: (document.getElementById('inbox-settings-spek-repo') || {}).value || '', dibs_url: (document.getElementById('inbox-settings-dibs-url') || {}).value || '' }; + const root = inboxSettingsRoot(); + if (!root) return; + const errEl = inboxSettingsField(root, 'error'); + const rules = inboxReadRules(root).map(r => { const o = {}; for (const k of Object.keys(r)) if (r[k]) o[k] = r[k]; return o; }); + const payload = { rules, spek_repo: (inboxSettingsField(root, 'spek-repo') || {}).value || '', dibs_url: (inboxSettingsField(root, 'dibs-url') || {}).value || '' }; try { const r = await fetch('/api/inbox/settings', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) }); const data = await r.json().catch(() => ({})); if (!r.ok) throw new Error(data.error || ('HTTP ' + r.status)); - const inline = !!document.getElementById('inbox-settings-inline'); - if (!inline) kbCloseModal(); + if (root.dataset.inboxForm !== 'inline') kbCloseModal(); showToast('Inbox settings saved', 'success'); await fetchInbox(); } catch (e) { diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index cee371c608..de4565d3a5 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -46406,14 +46406,33 @@No rules — every item waits here for manual triage.
'; } @@ -46422,14 +46441,14 @@New items are checked against these rules in order after every connector sync; the first match routes the item automatically. Items that arrived before a rule existed are never re-routed.
' + + return 'New items are checked against these rules in order after every connector sync; the first match routes the item automatically. Items that arrived before a rule existed are never re-routed.
' + 'The dibs token is read from the environment variable named by inbox.dibs.token_env' + (settings.dibs_token_set ? ' (set)' : ' (not set)') + '.
Inbox settings unavailable: ' + escapeHtml(e.message) + '
'; } @@ -46469,15 +46488,16 @@