chore: Bump version to 0.0.103, fix planet filter tabs
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
5ffec6bcec
commit
8e11dc732f
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "sociowire-frontend",
|
||||
"private": true,
|
||||
"version": "0.0.102",
|
||||
"version": "0.0.103",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite --host 0.0.0.0",
|
||||
|
|
|
|||
|
|
@ -48,10 +48,14 @@ export default function IslandUniverse({ onClose, onIslandClick }) {
|
|||
return () => { mounted = false; };
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (!containerRef.current || islands.length === 0) return;
|
||||
// Filter based on active tab
|
||||
const displayIslands = activeTab === 'planets' ? [] : islands;
|
||||
const displayPlanets = activeTab === 'islands' ? [] : planets;
|
||||
|
||||
console.log('[IslandUniverse] Rendering universe with MapLibre:', islands.length, 'islands');
|
||||
useEffect(() => {
|
||||
if (!containerRef.current || (displayIslands.length === 0 && displayPlanets.length === 0)) return;
|
||||
|
||||
console.log('[IslandUniverse] Rendering universe with MapLibre:', displayIslands.length, 'islands,', displayPlanets.length, 'planets');
|
||||
|
||||
// Center point in virtual space
|
||||
const centerLat = 0;
|
||||
|
|
@ -88,10 +92,10 @@ export default function IslandUniverse({ onClose, onIslandClick }) {
|
|||
const markers = [];
|
||||
|
||||
// Use grid-based positioning to prevent overlap
|
||||
const gridSize = Math.ceil(Math.sqrt(islands.length));
|
||||
const gridSize = Math.ceil(Math.sqrt(displayIslands.length || 1));
|
||||
const spacing = 8; // degrees between islands
|
||||
|
||||
islands.forEach((island, idx) => {
|
||||
displayIslands.forEach((island, idx) => {
|
||||
// Grid position with random offset for organic feel
|
||||
const gridX = idx % gridSize;
|
||||
const gridY = Math.floor(idx / gridSize);
|
||||
|
|
@ -186,7 +190,7 @@ export default function IslandUniverse({ onClose, onIslandClick }) {
|
|||
});
|
||||
|
||||
// Add planet markers (positioned in outer ring)
|
||||
planets.forEach((planet, idx) => {
|
||||
displayPlanets.forEach((planet, idx) => {
|
||||
const angle = (idx / Math.max(planets.length, 1)) * Math.PI * 2;
|
||||
const radius = 18 + (idx % 3) * 4;
|
||||
const lng = centerLng + Math.cos(angle) * radius;
|
||||
|
|
@ -295,7 +299,7 @@ export default function IslandUniverse({ onClose, onIslandClick }) {
|
|||
markersRef.current = [];
|
||||
map.remove();
|
||||
};
|
||||
}, [islands, onIslandClick]);
|
||||
}, [displayIslands, displayPlanets, activeTab, onIslandClick]);
|
||||
|
||||
return (
|
||||
<div className="island-universe-modal" onClick={onClose}>
|
||||
|
|
|
|||
Loading…
Reference in New Issue