MolinoPro

human-layer-doc

Master Codebase Guidebook
Markdown + HTML Dev-Docs Renderer - Frontend Client Module

Default Index
Open README.md
Root: README.mdRoot
Milestones
H1Human Layer Doc — Active Sprint
H2Done — Trips / Itinerary
  1. ✅ Concept groups render as cards (CardGrid + QR hover) in "Concept groups" section
  2. ✅ Session stack children concept groups render as cards in "From sessions" section
  3. ✅ Old inline contentStack.sessionConceptGroups rendering removed from TripItineraryCanvas
  4. ✅ page.tsx fetches session stacks with sessionConceptGroups, computes contentStackChildren per city
  5. ✅ Modal opens on card click (pointer-events-none on QR overlay)
  6. ✅ Concept card content moved to TOP of city block as lead description (base text for the city)
  7. ✅ City info from City model shown as fallback only when no conceptCard assigned
  8. ✅ No new TS/build errors
H2Done — Documents Sidebar & Assistant Mobile-First
  1. ✅ Documents sidebar: removed -114px negative margin, simplified layout to flex column with proper full-height fill
  2. ✅ Sidebar bottom slot now properly anchored at bottom, scrollable content area fills remaining space
  3. ✅ Assistant page: removed bizarre 86px vertical button padding, replaced with finger-sized 44px min-height
  4. ✅ Assistant page: responsive padding (p-4 md:p-6 lg:p-10), responsive font sizes
  5. ✅ AssistantWorkspace: finger-sized input (min-h-[44px] md:min-h-[48px]) and send button
  6. ✅ AssistantWorkspace: responsive message area height (max-h-[50vh] md:max-h-[60vh])
  7. ✅ AssistantWorkspace: "Run" label hidden on mobile (hidden sm:inline) to save space
  8. ✅ AssistantPanel: increased padding, font sizes, gaps for mobile readability
  9. ✅ AssistantPanel floating toggle: increased from 34px to 44px min-height
  10. ✅ Global .micro-btn / .micro-fp: increased padding from 3px 8px to 6px 10px, added min-height: 32px
  11. ✅ Mobile media query for .micro-btn / .micro-fp: min-height: 40px, larger padding on screens ≤640px
H2Done — Trips Landing Page Streamlined
  1. TripsSectionRegistry.ts: updated hero defaults — "Discover Andalusia Your Way", "Plan. Connect. Explore."
  2. TripsSectionRegistry.ts: updated how-it-works defaults to 3-step user-friendly copy (Plan / Join / Connect)
  3. TripsLandingSections.tsx: reordered sections — Hero → How It Works → Featured Trips → Featured Experiences → Final CTA → Footer
  4. ✅ Added inline "Córdoba & Granada: The Heart of Al-Andalus" section with bullet points
  5. ✅ Added inline "Flexible, Modular, and Always Yours" 3-card grid
  6. ✅ Commented out (not deleted) 12 sections: starting_points, shared_public_trips, itinerary, featured_cities, featured_plans, pathways, story_video, editorial_features, updates, keep_in_touch, marketing_cta, faq
  7. ✅ Re-enabled trip_plan section — CTA href updated from /trips/planner to /trips/new
  8. ✅ Each commented section has a pointer comment showing where the component still lives
  9. ✅ No components deleted — all still importable and editable
H2Notes for Later
  • Dual poster/grid view concept should be applied per card as a passive scrolling effect, and integrated as a standard for listing trips except for trips/public/dashboard's first trip grid.
  • When the same image is used multiple times per page load, load once and use cached instance for all other occurrences (browser HTTP cache + shared <img> ref or Next.js <Image> with same src already dedupes, but verify no duplicate network requests).
H2Done — Experiences Page Streamlined
  1. ✅ Removed negative margin (-179px) that was pulling content off-screen
  2. ✅ Hero updated: subtitle focused on direct booking, CTA scrolls to #experiences_featured
  3. ✅ Featured Experiences moved to top position (order 0) — city highlight tours with FareHarbor booking widgets
  4. ✅ How It Works simplified to 3 steps: Choose city → Book online → Show up
  5. ✅ Featured Cities kept for visual destination reference
  6. ✅ Hidden (not deleted): Pathways, Featured Trips, Keep In Touch sections
  7. ✅ Final CTA tightened: "Ready to Explore?" with 3 action buttons
  8. ✅ No components deleted — all still importable
H2Done — Global Command Dock
  1. ✅ Built GlobalCommandDock.tsx with 3 groups of 7 buttons, route-aware nav/actions/tools
  2. ✅ Added dock to app/trips/layout.tsx, app/experiences/layout.tsx, app/(trips)/layout.tsx
  3. ✅ Removed ExperienceEditDock from experiences pages (file preserved)
  4. ✅ Created GlobalCommandDock.actions.ts with thread persistence (AssistantThread/AssistantMessage) and AI coaching mode
  5. ✅ Built floating "script page" response notes above dock with print-in animation
  6. ✅ Manual notes create ProjectDocument (type: "note") in user's default project — mirrors docs sidebar ChatPanel flow
  7. ✅ Saved notes show "Open" link to /documents/{publicId}
  8. ✅ Cycle button closes after full group cycle; auto-opens note panel on last cycle
  9. ✅ Items only render when open is true to prevent centering drift
  10. ✅ Outside click closes both dock and note panel
  11. ✅ Dismiss button (×) on each floating AI message
  12. ✅ Copy button on each AI response message
  13. ✅ Share cancellation handled silently (no AbortError spam)
  14. ✅ Floating messages pushed up to avoid overlap with note panel
  15. ✅ Persona chooser overlay (Maestro, General, Developer, Writer)
  16. ✅ Note panel mode toggle: Note | AI
  17. ✅ AI responses use selected persona system prompt
  18. ✅ Spring physics animations throughout
  19. ✅ Panel indicator dots below dock
H2Done — Layout Fixes
  1. ✅ Fixed /trips hero cropping: removed -147px negative margin
  2. ✅ Moved trips/public/page.tsx content to app/trips/page.tsx; old route redirects
  3. ✅ Added EditorialHeader to app/spaces/(spaces)/layout.tsx
  4. ✅ Widened spaces containers: max-w-7xlmax-w-[1600px]
H2Done — Profile Error Fix
  1. ✅ Fixed User not found runtime error on /profile when session user doesn't exist in DB
  2. getProfileData() now returns null instead of throwing; page gracefully redirects to sign-in
  3. profile-client.tsx handles null profile with fallback UI
H2Done — Auth Fix (Google OAuth User Linking)
  1. ✅ Fixed Foreign key constraint violated errors caused by Google OAuth users missing local DB records
  2. signIn callback now links Google accounts by email to existing local User records
  3. ✅ If no local user exists for Google email, auto-creates one with role "USER"
  4. ✅ No Prisma schema changes — uses existing User table
H2Done — AI Context Awareness & Agent Tools
  1. ✅ Privacy-first page context: AI only sees screen content when user toggles 🔒 → 🌐
  2. ✅ DOM scraper extracts only visible public content (no inputs, no hidden data)
  3. ✅ On-demand entity tools: AI can list user's trips/experiences/docs by title only
  4. ✅ Agent routing tools: navigate_to, scroll_to_section, open_note_panel, share_page, create_trip_draft
  5. ✅ AI executes tools and confirms actions in chat
  6. ✅ Default locked: AI receives zero context until user explicitly shares screen
H2Next Action

Test dock on staging: verify AI agent routing, context awareness toggle, tool execution, and privacy lock behavior.


H2Beta — New Surfaces (Installed May 2026)
H3Status: 🟡 Pending production revision

These pages are built and routed. Content, tone, and layout are at beta quality and will need a human polish pass before production.

H3New pages created
PageRouteFilePattern
Profile/profileapp/profile/page.tsx + profile-client.tsx + actions.tsServer component → client component → server actions
Admin overview/adminapp/admin/page.tsxServer component with card grid
Admin layout/admin/*app/admin/layout.tsxServer component with auth guard + sidebar nav
User management/admin/usersapp/admin/users/page.tsxClient component using existing user actions
Professionals/trips/professionalsapp/trips/professionals/page.tsxServer component (static marketing page)
Marketing/marketingapp/marketing/page.tsxServer component (static page)
Story/storyapp/story/page.tsxServer component (editorial narrative page)
H3Architecture notes
  • All pages follow the established pattern: server component orchestrator, client component for interactivity, server actions for mutations
  • Profile uses co-located actions (app/profile/actions.ts) for password management and profile updates
  • Admin/users page reuses existing user actions from @/app/users/actions/user
  • Trips/professionals inherits the trips layout (TravelSymbolHeader + EditModeProvider)
  • Marketing and story pages use the root layout
  • Design system: Tailwind v4 tokens (--neutral-*), shadcn/ui conventions, editorial tone matching existing trips pages
  • Berlin communication style: direct, simple, honest. No hype, no emoji in content.
H3Pages intentionally NOT modified

Existing pages were left untouched (non-destructive):

  • /trips/featured — already exists, functional
  • /trips/new — already exists, functional
  • /trips/[tripId] — already exists, functional
  • /trips/[tripId]/schedule — already exists, functional
  • /dashboard — already exists, functional (in (dashboard) route group)
  • /about — already exists, functional (in (home) route group)
H3Role model alignment

New pages use the extended role set (ADMIN, ORGANISER, COLLABORATOR, PROVIDER, USER, GUEST) and display the appropriate role-aware UI:

  • Profile page shows role badge and role-specific dashboard link
  • Admin layout protects all /admin/* routes
  • Admin/users page allows role assignment from the full set

Pending: deeper workspace routing per role at /dashboard.