mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-23 15:36:33 +00:00
fix(journey): a dead translation key, and two cards that spoke differently
`common.errorOccurred` is in no locale. It sat in the reorder failure toast already and I copied it into three more places, so a failed dismiss, restore or reorder printed the key at the reader. They all say `common.errorTitle` now. The suggestion mark on a phone card was the word spelled out, which took a third of a 136px card and pushed the date off it; it is the same plus the desktop suggestion card offers, and the card's italic dimmed title carries the rest. Dismissing a suggestion from the entry sheet has its own full-width row above the buttons rather than a two-line label wedged between Delete and Cancel. And two cards that should have been one design: the dashboard's spotlight trip wrote its facts in capitals on a panel of dark glass, the journey hero wrote them in sentence case on a gradient with its badge loose in a corner. The journey card is built the way the trip card is now, and the trip card's three pills are set like the DAY x OF y badge beside them, a size down and on the same ground.
This commit is contained in:
@@ -481,7 +481,7 @@ function JourneyDetailPageDesktop() {
|
||||
const [moved] = reordered.splice(idx, 1)
|
||||
reordered.splice(target, 0, moved)
|
||||
reorderEntries(current.id, reordered.map(e => e.id))
|
||||
.catch(() => toast.error(t('common.errorOccurred')))
|
||||
.catch(() => toast.error(t('common.errorTitle')))
|
||||
}
|
||||
// The active outline traces the card, so it has to know which
|
||||
// card: the three kinds round their corners differently, and a
|
||||
|
||||
@@ -248,7 +248,7 @@ describe('JourneyDetailPage wiring', () => {
|
||||
const reorderEntries = vi.fn(async () => { throw new Error('conflict'); });
|
||||
setup({ reorderEntries });
|
||||
fireEvent.click(screen.getAllByRole('button', { name: 'dayplan.moveDown' })[0]);
|
||||
await waitFor(() => expect(toast.error).toHaveBeenCalledWith('common.errorOccurred'));
|
||||
await waitFor(() => expect(toast.error).toHaveBeenCalledWith('common.errorTitle'));
|
||||
});
|
||||
|
||||
it('FE-JRN-DETWIRE-013: entry-card actions open the editor, the delete confirm and the lightbox', () => {
|
||||
|
||||
@@ -283,7 +283,7 @@ export function useJourneyDetail() {
|
||||
if (current) await loadJourney(current.id)
|
||||
toast.success(t('journey.suggestions.dismissed'))
|
||||
} catch {
|
||||
toast.error(t('common.errorOccurred'))
|
||||
toast.error(t('common.errorTitle'))
|
||||
}
|
||||
}, [updateEntry, loadJourney, current, toast, t])
|
||||
|
||||
@@ -294,7 +294,7 @@ export function useJourneyDetail() {
|
||||
await loadJourney(current.id)
|
||||
toast.success(t('journey.suggestions.restored', { count: String(restored) }))
|
||||
} catch {
|
||||
toast.error(t('common.errorOccurred'))
|
||||
toast.error(t('common.errorTitle'))
|
||||
}
|
||||
}, [current, loadJourney, toast, t])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user