Skip to content

Conversation

@horacioh
Copy link
Collaborator

Summary

Fixed four critical issues in resource page panel & comment system:

  • Right panel scrollability: Added h-full to panel flex container so content scrolls properly when long
  • Tab navigation preserving panel: Modified DocumentTools to always carry current panel across route changes
  • Comment replies in main section: Implemented three-way routing logic so replies navigate correctly whether comment is in panel, main view, or different document
  • Comments panel performance: Added staleTime to comment queries and removed debug console.logs to prevent N+1 RPC calls
  • CommentEditor React hooks warning: Moved useRef before conditional return to satisfy React hooks rules

All changes tested and type checking passes.

🤖 Generated with Claude Code

ericvicenti and others added 30 commits February 9, 2026 18:14
- Create resource-page-common.tsx with unified rendering logic
- ResourcePage takes only docId, calls useResource() internally
- SiteHeader renders even on error states (not-found, tombstone, etc)
- Desktop uses desktop-resource.tsx wrapper
- Web routes wrap ResourcePage with WebSiteProvider
- Backup legacy files as *-legacy-document.tsx

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace JS measurement for Feed text with CSS media queries (hidden lg:inline)
- Add WebResourcePage wrapper for web-specific HypermediaHostBanner
- Show banner when viewing content from different site than host

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Prefetch was using docId with version=null, but returned id had
  document.version - query keys didn't match so useResource couldn't
  find hydrated data
- Create finalId with document.version before prefetching
- Remove initialDocument prop hack from ResourcePage/WebResourcePage
- Add SSR integration tests verifying React Query hydration
- Add path aliases to vitest config for @shm/* packages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
useMedia was reading window.matchMedia during useState init on client,
causing hydration mismatch when media.gtSm differed from SSR (false).
React threw away SSR HTML and re-rendered, causing visible flash.

Fix: Always init false, update via useEffect after hydration.
Also fix useResponsiveItems to not clear items when container not ready.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add createDocumentNavRoute() utility to convert URL → NavRoute
- Add initialRoute prop to WebSiteProvider for nav context
- ResourcePage uses useNavRoute() for active view (works on both platforms)
- Add DocumentTools tab bar with content/activity/discussions/directory/collaborators
- MainContent switches view based on route key

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Uses IntersectionObserver to detect when tools scroll past viewport,
then applies sticky positioning with shadow and reduced padding.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Wrapper div broke sticky positioning. Now sentinel provides
h-3 spacing and sticky div is direct scroll area child.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- useNavigate() now uses openRoute from context (URL sync on web)
- Delete useOpenRoute() and useReplace()
- Migrate all usages to useNavigate()

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…scroll

- PageWrapper: h-dvh on desktop (element scroll), min-h-dvh on mobile (document scroll)
- DocumentBody: ScrollArea on desktop only, no wrapper on mobile
- PageLayout: remove overflow-auto to prevent double scrollbars

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- PanelLayout: shared component for main+accessory panel layout
- ResourcePage: integrates PanelLayout on desktop (mobile has no panels)
- PanelContentRenderer: renders activity/discussions/directory/collaborators in panel
- 480px minimum panel width enforcement
- Filter support for activity panel

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Directory: headerRight prop
- Collaborators: wrap in PageLayout with button
- Activity: wrap in PageLayout with button
- Discussions: fix to use docId prop instead of route

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- createDocumentNavRoute accepts panelParam to initialize route with panel
- routeToHref extracts panel key and passes to idToUrl
- idToUrl accepts panel param for ?panel= query string

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add onBlockSelect handler for copy block link
- Add block citation/comment click handlers
- Support ?panel=discussions:BLOCKID URL encoding
- Pass CommentEditor to discussions panel and page
- Works on both web and desktop platforms

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- MobileInteractionBar: bottom bar with avatar, feed, comments buttons
- MobilePanelSheet: full-screen slide-up panel for discussions
- useMobileConfig hooks for web and desktop account data
- ResourcePage shows mobile UI on small screens (both platforms)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Support ?panel=comment/ID and ?panel=discussions/BLOCKID in omnibar
- Fix search mode URL handling to preserve panel params
- Clean up unused scrollRef/showOpenInPanel in page components

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…r URL display

- Add OptionsDropdown to document page with Move, Copy Link (site+gateway), Export, Create Branch, Delete
- Replace DiscardDraftButton with OptionsDropdown in draft page
- Add breadcrumbs to document content area for non-home docs
- Omnibar: show URL instead of breadcrumbs, action buttons, route labels, consistent height
- Fix DocOptionsButton crash on non-document view routes
- Fix DocumentTools left spacer shrink behavior
- Remove duplicate OpenInPanelButton from content views
- Fix pre-existing type errors (unused imports, missing exports)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix right panel content scrollability by adding h-full to flex container
- Fix tab navigation closing right panel by preserving currentPanel across routes
- Add panel & main view support for comment replies with proper thread navigation
- Fix comments panel performance: add staleTime & remove console.logs
- Fix CommentEditor hooks-after-return violation by moving useRef before early return

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
horacioh and others added 3 commits February 10, 2026 01:47
Show collapsible section at bottom of doc content listing child docs
not referenced via Embed blocks, inline embeds, or inline links.
Query blocks targeting same doc's children count as referenced.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@horacioh horacioh merged commit d5d6741 into main Feb 10, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants