Skip to content

Enhance Terms of Service Page - Better Navigation & Readability#339

Open
ArshiBansal wants to merge 3 commits into
vishnukothakapu:mainfrom
ArshiBansal:Term_Services
Open

Enhance Terms of Service Page - Better Navigation & Readability#339
ArshiBansal wants to merge 3 commits into
vishnukothakapu:mainfrom
ArshiBansal:Term_Services

Conversation

@ArshiBansal

@ArshiBansal ArshiBansal commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Description

Improved the Terms of Service page (app/terms/page.tsx) by adding modern documentation features for better user experience.

Key Improvements

  • Added fixed Reading Progress Bar at the top
  • Implemented Sticky Table of Contents (desktop) with active section highlighting using Intersection Observer
  • Enhanced Typography & Spacing – larger headings, better line height, and improved scannability
  • Added Floating Back to Top button
  • Improved visual hierarchy, list styling, InfoCards, and section separation
  • Added smooth scrolling and proper anchor links
  • Maintained existing violet theme and dark mode consistency

Technical Changes

  • Converted page to 'use client' for interactive scroll features
  • Refactored component structure and styling
  • Enhanced accessibility and responsiveness

Checklist

  • Tested on desktop and mobile
  • Progress bar and TOC work smoothly
  • Dark mode fully supported
  • No console errors
  • Follows project code style

Closes #333

Summary by CodeRabbit

  • New Features
    • Added a reading progress bar to the Terms of Service page
    • Introduced a sticky “On this page” table of contents with active section highlighting
    • Added a “Back to top” button that appears while scrolling and returns smoothly to the top
    • Redesigned the Terms page layout for improved two-column readability on larger screens

@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

@ArshiBansal is attempting to deploy a commit to the vishnukothakapu's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9bb9bfe6-3014-4f54-a196-8efa4f9255b6

📥 Commits

Reviewing files that changed from the base of the PR and between 66c6c2a and 2c0480e.

📒 Files selected for processing (1)
  • app/terms/page.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/terms/page.tsx

📝 Walkthrough

Walkthrough

The Terms of Service page is converted from a static server component to a client component. A reading progress bar, IntersectionObserver-based active section tracking, and a floating "Back to top" button are added. The layout changes from a single content column to a two-column design with a sticky TOC on large screens.

Changes

Interactive Terms of Service Page

Layer / File(s) Summary
Client directive, imports, and TOC data
app/terms/page.tsx
Adds "use client", imports React hooks (useState, useEffect) and the ArrowUp icon, defines sectionClass shared Tailwind string, updates InfoCard padding and heading spacing constants, and declares tocItems (10 entries with id/label pairs) used by both the TOC and section id attributes.
Scroll state, IntersectionObserver, and progress bar
app/terms/page.tsx
Introduces progress, activeSection, and showBackToTop state variables. A scroll listener computes bar width and the back-to-top visibility threshold. An IntersectionObserver watches each section element and updates activeSection as the user scrolls. A scrollToTop helper triggers smooth scroll. The fixed-top progress bar JSX is rendered from progress.
Two-column layout, section content, sticky TOC, and back-to-top button
app/terms/page.tsx
Reorganizes the page into a main article area with all 10 terms sections carrying matching id attributes, and a right-side sticky "On this page" TOC that highlights the active link via activeSection. A conditional floating ArrowUp button is rendered and calls scrollToTop.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

  • #333 – [FEAT] Enhance Terms of Service Page UX with Navigation, Readability, and Accessibility Improvements: This PR directly implements all acceptance criteria from the issue: sticky TOC, reading progress bar, back-to-top button, section anchor IDs, two-column layout, and improved visual hierarchy.

Possibly related PRs

  • vishnukothakapu/linkid#184: Modifies the same app/terms/page.tsx with the initial static Terms content that this PR extends with client-side navigation and scroll features.
  • vishnukothakapu/linkid#214: Also restructures app/terms/page.tsx around sectionClass and consistent section ids, directly overlapping with this PR's layout approach.

Suggested labels

type:feature, type:design, quality:exceptional

Suggested reviewers

  • Anushreebasics

🐇 A progress bar blooms at the top of the page,
Ten sections now gleam with their own anchor stage.
The TOC glows bright as you scroll through each clause,
A back-to-top arrow defies gravity's laws.
Hops through legalese — oh, what readable days! 🌸

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main changes: enhancing the Terms of Service page with better navigation and readability features.
Linked Issues check ✅ Passed The PR implementation meets all major acceptance criteria from issue #333: page header, sticky TOC with active section tracking, improved visual hierarchy, reading progress bar, back-to-top button, and responsive layout.
Out of Scope Changes check ✅ Passed All changes are directly related to enhancing the Terms of Service page as specified in issue #333; no unrelated modifications detected beyond the stated objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Stopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a @coderabbit review after the pipeline has finished.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
app/terms/page.tsx (1)

85-86: ⚡ Quick win

Use a passive scroll listener for smoother scrolling.

Line 85 attaches a high-frequency scroll handler without { passive: true }, which can hurt scrolling performance on slower devices.

Suggested fix
-    window.addEventListener("scroll", handleScroll);
-    return () => window.removeEventListener("scroll", handleScroll);
+    window.addEventListener("scroll", handleScroll, { passive: true });
+    return () => window.removeEventListener("scroll", handleScroll);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/terms/page.tsx` around lines 85 - 86, The scroll event listener attached
with addEventListener for the handleScroll function is missing the passive
option, which can degrade scrolling performance on slower devices. Modify both
the addEventListener call and the corresponding removeEventListener call in the
cleanup function to include { passive: true } as the options object (third
parameter), which tells the browser the handler won't call preventDefault and
allows for smoother scrolling performance.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/terms/page.tsx`:
- Around line 168-169: Replace unescaped double quote characters `"` with their
HTML entity equivalent `"` in the JSX text content to resolve the
react/no-unescaped-entities lint errors. In app/terms/page.tsx at lines 168-169
(the location in the Welcome to LinkID text), escape the quote characters in the
JSX text. Also apply the same fix at line 391 where unescaped quotes appear in
JSX text content. Ensure all quote characters within JSX text nodes are properly
escaped using HTML entities.
- Around line 78-82: The progress calculation at lines 78-82 does not guard
against the case where totalHeight is zero or negative, which causes the
progressPercentage calculation to produce NaN or Infinity values. Add a guard
condition to check that totalHeight is greater than 0 before calculating
progressPercentage. If totalHeight is not positive (indicating the page is not
scrollable), set progress to 0 directly to avoid passing invalid values to
setProgress.
- Line 2: The file marks itself as a Client Component with the "use client"
directive at the top, but also exports metadata at lines 11-15, which is a
server-only export in the App Router. Remove the "use client" directive to
convert this file back to a Server Component so that the metadata export becomes
valid. If client-side features are required in this page, create a separate
client component for the interactive parts and import it into this server
component, keeping the metadata export in the server component.

---

Nitpick comments:
In `@app/terms/page.tsx`:
- Around line 85-86: The scroll event listener attached with addEventListener
for the handleScroll function is missing the passive option, which can degrade
scrolling performance on slower devices. Modify both the addEventListener call
and the corresponding removeEventListener call in the cleanup function to
include { passive: true } as the options object (third parameter), which tells
the browser the handler won't call preventDefault and allows for smoother
scrolling performance.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f8315b60-0257-4eab-84ba-df6081b90a0e

📥 Commits

Reviewing files that changed from the base of the PR and between d5f39af and 66c6c2a.

📒 Files selected for processing (1)
  • app/terms/page.tsx

Comment thread app/terms/page.tsx
Comment thread app/terms/page.tsx
Comment thread app/terms/page.tsx Outdated
@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
linkid Error Error Jun 17, 2026 4:57pm

@vishnukothakapu

Copy link
Copy Markdown
Owner

Hi @ArshiBansal ,

The build is currently failing because app/terms/page.tsx is marked as a Client Component ("use client"), while it also exports metadata.

In Next.js App Router, metadata can only be exported from Server Components. Please either:

  • Remove the "use client" directive if it's not needed, or
  • Move the client-side logic into a separate component and keep page.tsx as a Server Component that exports metadata.

Please fix the build issue and push the changes. Thanks!

@Anushreebasics Anushreebasics left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls apply bot's code suggestions and resolve deployment errors

@ArshiBansal

Copy link
Copy Markdown
Contributor Author

@vishnukothakapu @Anushreebasics looking into the issues

@ArshiBansal

Copy link
Copy Markdown
Contributor Author

@vishnukothakapu my code doesnot use "Use client" directive. already follows server component

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Enhance Terms of Service Page UX with Navigation, Readability, and Accessibility Improvements

3 participants