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.

Ask: Copy and the searched note sit on one even line

Eric Brownroutd9b0d85fb7f1
diff --git a/app/src/renderer/src/components/AskContext.tsx b/app/src/renderer/src/components/AskContext.tsx
index b69d3e43..32cc41e1 100644
--- a/app/src/renderer/src/components/AskContext.tsx
+++ b/app/src/renderer/src/components/AskContext.tsx
@@ -29,8 +29,11 @@ export function AskContext({ chips }: { chips: ContextTarget[] }) {
export function AnswerScope({ chips }: { chips: ContextTarget[] }) {
const label = scopeLabel(chips)
- return <span className="chat-answer-scope" title={chips.length ? chips.map(chipTitle).join('\n') : label.name}>
- {chips.length ? tx('Searched {name}', { name: <span className="ask-scope-label"><span className="ask-scope-name">{label.name}</span>
- {label.others && <span className="ask-scope-others">{` ${label.others}`}</span>}</span> }) : t('Searched all meetings')}
- </span>
+ return <>
+ <span aria-hidden="true">·</span>
+ <span className="chat-answer-scope" title={chips.length ? chips.map(chipTitle).join('\n') : label.name}>
+ {chips.length ? tx('Searched {name}', { name: <span className="ask-scope-label"><bdi className="ask-scope-name">{label.name}</bdi>
+ {label.others && <span className="ask-scope-others">{` ${label.others}`}</span>}</span> }) : <span className="ask-scope-name">{t('Searched all meetings')}</span>}
+ </span>
+ </>
}
diff --git a/app/src/renderer/src/components/AskConversation.tsx b/app/src/renderer/src/components/AskConversation.tsx
index e50e11ff..c8be743e 100644
--- a/app/src/renderer/src/components/AskConversation.tsx
+++ b/app/src/renderer/src/components/AskConversation.tsx
@@ -390,9 +390,9 @@ function Turn({ turn, chat, panel, showCopy, onSource, onRetry, retryDisabled }:
? <NotesModelWait downloading={percent => <p role="status" className="text-sm text-muted">{t("Your question is waiting for Yogurt's AI to download.")} <span className="whitespace-nowrap">{percent}</span></p>}><p role="status" className="text-sm text-muted">{t('Getting ready to answer. Yogurt is still setting up.')}</p></NotesModelWait>
: <p className="chat-progress" role="status">{chat.waitsForMeeting && turn.status === 'waiting' ? t('Yogurt will answer once the meeting ends.') : <><ThinkingDots /><StepText step={turn.status === 'waiting' ? undefined : turn.step} /></>}</p>)}
{answer && <div data-testid={`${prefix}-answer`} dir="auto" data-streaming={live || undefined} className={`note-prose chat-answer${live ? ' stream-caret' : ''}`}><AnswerText md={answer} live={live} sources={turn.sources} onSource={onSource} /></div>}
- {answer && !live && <div className="chat-answer-actions"><button className="ghost-btn chat-copy-action" data-testid="chat-copy-answer" aria-label={copied ? t('Copied') : t('Copy answer')} onClick={() => {
+ {answer && !live && <div className="chat-answer-actions"><button className="text-action chat-copy-action" data-testid="chat-copy-answer" aria-label={copied ? t('Copied') : t('Copy answer')} onClick={() => {
void navigator.clipboard.writeText(turn.answer).then(() => { setCopied(true); setFailed(false) }).catch(() => setFailed(true))
- }}><Swap show={copied ? 'done' : 'copy'} options={{ copy: <Copy size={13} />, done: <Check size={13} /> }} /><SwapText text={copied ? t('Copied') : t('Copy')} widest={t('Copied')} /></button>{turn.scope && <AnswerScope chips={turn.scope} />}<span role="status" className={failed ? 'text-danger' : 'sr-only'}>{failed ? t("Yogurt couldn't copy.") : copied ? t('Copied') : ''}</span></div>}
+ }}><Swap show={copied ? 'done' : 'copy'} options={{ copy: <Copy size={13} />, done: <Check size={13} /> }} /><SwapText text={copied ? t('Copied') : t('Copy')} /></button>{turn.scope && <AnswerScope chips={turn.scope} />}<span role="status" className={failed ? 'text-danger' : 'sr-only'}>{failed ? t("Yogurt couldn't copy.") : copied ? t('Copied') : ''}</span></div>}
{turn.status === 'stopped' && <p className="text-xs text-muted">{answer ? t('Stopped') : t('Stopped before answering')}</p>}
{turn.status === 'failed' && <InlineError testId="chat-answer-error"><span>{t("Yogurt couldn't answer that.")}</span><button type="button" className="workspace-button" disabled={retryDisabled} onClick={onRetry}>{t('Try again')}</button></InlineError>}
</div>
diff --git a/app/src/renderer/src/styles.css b/app/src/renderer/src/styles.css
index c406d4cd..8551405f 100644
--- a/app/src/renderer/src/styles.css
+++ b/app/src/renderer/src/styles.css
@@ -616,7 +616,7 @@ input::selection, textarea::selection, .note-prose ::selection { background: var
@media (prefers-reduced-motion:reduce) { [data-icon=Loader] { animation:none; } }
.chat-latest { position:absolute;z-index:1;bottom:8px;inset-inline-start:calc(50% - 14px); }
-.chat-answer-actions { display:flex;align-items:center;gap:8px;margin-top:6px; }
+.chat-answer-actions { display:flex;align-items:center;gap:6px;margin-top:6px;font-size:12px;line-height:18px;color:var(--muted); }
/* Answer actions ease in, rising 2px, a beat after the answer finishes or on hover; they fade out in place. */
.ask-turn .chat-answer-actions { opacity:0;transform:translateY(2px);transition:opacity var(--dur-base) ease,transform 0s linear var(--dur-base); }
.ask-turn:is([data-show-copy],:hover,:focus-within) .chat-answer-actions { opacity:1;transform:none;transition:opacity var(--dur-surface) var(--ease-out) 60ms,transform var(--dur-surface) var(--ease-out) 60ms; }
@@ -624,9 +624,9 @@ input::selection, textarea::selection, .note-prose ::selection { background: var
.ask-turn[data-show-copy] .chat-answer-actions { transition-delay:150ms; }
@media (prefers-reduced-motion:reduce) { .ask-turn .chat-answer-actions,.ask-turn:is([data-show-copy],:hover,:focus-within) .chat-answer-actions { transform:none;transition:opacity var(--dur-micro) var(--ease-out); } }
@media (hover:none) { .ask-turn .chat-answer-actions { opacity:1; } }
-.chat-answer-scope { display:flex;align-items:center;min-width:0;margin-inline-start:-5px;font-size:11px;line-height:16px;color:var(--muted);white-space:pre; }
-.chat-answer-scope::before { content:"·";flex:none;margin-inline-end:8px; }
-.chat-copy-action { margin-inline-start:-10px; }
+.chat-answer-scope { display:flex;align-items:center;min-width:0;overflow:hidden;white-space:pre; }
+.chat-answer-scope .ask-scope-name { white-space:nowrap; }
+.chat-copy-action { height:30px; }
.chat-progress { display:flex;align-items:center;gap:9px;padding-block:5px;color:var(--muted);font-size:13px;line-height:20px; }
.thinking-dots { width:18px;height:20px;flex:none;color:var(--accent); }
/* a new wording of the step fades in, never slides */
diff --git a/app/test/answerScope.test.ts b/app/test/answerScope.test.ts
index 7fb993bb..cd01c649 100644
--- a/app/test/answerScope.test.ts
+++ b/app/test/answerScope.test.ts
@@ -5,6 +5,7 @@ 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 { language, setLanguage } from '../src/shared/i18n'
import type { ConversationTurn, ConversationView } from '../src/shared/types'
const folder: ContextTarget = { kind: 'folder', id: 'planning', title: 'Planning' }
@@ -29,14 +30,27 @@ it.each([
[[folder, meeting, { ...meeting, id: 'next' }], 'Searched Planning and 2 others'],
] as [ContextTarget[], string][])('labels the searched scope %j', (chips, expected) => {
const html = renderToStaticMarkup(createElement(AnswerScope, { chips }))
- expect(html.replace(/<[^>]*>/g, '')).toBe(expected)
+ expect(html).toContain('<span aria-hidden="true">·</span>')
+ expect(html.replace(/<[^>]*>/g, '')).toBe('·' + expected)
+ if (!chips.length) expect(html).toContain('class="ask-scope-name">Searched all meetings</span>')
if (chips.length > 1) {
expect(html).toContain('title="Planning\nRelease review')
- expect(html).toContain('class="ask-scope-name">Planning</span>')
+ expect(html).toContain('<bdi class="ask-scope-name">Planning</bdi>')
expect(html).toContain('class="ask-scope-others"')
}
})
+it('keeps a long mixed-direction title available in full when the scope is truncated', () => {
+ const previous = language()
+ const title = 'Release checklist / שלב ראשון ' + '1234567890'.repeat(8)
+ try {
+ setLanguage('he')
+ const html = renderToStaticMarkup(createElement(AnswerScope, { chips: [{ ...folder, title }] }))
+ expect(html).toContain(`title="${title}"`)
+ expect(html).toContain(`בוצע חיפוש ב־<span class="ask-scope-label"><bdi class="ask-scope-name">${title}</bdi>`)
+ } finally { setLanguage(previous) }
+})
+
it.each([false, true])('shows saved scopes on finished answers, without inventing legacy scope or showing it mid-stream (panel: %s)', panel => {
vi.stubGlobal('window', { matchMedia: () => ({ matches: false }) })
const initial: ConversationView = { id: 'scope', title: '', draft: '', chips: [folder], draftChips: [], firstChips: [], waitsForMeeting: false, waitsForModel: false,
@@ -45,7 +59,10 @@ it.each([false, true])('shows saved scopes on finished answers, without inventin
initial.turns[0] = { ...initial.turns[0], scope, status }
return renderToStaticMarkup(createElement(AskConversation, { id: initial.id, initial, panel, onSelect() {}, onDeleted() {}, onSource() {} }))
}
- expect(render(undefined, 'done')).not.toContain('chat-answer-scope')
+ const legacy = render(undefined, 'done')
+ expect(legacy).not.toContain('chat-answer-scope')
+ expect(legacy).not.toContain('>·</span>')
+ expect(legacy).toContain('class="swap-text" data-resize="true"><span>Copy</span>')
expect(render([], 'done')).toContain('Searched all meetings')
expect(render([folder], 'done')).toContain('chat-answer-scope')
expect(render([folder], 'answering')).not.toContain('chat-answer-scope')