Skip to content

Feature/chapter UI improvements reopen#354

Open
pisum-sativum wants to merge 5 commits into
MRIARC-08:mainfrom
pisum-sativum:feature/chapter-ui-improvements-reopen
Open

Feature/chapter UI improvements reopen#354
pisum-sativum wants to merge 5 commits into
MRIARC-08:mainfrom
pisum-sativum:feature/chapter-ui-improvements-reopen

Conversation

@pisum-sativum

Copy link
Copy Markdown
Contributor

Improve chapter page UI and navigation

Fixes #75

Description

This PR addresses the visual and UX improvements needed for the chapter detail page as outlined in issue #75. The NcertChapterPage and ChapterContent components were refactored to provide better navigation and readability for chapter content.

Changes Made

  • Breadcrumb Navigation: Added a sticky header navigation (Class > Subject > Chapter N) at the top of the chapter page.
  • Layout Adjustments: Refactored the ChapterContent layout to a responsive 2-column design (3/4 main content, 1/4 sidebar) on desktop, which collapses to a full-width layout on mobile.
  • Table of Contents (TOC): Created a dynamic Table of Contents in the sidebar that parses the chapter's markdown content and generates clickable anchor links for all h1, h2, and h3 headings.
  • Prev & Next Navigation: Implemented Previous & Next chapter links at the bottom of the main content area, mapping adjacent chapters dynamically.
  • Estimated Reading Time: Computed the reading duration based on word count (~200 WPM) and displayed it in the chapter header.
  • Sidebar Elements: Rendered buttons for "Take Chapter Quiz" and "My Notes" within the sidebar actions block.
  • Data Fetching: Updated data fetching in NcertChapterPage using Promise.all to retrieve both the current chapter details and the parent subject's chapter list simultaneously. Included Prisma modifications in ncert.repository.ts to attach related topics.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • UI/UX improvement

@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

@pisum-sativum is attempting to deploy a commit to the Adarsh's projects Team on Vercel.

A member of the Team first needs to authorize it.

@MRIARC-08 MRIARC-08 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@pisum-sativum This PR is not isolated to issue #75. It contains the full quiz-attempt implementation from #194 and the renderer-key change from #353, which is already merged, alongside the chapter UI. Please recreate or rebase the branch from current main with only the chapter UI/navigation work. The chapter portion should avoid placeholder href="#" and non-functional action buttons, and the focused lint run currently reports 63 errors that must be cleaned before re-review.

@pisum-sativum pisum-sativum force-pushed the feature/chapter-ui-improvements-reopen branch from 97f2965 to ec9bb05 Compare June 14, 2026 22:01
@MRIARC-08

Copy link
Copy Markdown
Owner

@pisum-sativum I rechecked this branch. It still includes unrelated changes outside the chapter UI/navigation work, including auth, dashboard, notes, quiz, bookmark, recommendation, package, lockfile, and workspace files. Please recreate/rebase from current main and keep only the chapter UI/navigation changes for issue #75. The current branch is too broad to merge safely.

@pisum-sativum pisum-sativum force-pushed the feature/chapter-ui-improvements-reopen branch from 2e28573 to aa1bcb4 Compare June 18, 2026 20:25
@pisum-sativum pisum-sativum force-pushed the feature/chapter-ui-improvements-reopen branch from aa1bcb4 to 60b4868 Compare June 18, 2026 20:34

@MRIARC-08 MRIARC-08 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@pisum-sativum This is now properly scoped to the chapter page UI, which is good progress. It still needs a small cleanup pass before merge.

Remaining blockers:

  • Focused lint on the touched files still reports 8 Prettier errors in src/app/ncert/[class]/[subject]/[chapter]/page.tsx.

  • The TOC slug generation in ChapterContent does not match the IDs generated by MarkdownViewer. MarkdownViewer removes punctuation and collapses dashes, while the TOC currently uses a different replacement pattern, so headings with punctuation can produce broken links.

  • Please reuse the same slug helper behavior as MarkdownViewer or move it to a shared helper so the TOC links and rendered heading IDs stay in sync.After that, rerun focused lint on the two touched files.

@pisum-sativum

Copy link
Copy Markdown
Contributor Author

@pisum-sativum This is now properly scoped to the chapter page UI, which is good progress. It still needs a small cleanup pass before merge.

Remaining blockers:

  • Focused lint on the touched files still reports 8 Prettier errors in src/app/ncert/[class]/[subject]/[chapter]/page.tsx.
  • The TOC slug generation in ChapterContent does not match the IDs generated by MarkdownViewer. MarkdownViewer removes punctuation and collapses dashes, while the TOC currently uses a different replacement pattern, so headings with punctuation can produce broken links.
  • Please reuse the same slug helper behavior as MarkdownViewer or move it to a shared helper so the TOC links and rendered heading IDs stay in sync.After that, rerun focused lint on the two touched files.

@MRIARC-08 I have done the necessary changes and kindly check and merge.

@MRIARC-08 MRIARC-08 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@pisum-sativum The formatting and TOC ID direction are much better now, and the local checks pass, but current main changed the NCERT chapter API contract.

Local checks:

  • Focused ESLint on the touched chapter files passes with only the existing Markdown image warning.
  • pnpm exec tsc --noEmit passes.
  • pnpm test passes: 8 files / 35 tests.

Remaining blocker: the PR still fetches the chapter with only:
/api/ncert/chapter?chapter=${params.chapter}

Current main now requires the parent class and subject context for this endpoint. Please include class/subject (or classId/subjectId) in the chapter fetch the same way the chapters fetch already does.

After that, this will still need manual UI review because it changes the chapter reading layout/navigation.

@MRIARC-08 MRIARC-08 added gssoc gssoc level:intermediate GSSoC difficulty: intermediate type:design Design or UI related contribution labels Jun 25, 2026
@pisum-sativum

Copy link
Copy Markdown
Contributor Author

@pisum-sativum The formatting and TOC ID direction are much better now, and the local checks pass, but current main changed the NCERT chapter API contract.

Local checks:

  • Focused ESLint on the touched chapter files passes with only the existing Markdown image warning.
  • pnpm exec tsc --noEmit passes.
  • pnpm test passes: 8 files / 35 tests.

Remaining blocker: the PR still fetches the chapter with only: /api/ncert/chapter?chapter=${params.chapter}

Current main now requires the parent class and subject context for this endpoint. Please include class/subject (or classId/subjectId) in the chapter fetch the same way the chapters fetch already does.

After that, this will still need manual UI review because it changes the chapter reading layout/navigation.

@MRIARC-08 I have done the necessary changes kindly check and merge.

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

Labels

gssoc gssoc level:intermediate GSSoC difficulty: intermediate type:design Design or UI related contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve chapter page UI and navigation

2 participants