Skip to content

Private AI meeting notes that stay on your computer. No meeting bot. Free and open source for Mac, Windows and Linux. An alternative to Granola, Otter and Fireflies.

Folders: pickers show each folder's own icon

Eric Brownroutd5081111ec62
diff --git a/app/e2e/commands.spec.ts b/app/e2e/commands.spec.ts
index 71e7d1ab..2ecceced 100644
--- a/app/e2e/commands.spec.ts
+++ b/app/e2e/commands.spec.ts
@@ -369,10 +369,16 @@ test('the input stays icon-free, row icons and hints stay fixed, and the seconda
await expect(input).toBeFocused()
const glyphs = await page.locator('.search-row>svg, .search-row>.folder-glyph>svg').evaluateAll(icons => icons.map(icon => {
const style = getComputedStyle(icon)
- return [parseFloat(style.width), parseFloat(style.height), icon.getAttribute('stroke-width'), style.color]
+ const folder = icon.closest('.folder-glyph')
+ return { size: [parseFloat(style.width), parseFloat(style.height)], stroke: icon.getAttribute('stroke-width'), color: style.color, folderColor: folder && getComputedStyle(folder).color }
}))
expect(glyphs.length).toBeGreaterThan(0)
- for (const glyph of glyphs) expect(glyph).toEqual([16, 16, '1.75', glyphs[0][3]])
+ const commandColor = glyphs.find(glyph => !glyph.folderColor)?.color
+ for (const glyph of glyphs) {
+ expect(glyph.size).toEqual([16, 16])
+ expect(glyph.stroke).toBe('1.75')
+ expect(glyph.color).toBe(glyph.folderColor ?? commandColor)
+ }
const hints = await page.locator('.search-footer').textContent()
for (const query of ['s', 'se', 'set', 'settings', 'why', 'why now?']) {
await input.fill(query)
diff --git a/app/src/renderer/src/components/AskContext.tsx b/app/src/renderer/src/components/AskContext.tsx
index 0aaf057b..b69d3e43 100644
--- a/app/src/renderer/src/components/AskContext.tsx
+++ b/app/src/renderer/src/components/AskContext.tsx
@@ -1,5 +1,9 @@
-import { ChevronDown, FileText, Folder } from 'lucide-react'
+import { useContext } from 'react'
+import { WorkspaceFolders } from '../folders'
+import { ChevronDown, FileText } from 'lucide-react'
import type { ContextTarget } from '../../../shared/askContext'
+import { DEFAULT_FOLDER_APPEARANCE } from '../../../shared/folderAppearance'
+import { FolderGlyph } from './FolderAppearance'
import { tx } from '../i18n'
import { t } from '../../../shared/i18n'
@@ -9,10 +13,16 @@ export const scopeLabel = (chips: ContextTarget[]) => ({
others: chips.length > 1 ? t('and {count} others', { count: chips.length - 1 }) : '',
})
+export function ContextIcon({ target }: { target: ContextTarget }) {
+ const folders = useContext(WorkspaceFolders)
+ if (target.kind === 'meeting') return <FileText size={14} aria-hidden="true" />
+ const folder = folders?.find(item => item.id === target.id)
+ return <FolderGlyph appearance={folder ?? DEFAULT_FOLDER_APPEARANCE} size={14} />
+}
+
export function AskContext({ chips }: { chips: ContextTarget[] }) {
const label = scopeLabel(chips)
- const Icon = chips[0]?.kind === 'folder' ? Folder : FileText
- return <>{!!chips.length && <Icon size={14} aria-hidden="true" />}<span className="ask-scope-label"><span className="ask-scope-name">{label.name}</span>
+ return <>{chips[0] && <ContextIcon target={chips[0]} />}<span className="ask-scope-label"><span className="ask-scope-name">{label.name}</span>
{label.others && <span className="ask-scope-others">{` ${label.others}`}</span>}</span><ChevronDown size={12} aria-hidden="true" /></>
}
diff --git a/app/src/renderer/src/components/AskConversation.tsx b/app/src/renderer/src/components/AskConversation.tsx
index 68ad3c3e..fc43deac 100644
--- a/app/src/renderer/src/components/AskConversation.tsx
+++ b/app/src/renderer/src/components/AskConversation.tsx
@@ -2,7 +2,7 @@ import { InlineError } from './InlineError'
import { useEffect, useLayoutEffect, useRef, useState, type KeyboardEvent } from 'react'
import { createPortal } from 'react-dom'
import { Popover } from '@base-ui/react/popover'
-import { ArrowDown, ArrowUp, Check, Ellipsis, FileText, Folder, Maximize2, Square, X } from 'lucide-react'
+import { ArrowDown, ArrowUp, Check, Ellipsis, Maximize2, Square, X } from 'lucide-react'
import { attachContext, mentionAt, type ContextTarget } from '../../../shared/askContext'
import type { AskStep, ConversationTurn, ConversationView, LibrarySource } from '../../../shared/types'
import { t } from '../../../shared/i18n'
@@ -18,7 +18,7 @@ import { ThinkingDots } from './ThinkingDots'
import { ConversationActions } from './ConversationActions'
import { ScrollFade } from './ScrollFade'
import { rememberedScroll, useScrollMemory } from '../useScrollMemory'
-import { AnswerScope, AskContext, chipTitle } from './AskContext'
+import { AnswerScope, AskContext, chipTitle, ContextIcon } from './AskContext'
import { useFollowLatest } from '../useFollowLatest'
import { Swap, SwapText } from './Swap'
import { attachAskTracer } from '../askTracer'
@@ -265,7 +265,7 @@ export function AskConversation({ id, pendingDraftKey, initial, loadError = fals
const targetRow = (c: ContextTarget, i: number) => <button type="button" role="option" tabIndex={-1} disabled={busy}
aria-selected={selector ? inScope(c) : selected === i} data-active={selected === i || undefined} id={`${prefix}-context-${i}`} key={`${c.kind}:${c.id}`}
onMouseDown={e => e.preventDefault()} onClick={() => toggle(c)}>
- {c.kind === 'meeting' ? <FileText size={14} aria-hidden="true" /> : <Folder size={14} aria-hidden="true" />}<span>{chipTitle(c)}</span>
+ <ContextIcon target={c} /><span>{chipTitle(c)}</span>
{inScope(c) ? <Check size={14} aria-hidden="true" /> : c.startedAt && <small>{dayLabel(c.startedAt)}</small>}
</button>
const results = <>
diff --git a/app/src/renderer/src/components/FolderPicker.tsx b/app/src/renderer/src/components/FolderPicker.tsx
index 0b39b922..f28b88f2 100644
--- a/app/src/renderer/src/components/FolderPicker.tsx
+++ b/app/src/renderer/src/components/FolderPicker.tsx
@@ -153,7 +153,7 @@ export function FolderChip({ meetingId, onNew, suggestion: manualSuggestion, row
const timer = setTimeout(finish, reduced ? motion.micro : motion.base)
return () => clearTimeout(timer)
}, [transition, reduced])
- const appearance = proposed ?? (folders?.length === 1 ? folders[0] : undefined)
+ const appearance = proposed ?? folders?.[0]
if (row && !proposed) return children
const trigger = <button ref={chip} data-testid="note-folders" aria-haspopup="menu" aria-expanded={onChoose ? undefined : !!open} onClick={(e) => { if (onChoose && proposed) onChoose(proposed.id); else setOpen((o) => o ? false : e.detail > 0 ? 'pointer' : 'keyboard') }}
title={proposed?.name ?? (folders?.map((s) => s.name).join(', ') || undefined)}
diff --git a/app/src/renderer/src/components/Workspace.tsx b/app/src/renderer/src/components/Workspace.tsx
index 5082dd0f..0a0a61f8 100644
--- a/app/src/renderer/src/components/Workspace.tsx
+++ b/app/src/renderer/src/components/Workspace.tsx
@@ -1,3 +1,4 @@
+import { WorkspaceFolders } from '../folders'
import { AudioUploadHost } from './AudioUpload'
import { toasts } from './TrashToast'
import { askDestination } from '../../../shared/askContext'
@@ -115,7 +116,7 @@ export function Workspace({ route, meeting, folders, go, back, forward, search,
</button>}
<div id="workspace-actions" className="workspace-toolbar-actions" />
</header>
- {children}
+ <WorkspaceFolders value={folders}>{children}</WorkspaceFolders>
<AudioUploadHost />
</div>
diff --git a/app/src/renderer/src/folders.ts b/app/src/renderer/src/folders.ts
index 8ceff556..c1917dbb 100644
--- a/app/src/renderer/src/folders.ts
+++ b/app/src/renderer/src/folders.ts
@@ -1,6 +1,8 @@
-import { useEffect, useState } from 'react'
+import { createContext, useEffect, useState } from 'react'
import type { Folder } from '../../shared/types'
+export const WorkspaceFolders = createContext<Folder[] | undefined>(undefined)
+
/** what a dragged meeting row carries: its id, under a type only Yogurt's own rows use */
export const MEETING_DRAG = 'application/x-yogurt-meeting'
diff --git a/app/src/renderer/src/styles.css b/app/src/renderer/src/styles.css
index 40de2515..517da431 100644
--- a/app/src/renderer/src/styles.css
+++ b/app/src/renderer/src/styles.css
@@ -443,8 +443,7 @@ html.widget { --pill:#232326;--pill-ink:#F7F7FA;--accent:#B780FF;--pill-accent:v
.search-filter>button:focus-visible { outline:2px solid var(--focus);outline-offset:2px; }
.command-section { padding:12px 12px 4px;font-size:var(--text-xs);line-height:16px;font-weight:500;color:var(--muted); }
.command-row { display:flex;align-items:center;gap:10px;min-height:40px;padding:8px 12px;border-radius:7px;font-size:var(--text-sm);line-height:20px;font-weight:500;cursor:default; }
-.search-row>svg,.search-row>.folder-glyph { flex:none;width:16px;height:16px;color:var(--muted); }
-.search-filter>.folder-glyph { color:var(--muted); }
+.search-row>svg { flex:none;width:16px;height:16px;color:var(--muted); }
.command-label { min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.search-meeting { display:flex;align-items:center;gap:10px;min-height:48px;padding:8px 12px;border-radius:7px;cursor:default; }
.search-metadata { flex:none;max-width:35%;color:var(--muted);font-size:var(--text-xs);line-height:18px;text-align:end;font-variant-numeric:tabular-nums; }
diff --git a/app/src/renderer/src/workspace.css b/app/src/renderer/src/workspace.css
index fa79128f..887eaa58 100644
--- a/app/src/renderer/src/workspace.css
+++ b/app/src/renderer/src/workspace.css
@@ -525,7 +525,7 @@ body:has(.chat-panel[open]) .app-toast-viewport:dir(rtl) { --toast-x:440px; }
.ask-picker h3 { padding:7px 8px;font-size:11px;font-weight:550;color:var(--muted); }
.ask-picker button:not(.text-action) { display:flex;align-items:center;gap:8px;width:100%;padding:8px;border-radius:5px;text-align:start;font-size:13px; }
.ask-picker button:not(.text-action)[data-active=true],.ask-picker button:not(.text-action):hover:not(:disabled) { background:var(--card); }
-.ask-picker button:not(.text-action)>span { flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
+.ask-picker button:not(.text-action)>span:not(.folder-glyph) { flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.ask-picker button:not(.text-action):active { background:var(--control-pressed); }
.ask-picker button:not(.text-action)>svg { flex:none; }
.ask-picker button:not(.text-action):disabled { opacity:.45; }
diff --git a/app/test/answerScope.test.ts b/app/test/answerScope.test.ts
index afacfa06..7fb993bb 100644
--- a/app/test/answerScope.test.ts
+++ b/app/test/answerScope.test.ts
@@ -1,7 +1,8 @@
import { afterEach, expect, it, vi } from 'vitest'
import { createElement } from 'react'
import { renderToStaticMarkup } from 'react-dom/server'
-import { AnswerScope } from '../src/renderer/src/components/AskContext'
+import { WorkspaceFolders } from '../src/renderer/src/folders'
+import { AnswerScope, AskContext, ContextIcon } from '../src/renderer/src/components/AskContext'
import { AskConversation } from '../src/renderer/src/components/AskConversation'
import type { ContextTarget } from '../src/shared/askContext'
import type { ConversationTurn, ConversationView } from '../src/shared/types'
@@ -10,6 +11,17 @@ const folder: ContextTarget = { kind: 'folder', id: 'planning', title: 'Planning
const meeting: ContextTarget = { kind: 'meeting', id: 'release', title: 'Release review' }
afterEach(() => vi.unstubAllGlobals())
+it('shows the current folder icon and color in the picker and the selected scope', () => {
+ const saved = { id: folder.id, name: folder.title, icon: 'flag' as const, color: 'teal' as const, count: 0, createdAt: 1 }
+ for (const child of [createElement(ContextIcon, { target: folder }), createElement(AskContext, { chips: [folder] })]) {
+ const html = renderToStaticMarkup(createElement(WorkspaceFolders.Provider, { value: [saved] }, child))
+ expect(html).toContain('data-folder-icon="flag"')
+ expect(html).toContain('data-folder-color="teal"')
+ const missing = renderToStaticMarkup(createElement(WorkspaceFolders.Provider, { value: [] }, child))
+ expect(missing).toContain('data-folder-icon="folder"')
+ }
+})
+
it.each([
[[], 'Searched all meetings'],
[[folder], 'Searched Planning'],
diff --git a/app/test/folderChip.test.ts b/app/test/folderChip.test.ts
index 8d69fd10..71ff61a9 100644
--- a/app/test/folderChip.test.ts
+++ b/app/test/folderChip.test.ts
@@ -37,6 +37,14 @@ it('shows the filed chip when another folder was chosen', () => {
expect(html).toContain('>Alpha</span>')
})
+it('uses the named folder’s appearance on a multi-folder picker button', () => {
+ state.mine = [{ ...alpha, icon: 'star', color: 'amber' }, suggested]
+ const html = chip()
+ expect(html).toContain('>Alpha + 1</span>')
+ expect(html).toContain('data-folder-icon="star"')
+ expect(html).toContain('data-folder-color="amber"')
+})
+
it('renders the row suggestion as a folder pill with three keyboard controls and smaller action icons', () => {
const html = chip(true)
expect(html).toContain('class="meeting-folder-pill meeting-folder-proposal"')
diff --git a/site/renderer/bridge.mjs b/site/renderer/bridge.mjs
index b87f4030..9c3c83f4 100644
--- a/site/renderer/bridge.mjs
+++ b/site/renderer/bridge.mjs
@@ -8,10 +8,10 @@ export const meeting = {
language: 'english', titleSource: 'user', attendees: ['Kara Moore', 'Ray Mones', 'Lincoln Park', 'Charlotte Goode'].map(name => ({ name })),
}
export const folders = [
- { id: 'launch', name: 'Launch', color: 'violet' },
- { id: 'hiring', name: 'Hiring', color: 'teal' },
- { id: 'customer-calls', name: 'Customer calls', color: 'amber' },
-].map((folder,position)=>({...folder,icon:'folder',createdAt:meeting.startedAt,position}))
+ { id: 'launch', name: 'Launch', color: 'violet', icon: 'rocket' },
+ { id: 'hiring', name: 'Hiring', color: 'teal', icon: 'users' },
+ { id: 'customer-calls', name: 'Customer calls', color: 'amber', icon: 'message' },
+].map((folder,position)=>({...folder,createdAt:meeting.startedAt,position}))
const notes = { meetingId: meeting.id, mine, enhanced: null, edited: false, status: 'idle', draft: '', peopleChanged: false, saves: { mine: { revision: 0, status: 'saved' }, enhanced: { revision: 0, status: 'saved' } } }
export const sources = [{ n:1, meetingId:meeting.id, title:meeting.title, startedAt:meeting.startedAt, atMs:721500,
excerpt:'Ray Mones: Support has the checklist. We can publish Tuesday.\nLincoln Park: I’ll send the announcement on Wednesday morning.',