Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

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

Maurice97f86dcf46b4
diff --git a/client/src/mobile/screens/journey/MJourneyEntrySheet.tsx b/client/src/mobile/screens/journey/MJourneyEntrySheet.tsx
index b9ea7e712..9be546706 100644
--- a/client/src/mobile/screens/journey/MJourneyEntrySheet.tsx
+++ b/client/src/mobile/screens/journey/MJourneyEntrySheet.tsx
@@ -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 && (
diff --git a/client/tests/unit/mobile/journey/MJourneyEntrySheet.test.tsx b/client/tests/unit/mobile/journey/MJourneyEntrySheet.test.tsx
index 6386279ed..ccdbb0a6e 100644
--- a/client/tests/unit/mobile/journey/MJourneyEntrySheet.test.tsx
+++ b/client/tests/unit/mobile/journey/MJourneyEntrySheet.test.tsx
@@ -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({