From 6715df7f44ccaa0444fb026d47bfb7e7f4227ac7 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Sat, 31 Oct 2026 04:39:14 +0100 Subject: [PATCH] feat: select a message by tapping its avatar in the list #91 --- .../__tests__/list-avatar-select.test.ts | 17 +++++++++++ src/screens/EmailListScreen.tsx | 28 ++++++++++++++----- 2 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 src/components/__tests__/list-avatar-select.test.ts diff --git a/src/components/__tests__/list-avatar-select.test.ts b/src/components/__tests__/list-avatar-select.test.ts new file mode 100644 index 00000000..49decb60 --- /dev/null +++ b/src/components/__tests__/list-avatar-select.test.ts @@ -0,0 +1,17 @@ +import { describe, expect, it } from 'vitest'; +import fs from 'node:fs'; +import path from 'node:path'; + +// Selecting mail needed a long press; native #91 asks for a tap on the +// left side, as the webmail's avatar does. + +describe('list row avatar (#91)', () => { + it('toggles the row into the selection on a tap', () => { + const src = fs.readFileSync(path.resolve(__dirname, '../../screens/EmailListScreen.tsx'), 'utf8'); + const avatar = src.slice(src.indexOf('{density.showAvatar && ('), src.indexOf('{/* Content */}')); + expect(avatar).toMatch(/ )} {density.showAvatar && ( - + // A tap on the avatar picks the row and starts selection mode, like + // a long press (#91). + + + )} {/* Content */}