Commit aa26ad2
committed
chore: package sanitation — prune dead code, tighten internal types
Dead code removed:
- 11 unused tracking wrapper functions in `lib/analytics/index.ts`
(trackToolEngaged, trackToolSessionSummary, trackPageScrollDepth,
trackLearnPanelScrollDepth, trackOutboundClick,
trackMobileControlsToggle, trackFileUploadError, trackJsError,
trackWebGLError, trackCapabilityCheck) plus `getGlobalProperties`.
Consumers can call `dispatch()` directly when needed; the wrappers
added zero behaviour and rotted into "exported but never imported"
cruft. Their type imports are pruned too.
- `OverlayRect` type and `overlayRects` mutable export from the
megapixels-size-visualizer drawOverlay — leftover hit-test scratch
buffer from a sensor-size-comparison copy/paste; never read.
- Legacy `ToolEducation` / `Challenge` / `ChallengeOption` / `ProTip`
types in `lib/data/education/types.ts` — pre-i18n schema kept after
the skeleton refactor took over; nothing consumes them.
- `DOF_SCENE_PRESETS` "backward-compat alias for existing DoF
Calculator component (until Task 8 renames it)" — Task 8 happened
long ago. The only consumer was its own test file.
- `ALL_MP_IDS` / `ALL_SENSOR_IDS` intermediate arrays — only the
`_SET` variants were ever read; inlined the source.
- Duplicate local `formatDist` helpers in HyperfocalMiniTable and
HyperfocalBadge — both reimplemented the dof-diagram-helpers
version (minus the `isFinite` infinity guard). Now import the
shared one, gaining the ∞ formatting for free.
API surface tightened (removed `export` from internal-only types):
- `FramingPreset`, `GlossaryEntry`, `FaqSkeleton`, `ToolFaqs`,
`WbPreset`, `WbScene`, `ExposureScene`, `PrintSizePreset`,
`SceneObject`, `SceneDef`, `ScenePickerScene`, `MagnifierState`,
`SceneAssets`, `PillBounds`, `GeoArrays`, `BokehCircle`,
`MIN_DIST`, `MAX_DIST`. Each was only referenced inside its own
module; making them file-local stops them from looking like a
public contract.
Bug hardening:
- `loadCustomSensors` now validates that the parsed JSON is an array
before iterating. Previously a corrupted/non-array localStorage
value would partially mutate `COMMON_MP` before throwing into the
catch — unlikely in practice but messy.
Verified: 868 unit tests, 122 chromium smoke specs, type-check, lint,
and production build (720 static pages) all pass.1 parent 9010812 commit aa26ad2
22 files changed
Lines changed: 24 additions & 182 deletions
File tree
- src
- app/[locale]
- color-scheme-generator/_components
- exposure-simulator/_components
- fov-simulator/_components
- hyperfocal-simulator/_components
- megapixels-size-visualizer/_components
- perspective-compression-simulator/_components
- sensor-size-comparison/_components
- lib
- analytics
- data
- education
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 11 | | |
16 | 12 | | |
17 | 13 | | |
| |||
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | 14 | | |
19 | 15 | | |
20 | 16 | | |
| |||
Lines changed: 0 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | 6 | | |
10 | 7 | | |
11 | 8 | | |
| |||
17 | 14 | | |
18 | 15 | | |
19 | 16 | | |
20 | | - | |
21 | 17 | | |
22 | 18 | | |
23 | 19 | | |
| |||
64 | 60 | | |
65 | 61 | | |
66 | 62 | | |
67 | | - | |
68 | | - | |
69 | 63 | | |
70 | 64 | | |
71 | 65 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
64 | 63 | | |
65 | 64 | | |
66 | 65 | | |
67 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
0 commit comments