Skip to content

Commit 36d8b5f

Browse files
cjw6kclaude
andcommitted
fix: Improve Camera View UX with better labels and hints
- Add descriptions to each view option explaining what it shows - Add tooltip on hover for each button - Display control hints: "scroll to zoom, drag to rotate" - Show current view description below buttons - Move Sun view camera closer for better initial view - Narrow Sun view FOV from 50 to 45 for tighter focus Closes ha-9dk Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent bd40e5e commit 36d8b5f

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed
Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
import { useCamera } from '@/hooks/useCamera';
22
import type { CameraPreset } from '@/types';
33

4-
const VIEW_OPTIONS: { preset: CameraPreset; label: string }[] = [
5-
{ preset: 'overview', label: 'Overview' },
6-
{ preset: 'earth', label: 'Earth' },
7-
{ preset: 'moon', label: 'Moon' },
8-
{ preset: 'sun', label: 'Sun' },
4+
const VIEW_OPTIONS: { preset: CameraPreset; label: string; description: string }[] = [
5+
{ preset: 'overview', label: 'Overview', description: 'See the whole system' },
6+
{ preset: 'earth', label: 'Earth', description: 'Orbit around Earth' },
7+
{ preset: 'moon', label: 'Moon', description: 'Orbit around the Moon' },
8+
{ preset: 'sun', label: 'Sun', description: 'Orbit around the Sun' },
99
];
1010

1111
export function ViewSelector() {
1212
const { preset, setPreset } = useCamera();
13+
const currentView = VIEW_OPTIONS.find((o) => o.preset === preset);
1314

1415
return (
1516
<div className="bg-slate-800/80 backdrop-blur-sm rounded-lg p-3">
16-
<span className="text-slate-400 text-sm font-medium">Camera View</span>
17+
<div className="flex items-center justify-between">
18+
<span className="text-slate-400 text-sm font-medium">Camera View</span>
19+
<span className="text-slate-500 text-xs">scroll to zoom, drag to rotate</span>
20+
</div>
1721
<div className="flex gap-2 flex-wrap mt-2">
1822
{VIEW_OPTIONS.map((option) => (
1923
<button
2024
key={option.preset}
2125
onClick={() => setPreset(option.preset)}
26+
title={option.description}
2227
className={`px-3 py-1.5 rounded text-sm font-medium transition-colors ${
2328
preset === option.preset
2429
? 'bg-blue-600 text-white'
@@ -29,6 +34,9 @@ export function ViewSelector() {
2934
</button>
3035
))}
3136
</div>
37+
{currentView && (
38+
<p className="text-slate-400 text-xs mt-2">{currentView.description}</p>
39+
)}
3240
</div>
3341
);
3442
}

tidal-harmonics/src/stores/cameraStore.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ const CAMERA_PRESETS: Record<CameraPreset, CameraTarget> = {
2626
fov: 45,
2727
},
2828
sun: {
29-
position: [-180, 20, 0],
29+
position: [-188, 10, 10],
3030
target: [-200, 0, 0],
31-
fov: 50,
31+
fov: 45,
3232
},
3333
};
3434

0 commit comments

Comments
 (0)