diff --git a/app/components/recalc/calcHeading.tsx b/app/components/recalc/calcHeading.tsx index b7e6cfe58..62f072fd8 100644 --- a/app/components/recalc/calcHeading.tsx +++ b/app/components/recalc/calcHeading.tsx @@ -41,8 +41,10 @@ export default function CalcHeading({ }, [copied]); return ( -
-

{title}

+
+

+ {title} +

+ + + +
+ - - +
+
+ {' '} +
+
+ +
+
- + - sprocket.chainType === chain && + sprocket.pitch.eq(pitch) && (sprocket.teeth === p1Teeth || sprocket.teeth === p2Teeth) } /> diff --git a/app/routes/flywheel.tsx b/app/routes/flywheel.tsx index f52b80d14..2f443a4b3 100644 --- a/app/routes/flywheel.tsx +++ b/app/routes/flywheel.tsx @@ -712,7 +712,9 @@ export default function Flywheel() {

Motors & Electrical

- + {/* Motor and Efficiency each get their own row on mobile; + paired at md+. */} +
- +
-
+

Shooter Wheel

@@ -1249,7 +1251,7 @@ export default function Flywheel() {
{/* Feedforward constants + Effective MOI */} -
+
{/* Feedback Gain */} -
+
-
+
-
+

Settings diff --git a/app/routes/intake.tsx b/app/routes/intake.tsx index 45781b0fa..231239299 100644 --- a/app/routes/intake.tsx +++ b/app/routes/intake.tsx @@ -210,12 +210,16 @@ export default function Intake() { {allRecommendedRatiosAndStallTorques .sort((a, b) => b.stallTorque.sub(a.stallTorque).baseScalar) .map((rts) => ( - - +

))}
diff --git a/app/routes/linear.tsx b/app/routes/linear.tsx index 91b4ae024..2c7ae57e2 100644 --- a/app/routes/linear.tsx +++ b/app/routes/linear.tsx @@ -28,6 +28,7 @@ import { CollapsibleTrigger, } from '~/components/ui/collapsible'; import { Skeleton } from '~/components/ui/skeleton'; +import { useIsMobile } from '~/hooks/use-mobile'; import { useQueryParams, useSerializedState } from '~/lib/hooks'; import { buildCalculatorApp, buildJsonLd, buildWebPage } from '~/lib/jsonld'; import { calculateGuessedLimits, calculateStallLoad } from '~/lib/math/linear'; @@ -155,6 +156,7 @@ const optimizerPool = getPool(optimizerWorkerUrl); export default function Linear() { const queryParams = useQueryParams(DEFAULT_PARAMS); + const isMobile = useIsMobile(); const [motor, setMotor] = useState(queryParams.motor); const [travelDistance, setTravelDistance] = useState( @@ -557,7 +559,7 @@ export default function Linear() { />
{/* Left column: inputs */} -
+
{/* Motor & Gearing section */}
@@ -572,7 +574,9 @@ export default function Linear() { tooltip="Enable for a cascading elevator. The simulation applies first-stage mechanics: half the travel distance and double the load." />
- + {/* Motor gets its own full-width row on mobile; pairs with + Efficiency at md+. */} +
- +
- + {/* Kalman inputs stack onto their own rows on mobile; + three across at md+. */} +
- +
@@ -820,10 +826,10 @@ export default function Linear() {
{/* Right column: outputs + chart */} -
+
{/* Results + Chart + Feedforward as one card */}
-
+
{isSimulating ? ( <>
@@ -873,7 +879,12 @@ export default function Linear() { @@ -965,7 +984,7 @@ export default function Linear() {
-
+
-
+
{/* Optimal configuration grid */}
{/* Right column: settings + selected config */} -
+

Settings diff --git a/playwright-tests/chains.spec.ts b/playwright-tests/chains.spec.ts index 1c2af93d7..bd5a7d97e 100644 --- a/playwright-tests/chains.spec.ts +++ b/playwright-tests/chains.spec.ts @@ -58,8 +58,7 @@ test.describe('Chain Calculator', () => { }); test('should match snapshot with chain changed', async ({ page }) => { - await page.getByTestId('chainType').click(); - await page.getByRole('option', { name: '#35' }).click(); + await page.getByRole('button', { name: '#35' }).click(); await page.waitForTimeout(100); expect(await page.getByTestId('entrypoint').ariaSnapshot()).toMatchSnapshot( { diff --git a/playwright-tests/chains.spec.ts-snapshots/chain-unit-changed-Google-Chrome-linux.yaml b/playwright-tests/chains.spec.ts-snapshots/chain-unit-changed-Google-Chrome-linux.yaml index 16cf0038d..fe0eb5c7c 100644 --- a/playwright-tests/chains.spec.ts-snapshots/chain-unit-changed-Google-Chrome-linux.yaml +++ b/playwright-tests/chains.spec.ts-snapshots/chain-unit-changed-Google-Chrome-linux.yaml @@ -3,11 +3,16 @@ - img - img - text: Copy Link -- text: Chain Type -- combobox: "#35" +- group: + - button "#25" + - button "#35" + - button "8mm" +- text: Pitch +- spinbutton "Pitch Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "0.375" +- combobox: in - switch "Allow Half Links" - text: Allow Half Links Desired Center -- spinbutton "Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "5" +- spinbutton: "5" - combobox: in - text: Extra Center - spinbutton: "0" diff --git a/playwright-tests/chains.spec.ts-snapshots/desiredCenter-magnitude-changed-Google-Chrome-linux.yaml b/playwright-tests/chains.spec.ts-snapshots/desiredCenter-magnitude-changed-Google-Chrome-linux.yaml index 5cf509bde..712e8ca2a 100644 --- a/playwright-tests/chains.spec.ts-snapshots/desiredCenter-magnitude-changed-Google-Chrome-linux.yaml +++ b/playwright-tests/chains.spec.ts-snapshots/desiredCenter-magnitude-changed-Google-Chrome-linux.yaml @@ -3,11 +3,16 @@ - img - img - text: Copy Link -- text: Chain Type -- combobox: "#25" +- group: + - button "#25" + - button "#35" + - button "8mm" +- text: Pitch +- spinbutton "Pitch Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "0.25" +- combobox: in - switch "Allow Half Links" - text: Allow Half Links Desired Center -- spinbutton "Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "10" +- spinbutton: "10" - combobox: in - text: Extra Center - spinbutton: "0" diff --git a/playwright-tests/chains.spec.ts-snapshots/desiredCenter-unit-changed-Google-Chrome-linux.yaml b/playwright-tests/chains.spec.ts-snapshots/desiredCenter-unit-changed-Google-Chrome-linux.yaml index a4c022275..b48f9259f 100644 --- a/playwright-tests/chains.spec.ts-snapshots/desiredCenter-unit-changed-Google-Chrome-linux.yaml +++ b/playwright-tests/chains.spec.ts-snapshots/desiredCenter-unit-changed-Google-Chrome-linux.yaml @@ -3,11 +3,16 @@ - img - img - text: Copy Link -- text: Chain Type -- combobox: "#25" +- group: + - button "#25" + - button "#35" + - button "8mm" +- text: Pitch +- spinbutton "Pitch Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "0.25" +- combobox: in - switch "Allow Half Links" - text: Allow Half Links Desired Center -- spinbutton "Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "5" +- spinbutton: "5" - combobox: ft - text: Extra Center - spinbutton: "0" diff --git a/playwright-tests/chains.spec.ts-snapshots/extraCenter-magnitude-changed-Google-Chrome-linux.yaml b/playwright-tests/chains.spec.ts-snapshots/extraCenter-magnitude-changed-Google-Chrome-linux.yaml index 359a061a5..92cc5e3af 100644 --- a/playwright-tests/chains.spec.ts-snapshots/extraCenter-magnitude-changed-Google-Chrome-linux.yaml +++ b/playwright-tests/chains.spec.ts-snapshots/extraCenter-magnitude-changed-Google-Chrome-linux.yaml @@ -3,11 +3,16 @@ - img - img - text: Copy Link -- text: Chain Type -- combobox: "#25" +- group: + - button "#25" + - button "#35" + - button "8mm" +- text: Pitch +- spinbutton "Pitch Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "0.25" +- combobox: in - switch "Allow Half Links" - text: Allow Half Links Desired Center -- spinbutton "Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "5" +- spinbutton: "5" - combobox: in - text: Extra Center - spinbutton: "1" diff --git a/playwright-tests/chains.spec.ts-snapshots/extraCenter-unit-changed-Google-Chrome-linux.yaml b/playwright-tests/chains.spec.ts-snapshots/extraCenter-unit-changed-Google-Chrome-linux.yaml index 647b5c2e3..b13086e96 100644 --- a/playwright-tests/chains.spec.ts-snapshots/extraCenter-unit-changed-Google-Chrome-linux.yaml +++ b/playwright-tests/chains.spec.ts-snapshots/extraCenter-unit-changed-Google-Chrome-linux.yaml @@ -3,11 +3,16 @@ - img - img - text: Copy Link -- text: Chain Type -- combobox: "#25" +- group: + - button "#25" + - button "#35" + - button "8mm" +- text: Pitch +- spinbutton "Pitch Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "0.25" +- combobox: in - switch "Allow Half Links" - text: Allow Half Links Desired Center -- spinbutton "Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "5" +- spinbutton: "5" - combobox: in - text: Extra Center - spinbutton: "1" diff --git a/playwright-tests/chains.spec.ts-snapshots/largerDiffFromTarget-unit-changed-Google-Chrome-linux.yaml b/playwright-tests/chains.spec.ts-snapshots/largerDiffFromTarget-unit-changed-Google-Chrome-linux.yaml index 6c470bfae..6dbbc8a78 100644 --- a/playwright-tests/chains.spec.ts-snapshots/largerDiffFromTarget-unit-changed-Google-Chrome-linux.yaml +++ b/playwright-tests/chains.spec.ts-snapshots/largerDiffFromTarget-unit-changed-Google-Chrome-linux.yaml @@ -3,11 +3,16 @@ - img - img - text: Copy Link -- text: Chain Type -- combobox: "#25" +- group: + - button "#25" + - button "#35" + - button "8mm" +- text: Pitch +- spinbutton "Pitch Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "0.25" +- combobox: in - switch "Allow Half Links" - text: Allow Half Links Desired Center -- spinbutton "Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "5" +- spinbutton: "5" - combobox: in - text: Extra Center - spinbutton: "0" diff --git a/playwright-tests/chains.spec.ts-snapshots/largerDistance-changed-Google-Chrome-linux.yaml b/playwright-tests/chains.spec.ts-snapshots/largerDistance-changed-Google-Chrome-linux.yaml index 11d5f9230..85e757344 100644 --- a/playwright-tests/chains.spec.ts-snapshots/largerDistance-changed-Google-Chrome-linux.yaml +++ b/playwright-tests/chains.spec.ts-snapshots/largerDistance-changed-Google-Chrome-linux.yaml @@ -3,11 +3,16 @@ - img - img - text: Copy Link -- text: Chain Type -- combobox: "#25" +- group: + - button "#25" + - button "#35" + - button "8mm" +- text: Pitch +- spinbutton "Pitch Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "0.25" +- combobox: in - switch "Allow Half Links" - text: Allow Half Links Desired Center -- spinbutton "Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "5" +- spinbutton: "5" - combobox: in - text: Extra Center - spinbutton: "0" diff --git a/playwright-tests/chains.spec.ts-snapshots/p1PitchDiameter-changed-Google-Chrome-linux.yaml b/playwright-tests/chains.spec.ts-snapshots/p1PitchDiameter-changed-Google-Chrome-linux.yaml index 5ffe3bd93..6c9ddd9e3 100644 --- a/playwright-tests/chains.spec.ts-snapshots/p1PitchDiameter-changed-Google-Chrome-linux.yaml +++ b/playwright-tests/chains.spec.ts-snapshots/p1PitchDiameter-changed-Google-Chrome-linux.yaml @@ -3,11 +3,16 @@ - img - img - text: Copy Link -- text: Chain Type -- combobox: "#25" +- group: + - button "#25" + - button "#35" + - button "8mm" +- text: Pitch +- spinbutton "Pitch Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "0.25" +- combobox: in - switch "Allow Half Links" - text: Allow Half Links Desired Center -- spinbutton "Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "5" +- spinbutton: "5" - combobox: in - text: Extra Center - spinbutton: "0" diff --git a/playwright-tests/chains.spec.ts-snapshots/p1Teeth-changed-Google-Chrome-linux.yaml b/playwright-tests/chains.spec.ts-snapshots/p1Teeth-changed-Google-Chrome-linux.yaml index f937130a7..95867b794 100644 --- a/playwright-tests/chains.spec.ts-snapshots/p1Teeth-changed-Google-Chrome-linux.yaml +++ b/playwright-tests/chains.spec.ts-snapshots/p1Teeth-changed-Google-Chrome-linux.yaml @@ -3,11 +3,16 @@ - img - img - text: Copy Link -- text: Chain Type -- combobox: "#25" +- group: + - button "#25" + - button "#35" + - button "8mm" +- text: Pitch +- spinbutton "Pitch Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "0.25" +- combobox: in - switch "Allow Half Links" - text: Allow Half Links Desired Center -- spinbutton "Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "5" +- spinbutton: "5" - combobox: in - text: Extra Center - spinbutton: "0" diff --git a/playwright-tests/chains.spec.ts-snapshots/p2PitchDiameter-changed-Google-Chrome-linux.yaml b/playwright-tests/chains.spec.ts-snapshots/p2PitchDiameter-changed-Google-Chrome-linux.yaml index 3f5989b79..30269df53 100644 --- a/playwright-tests/chains.spec.ts-snapshots/p2PitchDiameter-changed-Google-Chrome-linux.yaml +++ b/playwright-tests/chains.spec.ts-snapshots/p2PitchDiameter-changed-Google-Chrome-linux.yaml @@ -3,11 +3,16 @@ - img - img - text: Copy Link -- text: Chain Type -- combobox: "#25" +- group: + - button "#25" + - button "#35" + - button "8mm" +- text: Pitch +- spinbutton "Pitch Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "0.25" +- combobox: in - switch "Allow Half Links" - text: Allow Half Links Desired Center -- spinbutton "Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "5" +- spinbutton: "5" - combobox: in - text: Extra Center - spinbutton: "0" diff --git a/playwright-tests/chains.spec.ts-snapshots/p2Teeth-changed-Google-Chrome-linux.yaml b/playwright-tests/chains.spec.ts-snapshots/p2Teeth-changed-Google-Chrome-linux.yaml index 1f3a2fcc9..29f5eaa59 100644 --- a/playwright-tests/chains.spec.ts-snapshots/p2Teeth-changed-Google-Chrome-linux.yaml +++ b/playwright-tests/chains.spec.ts-snapshots/p2Teeth-changed-Google-Chrome-linux.yaml @@ -3,11 +3,16 @@ - img - img - text: Copy Link -- text: Chain Type -- combobox: "#25" +- group: + - button "#25" + - button "#35" + - button "8mm" +- text: Pitch +- spinbutton "Pitch Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "0.25" +- combobox: in - switch "Allow Half Links" - text: Allow Half Links Desired Center -- spinbutton "Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "5" +- spinbutton: "5" - combobox: in - text: Extra Center - spinbutton: "0" diff --git a/playwright-tests/chains.spec.ts-snapshots/smallerDiffFromTarget-unit-changed-Google-Chrome-linux.yaml b/playwright-tests/chains.spec.ts-snapshots/smallerDiffFromTarget-unit-changed-Google-Chrome-linux.yaml index f21ddc5c3..8497e58e1 100644 --- a/playwright-tests/chains.spec.ts-snapshots/smallerDiffFromTarget-unit-changed-Google-Chrome-linux.yaml +++ b/playwright-tests/chains.spec.ts-snapshots/smallerDiffFromTarget-unit-changed-Google-Chrome-linux.yaml @@ -3,11 +3,16 @@ - img - img - text: Copy Link -- text: Chain Type -- combobox: "#25" +- group: + - button "#25" + - button "#35" + - button "8mm" +- text: Pitch +- spinbutton "Pitch Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "0.25" +- combobox: in - switch "Allow Half Links" - text: Allow Half Links Desired Center -- spinbutton "Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "5" +- spinbutton: "5" - combobox: in - text: Extra Center - spinbutton: "0" diff --git a/playwright-tests/chains.spec.ts-snapshots/smallerDistance-changed-Google-Chrome-linux.yaml b/playwright-tests/chains.spec.ts-snapshots/smallerDistance-changed-Google-Chrome-linux.yaml index b0537a1fc..bbc3ec598 100644 --- a/playwright-tests/chains.spec.ts-snapshots/smallerDistance-changed-Google-Chrome-linux.yaml +++ b/playwright-tests/chains.spec.ts-snapshots/smallerDistance-changed-Google-Chrome-linux.yaml @@ -3,11 +3,16 @@ - img - img - text: Copy Link -- text: Chain Type -- combobox: "#25" +- group: + - button "#25" + - button "#35" + - button "8mm" +- text: Pitch +- spinbutton "Pitch Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "0.25" +- combobox: in - switch "Allow Half Links" - text: Allow Half Links Desired Center -- spinbutton "Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "5" +- spinbutton: "5" - combobox: in - text: Extra Center - spinbutton: "0" diff --git a/playwright-tests/copy-link.spec.ts b/playwright-tests/copy-link.spec.ts index 3b2ae5b9a..3089d72d8 100644 --- a/playwright-tests/copy-link.spec.ts +++ b/playwright-tests/copy-link.spec.ts @@ -51,8 +51,7 @@ test.describe('Copy Link', () => { await page.goto('/chains'); await page.waitForLoadState('networkidle'); - await page.getByTestId('chainType').click(); - await page.getByRole('option', { name: '#35' }).click(); + await page.getByRole('button', { name: '#35' }).click(); await page.getByTestId('p1Teeth').fill('20'); await page.getByTestId('p2Teeth').fill('40'); await page.getByTestId('desiredCenter').fill('8'); diff --git a/playwright-tests/copy-link.spec.ts-snapshots/chains-restored-Google-Chrome-linux.yaml b/playwright-tests/copy-link.spec.ts-snapshots/chains-restored-Google-Chrome-linux.yaml index 5a9fab7e2..19bcbbff1 100644 --- a/playwright-tests/copy-link.spec.ts-snapshots/chains-restored-Google-Chrome-linux.yaml +++ b/playwright-tests/copy-link.spec.ts-snapshots/chains-restored-Google-Chrome-linux.yaml @@ -3,11 +3,16 @@ - img - img - text: Copy Link -- text: Chain Type -- combobox: "#35" +- group: + - button "#25" + - button "#35" + - button "8mm" +- text: Pitch +- spinbutton "Pitch Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "0.375" +- combobox: in - switch "Allow Half Links" [checked] - text: Allow Half Links Desired Center -- spinbutton "Desired Center Extra Center Pitch Diameter Pitch Diameter Chain Links Center Distance Difference From Target Chain Links Center Distance Difference From Target": "8" +- spinbutton: "8" - combobox: in - text: Extra Center - spinbutton: "1"