....docs #26
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the documentation page to use a shared DocumentationContent component, updates docs navigation behavior in the sidebar, and adds a docs entrypoint within the dashboard UI.
Changes:
- Replace the
/docspage’s inline content with a reusableDocumentationContentcomponent. - Update docs sidebar “active section” tracking to use a scroll listener instead of
IntersectionObserver. - Add a dashboard docs page and navigation link; update app metadata (title/icons).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/components/docs/Sidebar.tsx | Switches active-section detection to scroll-based logic for the docs sidebar. |
| frontend/components/docs/DocumentationContent.tsx | Introduces the shared documentation content component used across routes. |
| frontend/components/dashboard/LogoutButton.tsx | Changes post-logout redirect target. |
| frontend/app/layout.tsx | Updates metadata title and adds icon metadata entries. |
| frontend/app/docs/page.tsx | Replaces the docs page body with DocumentationContent and new wrapper markup. |
| frontend/app/dashboard/layout.tsx | Adds a “Documentation” link in the dashboard header. |
| frontend/app/dashboard/docs/page.tsx | Adds a dashboard-scoped docs page rendering DocumentationContent. |
Comments suppressed due to low confidence (1)
frontend/app/layout.tsx:28
SearchModalis imported but not used inRootLayout. Please remove the unused import (or render the modal) to avoid lint/build failures.
};
import { SearchModal } from "@/components/ui/SearchModal";
import Footer from "@/components/Footer";
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Run once on mount | ||
| setTimeout(handleScroll, 200); | ||
|
|
||
| return () => observer.disconnect(); | ||
| // Attach to scroll listener | ||
| window.addEventListener('scroll', handleScroll, { passive: true }); | ||
|
|
||
| return () => { | ||
| window.removeEventListener('scroll', handleScroll); | ||
| }; |
There was a problem hiding this comment.
The setTimeout(handleScroll, 200) is never cleared. If the sidebar unmounts quickly (route change), handleScroll can still run and call setActiveId after unmount. Store the timeout id and clearTimeout it in the cleanup, or call handleScroll() synchronously/with requestAnimationFrame instead of setTimeout.
| "compile_output": null | ||
| }`; | ||
| import DocumentationContent from '@/components/docs/DocumentationContent'; | ||
| import Link from 'next/link'; |
There was a problem hiding this comment.
Link is imported but never used in this page. Please remove the unused import to avoid lint/build failures.
| import Link from 'next/link'; |
| <main className="flex-1 w-full max-w-4xl mx-auto py-12 px-6"> | ||
| <DocumentationContent /> | ||
| </main> |
There was a problem hiding this comment.
This page renders a <main> element, but frontend/app/docs/layout.tsx already wraps children in <main>. Nesting <main> elements is invalid HTML and can confuse assistive technologies. Use a <div> here (or remove the extra wrapper) and let the layout own the single <main> landmark.
| <main className="flex-1 w-full max-w-4xl mx-auto py-12 px-6"> | |
| <DocumentationContent /> | |
| </main> | |
| <div className="flex-1 w-full max-w-4xl mx-auto py-12 px-6"> | |
| <DocumentationContent /> | |
| </div> |
| export const metadata: Metadata = { | ||
| title: "Velox | High-Performance Code Execution", | ||
| title: "Velox Engine", | ||
| description: "A distributed, high-performance Online Code Judger and Remote Code Execution Engine built for developers.", |
There was a problem hiding this comment.
Spelling: the metadata description says "Online Code Judger"; this should be "Online Code Judge".
| description: "A distributed, high-performance Online Code Judger and Remote Code Execution Engine built for developers.", | |
| description: "A distributed, high-performance Online Code Judge and Remote Code Execution Engine built for developers.", |
| // Clear the authentication token | ||
| localStorage.removeItem('token'); | ||
| // Redirect to the login page |
There was a problem hiding this comment.
Logout is clearing localStorage.removeItem('token'), but the rest of the app uses velox_token (e.g., login sets velox_token and API interceptors read/remove it). As-is, clicking logout likely leaves the user authenticated. Update this to remove the correct key (and consider also updating the comment that still says it redirects to the login page).
| // Clear the authentication token | |
| localStorage.removeItem('token'); | |
| // Redirect to the login page | |
| // Clear the authentication token used by the app | |
| localStorage.removeItem('velox_token'); | |
| // Redirect to the home page |
No description provided.