feat(journey): let quick capture take a note, not just a photo

The ask was "photos or quick notes" while travelling, and the capture sheet only
took photos (#1614) — so a moment worth catching without a picture had no way in
short of opening the full editor, which is exactly what capture mode exists to
avoid.

Two rows rather than the full sheet's three: this is a note, not the story. The
story is written later, when the entry is finished.
This commit is contained in:
Maurice
2026-08-18 21:11:19 +02:00
committed by Maurice
parent 6e4fda897f
commit 97f86dcf46
2 changed files with 32 additions and 0 deletions
@@ -585,6 +585,20 @@ export default function MJourneyEntrySheet({
</div>
)}
{/* Quick capture keeps a note field: the ask was "photos *or* quick notes"
unterwegs, and a moment without a picture is still worth catching. Two
rows rather than three — it is a note, not the story, which is written
later in the full sheet. */}
{captureOnly && !readOnly && (
<textarea
rows={2}
value={story}
onChange={e => setStory(e.target.value)}
placeholder={t('journey.editor.writeStory')}
className={`mt-[10px] w-full resize-none px-[14px] py-3 font-geist text-[0.8125rem] leading-[1.5] text-m-ink outline-none placeholder:text-m-faint ${fieldShell} rounded-[14px]`}
/>
)}
{!captureOnly && <>
{readOnly ? (
story && (
@@ -48,6 +48,24 @@ describe('MJourneyEntrySheet quick capture', () => {
});
});
// #1614 — the ask was "photos *or* quick notes" while travelling, and a moment
// without a picture is still worth catching.
it('takes a note in capture mode and saves it', async () => {
vi.spyOn(mapsApi, 'reverse').mockResolvedValue({ name: 'Singapore', address: 'Singapore' });
const { props } = setup();
const note = await screen.findByPlaceholderText('Write your story...');
fireEvent.change(note, { target: { value: 'Ferry was late, worth it' } });
fireEvent.click(screen.getByRole('button', { name: 'Save' }));
await waitFor(() =>
expect(props.onSave).toHaveBeenCalledWith(
expect.objectContaining({ story: 'Ferry was late, worth it' }),
undefined,
),
);
});
it('captures GPS, reverse-geocodes it, detects an editable weather category, and saves', async () => {
vi.spyOn(mapsApi, 'reverse').mockResolvedValue({ name: 'Singapore', address: 'Singapore' });
vi.spyOn(weatherApi, 'getCurrent').mockResolvedValue({