fix(capture): + button opens the capture sheet again in triage and tasks
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m59s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m59s
Hold-to-record opened the sheet on pointerup; the click the browser sends right after landed on the new sheet's backdrop and closed it at once. Lists and notes have no such backdrop and kept working. A short tap now opens on the click itself (as before), and after a hold that click is ignored. Tests send the real pointerup + click sequence. Version 0.5.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fcdf44a0ad
commit
3c31a22ba0
4 files changed
+37
-7
No files matched your search
@@ -74,6 +74,7 @@ describe('HoldToRecordFab', () => {
|
||||
vi.advanceTimersByTime(150);
|
||||
});
|
||||
fireEvent.pointerUp(btn, { clientY: 600 });
|
||||
fireEvent.click(btn);
|
||||
|
||||
expect(onTap).toHaveBeenCalledTimes(1);
|
||||
expect(onTranscript).not.toHaveBeenCalled();
|
||||
@@ -109,6 +110,7 @@ describe('HoldToRecordFab', () => {
|
||||
|
||||
await act(async () => {
|
||||
fireEvent.pointerUp(btn, { clientY: 600 });
|
||||
fireEvent.click(btn);
|
||||
});
|
||||
|
||||
expect(rec.stopped).toBe(true);
|
||||
@@ -143,6 +145,8 @@ describe('HoldToRecordFab', () => {
|
||||
|
||||
fireEvent.pointerUp(btn, { clientY: 520 });
|
||||
|
||||
fireEvent.click(btn);
|
||||
|
||||
expect(rec.aborted).toBe(true);
|
||||
expect(onTap).not.toHaveBeenCalled();
|
||||
expect(onTranscript).not.toHaveBeenCalled();
|
||||
@@ -177,6 +181,7 @@ describe('HoldToRecordFab', () => {
|
||||
|
||||
await act(async () => {
|
||||
fireEvent.pointerUp(btn, { clientY: 580 });
|
||||
fireEvent.click(btn);
|
||||
});
|
||||
|
||||
expect(rec.aborted).toBe(false);
|
||||
@@ -198,6 +203,7 @@ describe('HoldToRecordFab', () => {
|
||||
});
|
||||
await act(async () => {
|
||||
fireEvent.pointerUp(btn, { clientY: 600 });
|
||||
fireEvent.click(btn);
|
||||
});
|
||||
|
||||
expect(onTap).not.toHaveBeenCalled();
|
||||
@@ -224,6 +230,7 @@ describe('HoldToRecordFab', () => {
|
||||
rec.emitError('not-allowed');
|
||||
});
|
||||
fireEvent.pointerUp(btn, { clientY: 600 });
|
||||
fireEvent.click(btn);
|
||||
|
||||
expect(onTap).toHaveBeenCalledTimes(1);
|
||||
expect(onTranscript).not.toHaveBeenCalled();
|
||||
@@ -247,6 +254,7 @@ describe('HoldToRecordFab', () => {
|
||||
vi.advanceTimersByTime(350);
|
||||
});
|
||||
fireEvent.pointerUp(btn, { clientY: 600 });
|
||||
fireEvent.click(btn);
|
||||
|
||||
expect(onTap).toHaveBeenCalledTimes(1);
|
||||
expect(onTranscript).not.toHaveBeenCalled();
|
||||
@@ -256,6 +264,19 @@ describe('HoldToRecordFab', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('HoldToRecordFab tap timing', () => {
|
||||
it('opens only on the click after the release, so that click cannot close the new sheet', () => {
|
||||
const onTap = vi.fn();
|
||||
render(<HoldToRecordFab onTap={onTap} onTranscript={vi.fn()} />);
|
||||
const btn = screen.getByRole('button');
|
||||
fireEvent.pointerDown(btn, { clientY: 600, button: 0 });
|
||||
fireEvent.pointerUp(btn, { clientY: 600 });
|
||||
expect(onTap).not.toHaveBeenCalled();
|
||||
fireEvent.click(btn);
|
||||
expect(onTap).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('HoldToRecordFab keyboard access', () => {
|
||||
it('opens the capture sheet when activated without a pointer (keyboard, screen reader)', () => {
|
||||
const onTap = vi.fn();
|
||||
|
||||
Reference in new issue
Block a user