enh
This commit is contained in:
parent
d6685f156d
commit
8305c3bcf4
4 changed files with 38 additions and 1 deletions
|
|
@ -1352,6 +1352,7 @@ Covered by HOME-81..98, plus:
|
|||
| LOC-54 | edge | QuickDelivery flash | “within 1 hour”; back; LocationBar |
|
||||
| LOC-55 | edge | startup gate, one non-default address | auto-opens region + selects address |
|
||||
| LOC-56 | edge | regular switcher, one non-default address | no auto-select/close |
|
||||
| LOC-57 | edge | LocationBar long address | one line (`numberOfLines=1`) with tail ellipsis; bar stays 2 lines |
|
||||
| SLOTQ-01 | edge | foreign address | warning; switch confirm; clear cart/home |
|
||||
| SLOTQ-02 | edge | unavailable region | alert |
|
||||
| SLOTQ-03 | edge | no selected/default address | “Select address” |
|
||||
|
|
|
|||
|
|
@ -80,7 +80,9 @@ const LocationBar: React.FC = () => {
|
|||
{activeAddress ? (
|
||||
<MyText
|
||||
style={tw`text-xs text-gray-500 mt-1`}
|
||||
numberOfLines={2}
|
||||
// Exactly one address line: anything longer ellipsises with "…"
|
||||
// so the bar stays two lines tall (region row + address row).
|
||||
numberOfLines={1}
|
||||
ellipsizeMode="tail"
|
||||
>
|
||||
{formatAddress(activeAddress)}
|
||||
|
|
|
|||
|
|
@ -612,6 +612,20 @@ describe('Location components (LOC)', () => {
|
|||
expect(queryByText('12 Main Road, Near Temple, Mahabubnagar')).toBeNull()
|
||||
})
|
||||
|
||||
it('LOC-57: LocationBar truncates the address to a single line', async () => {
|
||||
setRegionHook({ region: REGION_1, regionId: 1, boundId: 7 })
|
||||
signIn()
|
||||
setAddresses([S1, S2])
|
||||
useAddressStore.getState().setSelectedAddressId(11)
|
||||
const { getByText } = renderWithProviders(<LocationBar />, { auth: false })
|
||||
await flush(2)
|
||||
|
||||
const address = getByText('12 Main Road, Near Temple, Mahabubnagar')
|
||||
// Two-line bar: "Deliver to <region>" then one ellipsised address line.
|
||||
expect(address.props.numberOfLines).toBe(1)
|
||||
expect(address.props.ellipsizeMode).toBe('tail')
|
||||
})
|
||||
|
||||
it('LOC-34: LocationMapStep builds the URL with optional lat/lng params', () => {
|
||||
const withCoords = renderWithProviders(
|
||||
<LocationMapStep lat={17} lng={78} onSelect={jest.fn()} onCancel={jest.fn()} />,
|
||||
|
|
|
|||
|
|
@ -10334,3 +10334,23 @@ Mirror: stored token -> isLoading:false; selfData error with UNAUTHORIZED -> log
|
|||
|
||||
--- apps/web-ui/src/lib/trpc-client.ts
|
||||
Mirror of the RN event: setUnauthorizedHandler() invoked when the API answers 401 UNAUTHORIZED.
|
||||
|
||||
[2026-10-26 00:31 IST] LocationBar address line is capped at one line so the bar is always exactly
|
||||
two lines ("Deliver to <region>" + one address line, ellipsised with "…").
|
||||
|
||||
--- apps/user-ui/src/components/LocationBar.tsx
|
||||
@@
|
||||
<MyText
|
||||
style={tw`text-xs text-gray-500 mt-1`}
|
||||
- numberOfLines={2}
|
||||
+ numberOfLines={1}
|
||||
ellipsizeMode="tail"
|
||||
>
|
||||
{formatAddress(activeAddress)}
|
||||
</MyText>
|
||||
|
||||
--- apps/user-ui/tests/components/location-components.test.tsx
|
||||
Added LOC-57: the address text uses numberOfLines=1 + ellipsizeMode="tail".
|
||||
|
||||
--- apps/user-ui/JEST-TEST-CASES.md
|
||||
LOC-57 row.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue