|
1 | | -import React, { useState, useEffect } from 'react'; |
| 1 | +import React from 'react'; |
2 | 2 | import { DualSimulationDisplay } from '../components/DualSimulationDisplay'; |
3 | | -import { initializeHigh, initializeLow } from '../lib/six-vertex/initialStates'; |
4 | | -import type { LatticeState } from '../lib/six-vertex/types'; |
5 | 3 |
|
6 | 4 | export default function TestCentering() { |
7 | | - const [latticeA, setLatticeA] = useState<LatticeState | null>(null); |
8 | | - const [latticeB, setLatticeB] = useState<LatticeState | null>(null); |
9 | | - const [showArrows, setShowArrows] = useState(false); |
10 | | - const [latticeSize, setLatticeSize] = useState(16); |
11 | | - |
12 | | - // Initialize lattices |
13 | | - useEffect(() => { |
14 | | - setLatticeA(initializeHigh(latticeSize)); |
15 | | - setLatticeB(initializeLow(latticeSize)); |
16 | | - }, [latticeSize]); |
17 | | - |
18 | 5 | return ( |
19 | 6 | <div style={{ |
20 | 7 | width: '100vw', |
21 | | - height: '100vh', |
22 | | - display: 'flex', |
| 8 | + height: '100vh', |
| 9 | + display: 'flex', |
23 | 10 | flexDirection: 'column', |
24 | | - backgroundColor: '#f5f5f5' |
| 11 | + overflow: 'hidden' |
25 | 12 | }}> |
26 | 13 | <div style={{ |
27 | 14 | padding: '10px', |
28 | | - backgroundColor: 'white', |
29 | | - borderBottom: '1px solid #ddd', |
30 | | - display: 'flex', |
31 | | - gap: '10px', |
32 | | - alignItems: 'center', |
33 | | - flexShrink: 0 |
| 15 | + backgroundColor: '#f0f0f0', |
| 16 | + borderBottom: '1px solid #ccc' |
34 | 17 | }}> |
35 | | - <h2 style={{ margin: 0, fontSize: '1.2rem' }}>Centering Test</h2> |
36 | | - |
37 | | - <div style={{ marginLeft: 'auto', display: 'flex', gap: '10px', alignItems: 'center' }}> |
38 | | - <label> |
39 | | - Size: |
40 | | - <select |
41 | | - value={latticeSize} |
42 | | - onChange={(e) => setLatticeSize(Number(e.target.value))} |
43 | | - style={{ marginLeft: '5px' }} |
44 | | - > |
45 | | - <option value={8}>8x8</option> |
46 | | - <option value={16}>16x16</option> |
47 | | - <option value={24}>24x24</option> |
48 | | - <option value={32}>32x32</option> |
49 | | - </select> |
50 | | - </label> |
51 | | - |
52 | | - <label> |
53 | | - <input |
54 | | - type="checkbox" |
55 | | - checked={showArrows} |
56 | | - onChange={(e) => setShowArrows(e.target.checked)} |
57 | | - /> |
58 | | - Show Arrows |
59 | | - </label> |
60 | | - </div> |
61 | | - |
62 | | - <div style={{ |
63 | | - padding: '5px 10px', |
64 | | - backgroundColor: '#e8f4fd', |
65 | | - border: '1px solid #2196f3', |
66 | | - borderRadius: '4px', |
67 | | - fontSize: '0.9rem', |
68 | | - color: '#1976d2' |
69 | | - }}> |
70 | | - Press <kbd>F</kbd> to fit | <kbd>R</kbd> to reset |
71 | | - </div> |
72 | | - </div> |
73 | | - |
74 | | - <div style={{ flex: 1, minHeight: 0, padding: '10px' }}> |
75 | | - <DualSimulationDisplay |
76 | | - latticeA={latticeA} |
77 | | - latticeB={latticeB} |
78 | | - showArrows={showArrows} |
79 | | - cellSize={20} |
80 | | - /> |
| 18 | + <h2 style={{ margin: 0, fontSize: '18px' }}>Canvas Centering Test (VM-Optimized)</h2> |
| 19 | + <p style={{ margin: '5px 0 0 0', fontSize: '14px' }}> |
| 20 | + Press <kbd>F</kbd> to fit canvas | Press <kbd>R</kbd> to reset view | Matrices should auto-center after retry attempts |
| 21 | + </p> |
81 | 22 | </div> |
82 | | - |
83 | | - <div style={{ |
84 | | - padding: '10px', |
85 | | - backgroundColor: 'white', |
86 | | - borderTop: '1px solid #ddd', |
87 | | - fontSize: '0.85rem', |
88 | | - color: '#666', |
89 | | - textAlign: 'center' |
90 | | - }}> |
91 | | - VM Display Fix: If matrices appear in corner, press <strong>F</strong> key or change display resolution temporarily |
| 23 | + <div style={{ flex: 1, overflow: 'hidden' }}> |
| 24 | + <DualSimulationDisplay /> |
92 | 25 | </div> |
93 | 26 | </div> |
94 | 27 | ); |
|
0 commit comments