feat(rooms): Fix NaN online stats + Add DAARWIZZ CTA on homepage

- Fixed NaN in online stats by using nullish coalescing (?? 0)
- Added members_online, zone, room_type to /api/v1/city/rooms response
- Added DAARWIZZ chat CTA section on homepage with link to city-lobby
- Created task files for next phases:
  - TASK_PHASE_CITY_ROOMS_FINISH_v2.md
  - TASK_PHASE_AGENT_MANAGEMENT_v1.md
  - TASK_PHASE_CITIZENS_DIRECTORY_v1.md
This commit is contained in:
Apple
2025-12-01 09:19:07 -08:00
parent a563ec86a0
commit 649d07ee29
6 changed files with 598 additions and 3 deletions

View File

@@ -31,10 +31,10 @@ export default function CityPage() {
// Use SSE presence data if available, otherwise fallback to API data
const totalOnline = cityOnline > 0
? cityOnline
: rooms.reduce((sum, r) => sum + r.members_online, 0)
: rooms.reduce((sum, r) => sum + (r.members_online ?? 0), 0)
const activeRooms = Object.values(roomsPresence).filter(p => p.online > 0).length ||
rooms.filter(r => r.members_online > 0).length
rooms.filter(r => (r.members_online ?? 0) > 0).length
if (loading) {
return (

View File

@@ -1,5 +1,5 @@
import Link from 'next/link'
import { ArrowRight, Building2, Bot, Users, Zap, Shield, Globe } from 'lucide-react'
import { ArrowRight, Building2, Bot, Users, Zap, Shield, Globe, MessageCircle } from 'lucide-react'
import { StatusIndicator } from '@/components/StatusIndicator'
const features = [
@@ -95,6 +95,35 @@ export default function HomePage() {
</div>
</section>
{/* DAARWIZZ Chat CTA */}
<section className="px-4 py-12 sm:py-16">
<div className="max-w-4xl mx-auto">
<div className="glass-panel p-8 sm:p-10 text-center bg-gradient-to-br from-fuchsia-950/50 to-violet-950/50 border-fuchsia-500/20">
<div className="inline-flex p-4 rounded-2xl bg-gradient-to-br from-fuchsia-500/20 to-violet-600/20 mb-6">
<MessageCircle className="w-10 h-10 text-fuchsia-400" />
</div>
<h2 className="text-2xl sm:text-3xl font-bold text-white mb-4">
Головний публічний чат DAARION
</h2>
<p className="text-slate-300 max-w-xl mx-auto mb-8 leading-relaxed">
Поспілкуйтеся з <span className="text-fuchsia-400 font-semibold">DAARWIZZ</span>
головним AI-помічником міста, та іншими громадянами в City Lobby.
</p>
<Link
href="/city?room=city-lobby"
className="inline-flex items-center justify-center gap-2 px-8 py-4 text-lg font-semibold bg-gradient-to-r from-fuchsia-500 to-violet-600 rounded-2xl hover:from-fuchsia-400 hover:to-violet-500 transition-all duration-300 shadow-lg shadow-fuchsia-500/25 hover:shadow-fuchsia-500/40 hover:scale-105"
>
<Bot className="w-5 h-5" />
Поспілкуватися з DAARWIZZ
<ArrowRight className="w-5 h-5" />
</Link>
</div>
</div>
</section>
{/* Vision Section */}
<section className="px-4 py-16 sm:py-24">
<div className="max-w-4xl mx-auto">