From d37541bf36e773ff51f55d5fadc1c692183b89c4 Mon Sep 17 00:00:00 2001 From: Joely Date: Sat, 7 Nov 2026 14:34:28 -0500 Subject: [PATCH 1/2] Revert "components 0.5.5 (unpublished): Form.BusinessInfo showLocation, for a host that asks the address itself" This reverts commit 8557b80c2e02ab244ad3abdd132b9e60fc2e5409. It reached main without review: a VS Code sync on a branch that tracked origin/main pushed it (2026-11-07). The owner then chose another design: the store address is picked from Google's suggestions inside Form.BusinessInfo itself, once the library has a single entry (plan: retire lib/portable). main goes back to cf906c7, version 0.5.4, so nothing is published with showLocation. Co-Authored-By: Claude Opus 5.5 --- packages/components/package-lock.json | 4 +-- packages/components/package.json | 2 +- packages/components/src/Form/Form.stories.js | 14 -------- .../components/src/Form/FormBusinessInfo.js | 33 ++++++++----------- .../src/Form/__tests__/Form.test.js | 16 --------- 5 files changed, 17 insertions(+), 52 deletions(-) diff --git a/packages/components/package-lock.json b/packages/components/package-lock.json index 050c8300..093f6fb4 100644 --- a/packages/components/package-lock.json +++ b/packages/components/package-lock.json @@ -1,12 +1,12 @@ { "name": "@jmstechnologiesinc/react-native-components", - "version": "0.5.5", + "version": "0.5.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@jmstechnologiesinc/react-native-components", - "version": "0.5.5", + "version": "0.5.4", "license": "ISC", "devDependencies": { "@jmstechnologiesinc/partner": "0.2.54", diff --git a/packages/components/package.json b/packages/components/package.json index b228be14..6e6afe64 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@jmstechnologiesinc/react-native-components", - "version": "0.5.5", + "version": "0.5.4", "description": "Biblioteca de componentes de interfaz compartida por las aplicaciones de Daxir.", "author": "yerloveraaa ", "homepage": "https://github.com/jmstechnologiesinc/react-native-components#readme", diff --git a/packages/components/src/Form/Form.stories.js b/packages/components/src/Form/Form.stories.js index 1c0c25bb..d31d0f26 100644 --- a/packages/components/src/Form/Form.stories.js +++ b/packages/components/src/Form/Form.stories.js @@ -210,20 +210,6 @@ export const BusinessInfoHighlighted = () => ( /> ); -// The store sign-up's form: the app asks the address with Google's suggestions, so the form leaves its field out, as -// it leaves out the phone and the email. -export const BusinessInfoWithoutLocation = () => ( - {}} - /> -); - // The driver's answers as a reviewer sees them: read-only (no disclosure, the // secrets masked), a changed field marked and a server error under its field. export const DriverInfoReadOnly = () => ( diff --git a/packages/components/src/Form/FormBusinessInfo.js b/packages/components/src/Form/FormBusinessInfo.js index 0c10caff..bff71f9d 100644 --- a/packages/components/src/Form/FormBusinessInfo.js +++ b/packages/components/src/Form/FormBusinessInfo.js @@ -87,9 +87,6 @@ const FormBusinessInfo = ({ storeTitle, location, line2, - // A host that asks the store address with its own input (the app's Google suggestions, barrel only) hides this - // field, as the sign-up hides the phone and the email. - showLocation = true, showWebsite = true, showPhoneNumber = true, showEmail = true, @@ -141,22 +138,20 @@ const FormBusinessInfo = ({ onChangeText={(text) => inputActionHandler('description', text)} /> - {showLocation ? ( - - inputActionHandler('location', text)} - /> - - ) : null} + + inputActionHandler('location', text)} + /> + { expect(hidden.root.findAll((node) => node.props.value === 'Casa Nostra LLC')).toHaveLength(0); }); - // The app asks the store address with Google's suggestions (barrel only) and hides this field, as it hides the - // phone and the email; the field's own errors are then the host's to show. - it('hides the store address under showLocation={false}, and keeps the other fields', () => { - const hidden = render( - - ); - expect(inputWithValue(hidden, '1 Main St')).toBeUndefined(); - expect(hostOf(hidden, 'error.location')).toHaveLength(0); - expect(inputWithValue(hidden, 'Suite 2')).toBeDefined(); - expect(inputWithValue(render(), '1 Main St')).toBeDefined(); - }); - it('names the tax id on file (masked) instead of showing it', () => { const tree = render(); expect(JSON.stringify(tree.toJSON())).toContain('•••••6789'); From 58bd16d4f099837415aa3041dd978542ea00852a Mon Sep 17 00:00:00 2001 From: Joely Date: Sat, 7 Nov 2026 14:39:23 -0500 Subject: [PATCH 2/2] components 0.5.5 (unpublished): Form.BusinessInfo asks the store address with Google's suggestions; portable deprecated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Owner, 2026-11-07 (plan: retire lib/portable, phase 2). - Form.BusinessInfo: while the form can be edited, the store address is AutoCompleteInput, as the driver's operating address is (no GPS button, no «use my location» row). The picked suggestion's description is reported as `location`, clearing it reports '', and its server errors are listed under it (FieldErrorText). The suggestions have no read-only state, so under readOnly (the console) or isDisabled (a locked store) the address stays the field it was, and those renders are unchanged. - The barrel serves ZOOM and useModalFocus, which only portable.js served, so a host can drop lib/portable. portable.js is deprecated and goes in 0.6.0; PROJECT.md says so and documents the address. - Story BusinessInfoReadOnly. Tests: the suggestions while editable, the field under readOnly and isDisabled, the address's error, and the barrel serving the two names. NOT RUN (owner's decision, 2026-11-07): this repository cannot install (the root lock fails with ERESOLVE, as every CI run since 2026-09-18), so no test or lint ran; the changed files parse. The pinned render «app path: Form.BusinessInfo (editable, server errors)» (legacyTrees.json) now differs on purpose, the address being the suggestions; it is recaptured when the suite can run again. The test setup is unchanged: the barrel already loads under it (A-3). The app verifies this version once installed (plan phases 3, 4 and 6). Co-Authored-By: Claude Opus 5.5 --- PROJECT.md | 16 +++++-- .../components/__tests__/components.test.js | 3 +- packages/components/package-lock.json | 4 +- packages/components/package.json | 2 +- packages/components/src/Form/Form.stories.js | 12 +++++ .../components/src/Form/FormBusinessInfo.js | 48 +++++++++++++------ .../src/Form/__tests__/Form.test.js | 42 ++++++++++++++-- packages/components/src/index.js | 5 +- packages/components/src/portable.js | 5 ++ 9 files changed, 112 insertions(+), 25 deletions(-) diff --git a/PROJECT.md b/PROJECT.md index 7a9c274f..b6293544 100644 --- a/PROJECT.md +++ b/PROJECT.md @@ -65,9 +65,8 @@ Bigger features are folders with an `index.js` and internal sub-components + hoo 1. `packages/components/src//.js` 2. `packages/components/src//.stories.js` -3. Export it from `packages/components/src/index.js` — otherwise it does not exist for consumers. If it - loads on the web without native modules, export it from `portable.js` too (the guard test will tell you - if it does not). +3. Export it from `packages/components/src/index.js` — otherwise it does not exist for consumers. Nothing new + goes into `portable.js`: it is deprecated since 0.5.5 and removed in 0.6.0 (see "Portable entry"). 4. Add the folder's glob to `.storybook/main.ts` (see "Storybook" below — the web config is a hand-maintained list, not a glob over `src/**`). 5. Any user-facing string goes into **both** `Translations/en.json` and `es.json` via `localized()`. @@ -182,6 +181,12 @@ the components take the result and paint it. ## Portable entry (C-35) and partner components (K-22) — 0.4.0-dev +**Deprecated since 0.5.5, removed in 0.6.0** (owner, 2026-11-07). The web host it was made for (`admin-web`) is +gone, and since B-52 the console mounts the whole app and, with it, the barrel and its web stubs. One entry is the +standard: web differences live in `.web.js` twins, native modules in the host's web stubs. The barrel serves +everything this entry served (`ZOOM` and `useModalFocus` joined it in 0.5.5). `Form.BusinessInfo` asks the store +address with `AutoCompleteInput`, whose library imports the barrel back, so this entry no longer keeps it out. + `src/portable.js` (published as `lib/portable`) is what a **web host** imports: the partner console (`CustomerApp/admin-web`) and the presentational views it borrows from the app. It re-exports only modules that load on react-native-web **without stubs**: List, ScreenWrapper, ChipList, Tabs, @@ -285,6 +290,11 @@ themed through `useTheme()` so a host's theme applies: platform words there. A new partner component joins its `SCOPE`. - Stories register the package catalogue (`registerFlatCatalog({ en: EN, es: ES })`), as a host does. +`Form.BusinessInfo`'s store address (0.5.5, owner 2026-11-07): while the form can be edited it is `AutoCompleteInput` +(Google's suggestions, as the driver's operating address: no GPS button, no «use my location» row), the picked +suggestion's `description` reported as `location` and its server errors listed under it (`FieldErrorText`). The +suggestions have no read-only state, so under `readOnly` or `isDisabled` the address stays the field it was. + Forms (C-25): `Form.PersonInfo`, `Form.VehicleInfo` and `Form.BusinessInfo` take `readOnly` and `highlightFields: string[]` (the names the form reports to `inputActionHandler`), which outlines the field in `primary` and adds a «Changed» helper line (colour alone is not a marker; on a disabled input, where Paper diff --git a/packages/components/__tests__/components.test.js b/packages/components/__tests__/components.test.js index 485a65d6..13c9c9dd 100644 --- a/packages/components/__tests__/components.test.js +++ b/packages/components/__tests__/components.test.js @@ -31,7 +31,8 @@ describe('el barril de componentes', () => { }); it('sirve los nombres que sus consumidores importan', () => { - for (const name of ['List', 'Form', 'VendorList', 'CartList', 'styles']) { + // `ZOOM` and `useModalFocus`: the console's, which only `portable.js` served until 0.5.5. + for (const name of ['List', 'Form', 'VendorList', 'CartList', 'styles', 'ZOOM', 'useModalFocus']) { expect(`${name}:${name in components}`).toBe(`${name}:true`); } }); diff --git a/packages/components/package-lock.json b/packages/components/package-lock.json index 093f6fb4..050c8300 100644 --- a/packages/components/package-lock.json +++ b/packages/components/package-lock.json @@ -1,12 +1,12 @@ { "name": "@jmstechnologiesinc/react-native-components", - "version": "0.5.4", + "version": "0.5.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@jmstechnologiesinc/react-native-components", - "version": "0.5.4", + "version": "0.5.5", "license": "ISC", "devDependencies": { "@jmstechnologiesinc/partner": "0.2.54", diff --git a/packages/components/package.json b/packages/components/package.json index 6e6afe64..b228be14 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@jmstechnologiesinc/react-native-components", - "version": "0.5.4", + "version": "0.5.5", "description": "Biblioteca de componentes de interfaz compartida por las aplicaciones de Daxir.", "author": "yerloveraaa ", "homepage": "https://github.com/jmstechnologiesinc/react-native-components#readme", diff --git a/packages/components/src/Form/Form.stories.js b/packages/components/src/Form/Form.stories.js index d31d0f26..1f3848ee 100644 --- a/packages/components/src/Form/Form.stories.js +++ b/packages/components/src/Form/Form.stories.js @@ -210,6 +210,18 @@ export const BusinessInfoHighlighted = () => ( /> ); +// A store as the console shows it (read-only): the address is a field. While the form can be edited, as above, the +// address is picked from Google's suggestions. +export const BusinessInfoReadOnly = () => ( + {}} + /> +); + // The driver's answers as a reviewer sees them: read-only (no disclosure, the // secrets masked), a changed field marked and a server error under its field. export const DriverInfoReadOnly = () => ( diff --git a/packages/components/src/Form/FormBusinessInfo.js b/packages/components/src/Form/FormBusinessInfo.js index bff71f9d..6944b12d 100644 --- a/packages/components/src/Form/FormBusinessInfo.js +++ b/packages/components/src/Form/FormBusinessInfo.js @@ -5,6 +5,7 @@ import { HelperText, Divider, MD3LightTheme } from '@jmstechnologiesinc/react-na import { VENDOR_INDUSTRIES_MAPPING, VENDOR_INDUSTRIES } from '@jmstechnologiesinc/vendor'; import ScreenWrapper from '../ScreenWrapper'; +import AutoCompleteInput from '../AutoCompleteInput'; import { localized } from '../Localization/Localization'; import OptionPickerActionSheet from '../OptionPicker/OptionPickerActionSheet'; @@ -138,20 +139,39 @@ const FormBusinessInfo = ({ onChangeText={(text) => inputActionHandler('description', text)} /> - - inputActionHandler('location', text)} - /> - + {readOnly || disabled ? ( + + inputActionHandler('location', text)} + /> + + ) : ( + <> + {/* Picked from Google's suggestions, as the driver's operating address is: the server places + it with the same geocoding and refuses one it cannot (owner, 2026-11-07). The suggestions + have no read-only state, so the console (readOnly) and a locked store (isDisabled) keep + the field. */} + inputActionHandler('location', place.description ?? '')} + onClear={() => inputActionHandler('location', '')} + /> + + + )} { expect(drawnAs(render(), values)).toEqual(disabledLines(values)); }); + // Owner, 2026-11-07: the store address is picked from Google's suggestions, as the driver's is. + it('asks the address with the suggestions while editable and reports the picked one as `location`', () => { + const changes = []; + const tree = render( + changes.push([field, value])} /> + ); + const search = tree.root.findByType(AutoCompleteInput); + expect(search.props.value).toBe('1 Main St'); + act(() => search.props.onPress({ description: '2 Elm St, Boston, MA, USA' })); + act(() => search.props.onClear()); + expect(changes).toEqual([ + ['location', '2 Elm St, Boston, MA, USA'], + ['location', ''], + ]); + }); + + it('keeps the address as its field, with no suggestions, under readOnly and under isDisabled', () => { + const readOnly = render(); + const locked = render(); + expect(readOnly.root.findAllByType(AutoCompleteInput)).toHaveLength(0); + expect(locked.root.findAllByType(AutoCompleteInput)).toHaveLength(0); + }); + it('shows the industries as plain chips under readOnly: nothing to pick, remove or open, nothing greyed out', () => { const tree = render(); expect(tree.root.findAllByType(ButtonWrapper)).toHaveLength(0); @@ -305,6 +329,18 @@ describe('server errors on the forms', () => { expect(inError(tree, 'Pasta')).toBe(false); }); + it('shows an error of the store address under its suggestions', () => { + const tree = render( + + ); + const lines = hostOf(tree, 'error.location'); + expect(lines).toHaveLength(1); + expect(textOf(lines[0])).toContain('Address not found'); + }); + it('ignores errors of fields the form does not render', () => { const tree = render( diff --git a/packages/components/src/index.js b/packages/components/src/index.js index 578027ed..322507eb 100644 --- a/packages/components/src/index.js +++ b/packages/components/src/index.js @@ -84,8 +84,11 @@ export { default as DocumentRequirementCard } from './Partner/DocumentRequiremen export { default as DocumentVersionList } from './Partner/DocumentVersionList'; // Contract request #117: the card with its capture; native (the photo picker), so not in portable.js. export { default as DocumentCaptureCard } from './Partner/DocumentCaptureCard'; -export { default as DocumentViewer } from './DocumentViewer/DocumentViewer'; +export { default as DocumentViewer, ZOOM } from './DocumentViewer/DocumentViewer'; export { default as DecisionDialog } from './DecisionDialog/DecisionDialog'; +// The web keyboard contract of a modal surface (focus in, Tab trap, Esc, focus back to the opener); a no-op off the +// web. Until 0.5.5 only `portable.js` served it and `ZOOM`. +export { useModalFocus } from './useModalFocus'; export { default as Timeline } from './Timeline/Timeline'; export { default as StateFlow } from './StateFlow/StateFlow'; export { STATUS_TONES, toneColors } from './tones'; diff --git a/packages/components/src/portable.js b/packages/components/src/portable.js index 28033742..0706d90a 100644 --- a/packages/components/src/portable.js +++ b/packages/components/src/portable.js @@ -1,3 +1,8 @@ +// @deprecated since 0.5.5, removed in 0.6.0: import the package itself. The web hosts mount the whole app, and with +// it the barrel and their web stubs (CustomerApp B-52), so a second entry only splits the forms in two. +// `Form.BusinessInfo` now asks the store address with `AutoCompleteInput`, whose library imports the barrel back: +// this entry no longer keeps the barrel out (its guard's static walk does not follow into that library). +// // C-35 — THE PORTABLE ENTRY: what loads on the web with no stubs. // // The barrel (`index.js`) reaches maps, geolocation, permissions, the image