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
1 change: 1 addition & 0 deletions changelog.d/changed-inbox-remove-dibs-button.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- The Inbox item row now has only Play, Transcript and a 🔗 Share ▾ menu with a Hive group (RFC…, Knowledge, DIBS) and a Link group (Copy link, Share…); the "→ dibs…", "→ RFC…" and "Knowledge only" row buttons are gone and the selection bar gets a Hive menu. Auto-routing and config are unchanged.
5 changes: 3 additions & 2 deletions dashboard/test/inbox-item.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ test('pending item explains that Plaud has no text yet and never shows the MCP e
assert.match(html, /â–¶ Play recording/);
assert.match(html, /data-action="inboxToggleTranscript"/);
assert.match(html, /data-inbox-media="plaud\/f_1"/);
for (const action of ['inboxOpenRoute', 'inboxDismiss', 'inboxOpenFact']) assert.match(html, new RegExp('data-action="' + action + '"'), action + ' action kept');
for (const action of ['inboxShare', 'inboxOpenFact']) assert.match(html, new RegExp('data-action="' + action + '"'), action + ' action kept');
for (const action of ['inboxOpenRoute', 'inboxDismiss']) assert.doesNotMatch(html, new RegExp('data-action="' + action + '"'), action + ' moved into the Share menu');
assert.doesNotMatch(html, /<audio/, 'no audio element (and no URL) before the owner clicks play');
});

Expand Down Expand Up @@ -131,7 +132,7 @@ test('File RFC route state: a failed hand-off shows its error inline, delegated
let html = vm.runInContext('inboxItemHtml(' + JSON.stringify(failed) + ')', ctx);
assert.match(html, /data-status="error"[^>]*>RFC failed</);
assert.match(html, /class="kc-error muted-xs" role="alert">spek_rfc: handing the RFC to agent &lt;builder&gt; failed: busy</);
assert.match(html, />Retry RFC…</);
assert.doesNotMatch(html, />Retry RFC…</, 'Retry RFC… lives in the Share menu');

const delegated = Object.assign({}, readyItem, { routes: { spek_rfc: { status: 'delegated', repo: 'o/r', note: 'handed to agent builder to draft with spek and publish to o/r' } } });
html = vm.runInContext('inboxItemHtml(' + JSON.stringify(delegated) + ')', ctx);
Expand Down
2 changes: 1 addition & 1 deletion src/docs/dashboard-sections.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Full entry: [Knowledge](dashboard-sections/workflow-and-agents.md#knowledge).

## Inbox

Voice recordings and dictations waiting for you to file them as an RFC, send to dibs, or keep as knowledge.
Voice recordings and dictations waiting for you to file them as an RFC or keep as knowledge.

Full entry: [Inbox](dashboard-sections/workflow-and-agents.md#inbox).

Expand Down
4 changes: 2 additions & 2 deletions src/docs/dashboard-sections/workflow-and-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ The facts Hive has learned about your projects, where they came from, and how mu

## Inbox

Voice recordings and dictations waiting for you to file them as an RFC, send to dibs, or keep as knowledge.
Voice recordings and dictations waiting for you to file them as an RFC or keep as knowledge.

**What it tells you.** Every recording a voice source (Plaud, Wispr Flow) syncs is already a Knowledge fact. The Inbox lists the ones you have not triaged yet, with the source, date, length and a short excerpt.

Expand All @@ -217,7 +217,7 @@ Voice recordings and dictations waiting for you to file them as an RFC, send to
- 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).
**What it is good for.** Record an idea on your recorder, then turn it into an RFC with child issues (🔗 Share → Hive → RFC…), send it to dibs (DIBS), or just keep it searchable (Knowledge) without leaving the dashboard. See [Inbox and voice sources](../inbox-voice-sources.md).

**Example.** A fact says tests run with `make test`, but your project uses `go test`. You edit the fact.

Expand Down
18 changes: 14 additions & 4 deletions src/docs/inbox-voice-sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ see the issue linked from the changelog entry.
yet" so it can be transcribed first. If no agent is
available or the kick is refused, the item shows **RFC failed** with the
error inline and a **Retry RFC…** button; it never sits as pending.
- **→ dibs** (`dibs`): posts title, summary, transcript and the
- **DIBS** (`dibs`; chosen by auto-routing or from **🔗 Share → Hive → DIBS**): posts title, summary, transcript and the
`plaud://recordings/<id>` provenance to `POST {inbox.dibs.url}/api/ideas`
as a private draft idea (Bearer token from `inbox.dibs.token_env`).
- **Knowledge only** (`dismiss`): leaves the fact where it is and drops the
Expand Down Expand Up @@ -107,9 +107,19 @@ Each Inbox item shows what the source has for the recording:
presigned link itself (`{url, expires_at}`, audited as `inbox_audio`) for
API clients. The Plaud card's *Include 24h audio link* option only decides
whether a sync also writes a link into the fact.
- **🔗 Share** — shares a deep link to the item in the Inbox
(`<dashboard URL>#section-inbox-section?item=<source>%2F<id>`), through the
browser's share sheet when it has one, else the clipboard. It never shares
- **🔗 Share ▾** — the only per-item menu besides ▶ Play and Transcript
(arrow keys move, Esc closes and returns focus). It has two labelled groups.
**Hive** (owners only): **RFC…** (**Retry RFC…** after a failure), **Knowledge**
(**Back to inbox** on a kept item) and **DIBS**. RFC… is disabled with a
hint when the item has no text yet (use 🎧 Transcribe) or no RFC repository is
set; DIBS is disabled until `inbox.dibs.url` (Settings → Inbox → dibs URL)
and the token variable named by `inbox.dibs.token_env` are set. Other
features add their own entry to this group. **Link** (everyone who can see
the Inbox): **Copy link** copies a deep link to the item
(`<dashboard URL>#section-inbox-section?item=<source>%2F<id>`); **Share…**
opens the browser's share sheet and appears only where the browser has one.
The selection bar has the same kind of **Hive â–¾** menu for bulk Knowledge.
Sharing never shares
the media URL: the recipient signs in to this hive and needs owner or
read-write access to play. Opening the link opens the Inbox, shows
processed items when the item is one, and scrolls to it. The player's own
Expand Down
4 changes: 2 additions & 2 deletions src/docs/knowledge-connectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,8 @@ set yourself is never rewritten, so an explicit `@latest` still floats.
@plaud-ai/mcp@0.3.14 install` signed in. See
[Inbox and voice sources](inbox-voice-sources.md#hosted-hives-signing-in-to-plaud).
4. Click **Sync now**. New recordings are picked up every `interval` and
appear in the **📥 Inbox**, where you file them as a spektacular RFC, send
them to dibs, or keep them as knowledge only
appear in the **📥 Inbox**, where you file them as a spektacular RFC or
keep them as knowledge only
([Inbox and voice sources](inbox-voice-sources.md)).

### Behaviour
Expand Down
14 changes: 7 additions & 7 deletions src/pkg/dashboard/inbox_audio_stream.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ const harness = ({ fetchReply, share, clipboardOK = true } = {}) => {
const api = new Function('document', 'fetch', 'navigator', 'location', 'CSS', 'showToast', 'writeClipboardText', 'window', 'renderInbox', 'items',
'function inboxFind(src, id) { return items.find(it => it.source === src && it.id === id); }\n' +
fnSrc('inboxApiPath') + '\n' + fnSrc('inboxStreamURL') + '\n' + fnSrc('inboxAudioErrorReason') + '\n' + fnSrc('inboxPlay') + '\n' +
constSrc('INBOX_SHARE_HASH') + '\n' + fnSrc('inboxShareLink') + '\n' + fnSrc('inboxFocusKeyFromHash') + '\n' + fnSrc('inboxShare') + '\n' +
'return { inboxPlay, inboxStreamURL, inboxAudioErrorReason, inboxShareLink, inboxFocusKeyFromHash, inboxShare };',
constSrc('INBOX_SHARE_HASH') + '\n' + fnSrc('inboxShareLink') + '\n' + fnSrc('inboxFocusKeyFromHash') + '\n' + fnSrc('inboxShareCopy') + '\n' + fnSrc('inboxShareNative') + '\n' +
'return { inboxPlay, inboxStreamURL, inboxAudioErrorReason, inboxShareLink, inboxFocusKeyFromHash, inboxShareCopy, inboxShareNative };',
)(document, fetch, navigator, location, { escape: s => s }, (msg, kind) => calls.toasts.push([msg, kind]),
async text => { calls.clipboard.push(text); return clipboardOK; }, {}, () => {}, items);
return { api, calls, mount };
Expand Down Expand Up @@ -93,21 +93,21 @@ test('Share produces an Inbox deep link, never the media URL', async () => {
assert.strictEqual(api.inboxFocusKeyFromHash('#section-inbox-section'), '');
assert.strictEqual(api.inboxFocusKeyFromHash('#section-inbox-section?item=%E0%A4%A'), '', 'malformed escape is ignored');

await api.inboxShare('plaud', 'f_01');
assert.deepStrictEqual(calls.clipboard, [link], 'no Web Share: copies the deep link');
await api.inboxShareCopy('plaud', 'f_01');
assert.deepStrictEqual(calls.clipboard, [link], 'Copy link copies the deep link');
assert.deepStrictEqual(calls.toasts[0], ['Inbox link copied', 'success']);
assert.strictEqual(calls.fetches.length, 0);
});

test('Share uses the Web Share sheet when the browser has one', async () => {
const { api, calls } = harness({ share: true });
await api.inboxShare('plaud', 'f_01');
await api.inboxShareNative('plaud', 'f_01');
assert.deepStrictEqual(calls.shares, [{ title: 'cost considerations', url: 'https://hive.example/?style=a#section-inbox-section?item=plaud%2Ff_01' }]);
assert.strictEqual(calls.clipboard.length, 0);
const cancelled = harness({ share: 'abort' });
await cancelled.api.inboxShare('plaud', 'f_01');
await cancelled.api.inboxShareNative('plaud', 'f_01');
assert.strictEqual(cancelled.calls.clipboard.length, 0, 'a cancelled share sheet does not copy');
const noClip = harness({ clipboardOK: false });
await noClip.api.inboxShare('plaud', 'f_01');
await noClip.api.inboxShareCopy('plaud', 'f_01');
assert.match(noClip.calls.toasts[0][0], /^Copy this Inbox link: https:\/\/hive\.example\//);
});
101 changes: 101 additions & 0 deletions src/pkg/dashboard/inbox_share_menu_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
package dashboard

import (
"strings"
"testing"
)

// The Inbox item row carries only Play, Transcript and a 🔗 Share ▾ menu; the
// menu has a Hive group (RFC…, Knowledge, DIBS, plus registered entries) and a
// Link group (Copy link, Share…). Helpers run under node with the globals
// injected.
func TestInboxShareMenuRowIsThreeControls(t *testing.T) {
html := indexHTML(t)
row := jsFunc(t, html, "inboxItemHtml")
for _, gone := range []string{`data-arg2="spek_rfc"`, `data-action="inboxDismiss"`, `data-action="inboxUndismiss"`, `data-arg2="dibs"`} {
if strings.Contains(row, gone) {
t.Fatalf("item row still carries %s", gone)
}
}
for _, want := range []string{`data-action="inboxPlay"`, `data-action="inboxToggleTranscript"`, `data-action="inboxShare"`, `aria-haspopup="menu"`} {
if !strings.Contains(row, want) {
t.Fatalf("item row missing %s", want)
}
}
}

func TestInboxShareMenuBehaviour(t *testing.T) {
html := indexHTML(t)
script := "(function () {\n" + strings.Join([]string{
"const assert = require('assert');",
"function escapeHtml(s) { return String(s).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/\"/g,'&quot;'); }",
"var window = { _hiveRole: 'owner' }; var navigator = {}; var _inboxCache = null;",
"var calls = [];",
"function inboxOpenRoute(s, i, d) { calls.push(['route', s, i, d]); }",
"function inboxDismiss(s, i) { calls.push(['dismiss', s, i]); } function inboxUndismiss(s, i) { calls.push(['undismiss', s, i]); }",
"function inboxShareCopy(s, i) { calls.push(['copy', s, i]); } async function inboxShareNative(s, i) { calls.push(['native', s, i]); }",
"function inboxDismissSelected() { calls.push(['bulk-dismiss']); } const _inboxSelected = new Set(['plaud/r1']);",
"function inboxFind(s, i) { return ((_inboxCache || {}).items || []).find(it => it.source === s && it.id === i); }",
jsConstLine(t, html, "INBOX_NO_TEXT_REASON"),
jsConstBlock(t, html, "inboxShareHiveActions"),
jsConstBlock(t, html, "inboxShareLinkActions"),
jsFunc(t, html, "inboxDibsReady"),
jsFunc(t, html, "inboxShareMenuGroups"),
jsFunc(t, html, "inboxShareMenuHtml"),
jsFunc(t, html, "inboxShareMenuRun"),
jsFunc(t, html, "inboxBulkMenuGroups"),
jsFunc(t, html, "inboxBulkMenuRun"),
`
const item = (o) => Object.assign({ source: 'plaud', id: 'r1', title: 'T', routes: {} }, o || {});
const ready = (items) => ({ items: items || [item()], repos: ['o/r'], settings: { dibs_url: 'https://d.example', dibs_token_set: true } });
const ids = (gs) => gs.map(g => g.id + ':' + g.items.map(i => i.id).join(','));
(async () => {
// Groups and order; Share… only with navigator.share.
_inboxCache = ready(); navigator = { share: () => {} };
let gs = inboxShareMenuGroups(item());
assert.deepStrictEqual(ids(gs), ['hive:rfc,knowledge,dibs', 'link:copy,native']);
const markup = inboxShareMenuHtml(gs, 'plaud', 'r1');
assert(markup.includes('role="menu"') && markup.includes('role="group" aria-label="Hive"') && markup.includes('aria-label="Link"'));
assert(markup.indexOf('Hive') < markup.indexOf('>Link<'));
assert.strictEqual((markup.match(/role="menuitem"/g) || []).length, 5);
navigator = {};
assert.deepStrictEqual(ids(inboxShareMenuGroups(item())), ['hive:rfc,knowledge,dibs', 'link:copy']);
// Role gating: read and read-write only get the Link group.
for (const role of ['read', 'read-write']) { window._hiveRole = role; assert.deepStrictEqual(ids(inboxShareMenuGroups(item())), ['link:copy']); }
assert.deepStrictEqual(inboxBulkMenuGroups(), []);
window._hiveRole = 'owner';
// Disabled reasons.
_inboxCache = { items: [], repos: [], settings: {} };
let hive = inboxShareMenuGroups(item({ pending: true }))[0].items;
assert(hive.find(i => i.id === 'rfc').disabled && hive.find(i => i.id === 'rfc').hint.includes('Transcribe'));
hive = inboxShareMenuGroups(item())[0].items;
assert(hive.find(i => i.id === 'rfc').hint.includes('RFC repository'));
const dibs = hive.find(i => i.id === 'dibs');
assert(dibs.disabled && dibs.hint.includes('Settings → Inbox → dibs URL'));
assert(inboxShareMenuHtml(inboxShareMenuGroups(item()), 'plaud', 'r1').includes('aria-disabled="true"'));
// Failed route labels a retry; dismissed items offer Back to inbox.
_inboxCache = ready();
hive = inboxShareMenuGroups(item({ routes: { spek_rfc: { status: 'failed' } }, dismissed: true }))[0].items;
assert.strictEqual(hive[0].label, 'Retry RFC…'); assert.strictEqual(hive[1].label, 'Back to inbox');
// Each entry calls its existing handler.
_inboxCache = ready([item()]); navigator = { share: () => {} };
await inboxShareMenuRun('hive', 'rfc', 'plaud', 'r1');
await inboxShareMenuRun('hive', 'dibs', 'plaud', 'r1');
await inboxShareMenuRun('hive', 'knowledge', 'plaud', 'r1');
await inboxShareMenuRun('link', 'copy', 'plaud', 'r1');
await inboxShareMenuRun('link', 'native', 'plaud', 'r1');
assert.deepStrictEqual(calls, [['route', 'plaud', 'r1', 'spek_rfc'], ['route', 'plaud', 'r1', 'dibs'], ['dismiss', 'plaud', 'r1'], ['copy', 'plaud', 'r1'], ['native', 'plaud', 'r1']]);
// Bulk menu: Knowledge runs the bulk handler.
calls.length = 0;
assert.deepStrictEqual(ids(inboxBulkMenuGroups()), ['hive:knowledge']);
inboxBulkMenuRun('knowledge'); assert.deepStrictEqual(calls, [['bulk-dismiss']]);
// Registration point: another feature adds one entry.
const ran = [];
inboxShareHiveActions.splice(1, 0, { id: 'spek', label: 'spek…', enabled: (it, role) => role === 'owner' ? true : false, run: it => ran.push(it.id) });
assert.deepStrictEqual(ids(inboxShareMenuGroups(item()))[0], 'hive:rfc,spek,knowledge,dibs');
await inboxShareMenuRun('hive', 'spek', 'plaud', 'r1'); assert.deepStrictEqual(ran, ['r1']);
})().catch(e => { console.error(e); process.exit(1); });
`,
}, "\n") + "\n})();"
runStageTrackerRowActionsScript(t, script)
}
Loading
Loading