Skip to content

feat: resolve open issues #16, #17, #18, and #19 - #28

Merged
Hanu2908 merged 1 commit into
mainfrom
feat/resolve-issues-16-17-18-19
Aug 30, 2026
Merged

feat: resolve open issues #16, #17, #18, and #19#28
Hanu2908 merged 1 commit into
mainfrom
feat/resolve-issues-16-17-18-19

Conversation

@choudharyms

Copy link
Copy Markdown
Collaborator

Summary of Changes

This PR resolves four open repository issues (#16, #17, #18, #19) adhering strictly to repository architecture, accessibility rules, zero-PII security guidelines, and test suites.


1. Issue #16: PDF Viewer Keyboard Navigation Shortcuts

  • Added global keyboard listener in \src/pages/app/PDFViewerPage.tsx:
    • \ArrowRight\ / \ArrowDown: Next page (\goToNextPage())
    • \ArrowLeft\ / \ArrowUp: Previous page (\goToPrevPage())
    • \Escape: Back to previous screen (
      avigate(-1))
  • Guarded shortcuts against active inputs (<input>, <textarea>, <select>, \isContentEditable) so typing inside forms/search bars is not intercepted.
  • Added unit tests in \ ests/unit/components.test.tsx.

2. Issue #17: Resilient Clipboard Copy Utility & Roll Number Actions

  • Created \src/lib/utils/clipboard.ts\ with \copyToClipboard()\ providing
    avigator.clipboard.writeText\ with an invisible off-screen <textarea>\ fallback to \document.execCommand('copy')\ for non-secure / restricted webview environments.
  • Created reusable and accessible \src/components/CopyButton.tsx\ (\�ria-label, tooltip, checkmark transition).
  • Added 1-tap copy buttons to class roll number, university roll number, hub code, and phone numbers in \ProfilePage.tsx\ and \SectionDirectoryPage.tsx.
  • Added unit tests in \ ests/unit/clipboard.test.ts.

3. Issue #18: Comment Length Validation Schema & Real-Time Counter

  • Exported \MAX_COMMENT_LENGTH = 500\ and Zod \commentSchema\ in \src/lib/validation/comments.schema.ts.
  • Integrated real-time remaining length counter ({inputVal.length}/{MAX_COMMENT_LENGTH}) and submit disabling in \AnnouncementCommentsDrawer.tsx.
  • Pre-validates submissions before mutating state.
  • Added boundary tests (0, 1, 500, 501 chars) in \ ests/unit/commentsCrud.test.ts.

4. Issue #19: Deterministic Local Development Seed Script

  • Created deterministic mock dataset in \supabase/seed.sql\ for Section P2 with core engineering subjects, weekly schedule slots, attendance logs, announcements, and Q&A threads using static UUIDs and zero PII.
  • Documented local Supabase CLI setup (\supabase start, \supabase db reset) in \CONTRIBUTING.md\ and \docs/backend.md.

Verification & Testing

  • Unit & Integration Tests: 245/245 tests passed across 27 suites (\�itest --run).
  • ESLint: 0 errors.
  • Production Build: Built cleanly with Vite and TypeScript compiler.

Closes #16, Closes #17, Closes #18, Closes #19

- #16: add PDF viewer keyboard shortcuts (Arrow keys and Escape) with input focus guard
- #17: add resilient copyToClipboard utility, accessible CopyButton, and roll number copy actions
- #18: derive comment length validation from Zod schema with real-time character counters
- #19: add deterministic Section P2 seed script and local Supabase CLI documentation

Closes #16, Closes #17, Closes #18, Closes #19
@choudharyms
choudharyms requested a review from Hanu2908 as a code owner August 29, 2026 14:01
@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
class-hub Ready Ready Preview Aug 29, 2026 2:02pm

@Hanu2908
Hanu2908 merged commit 4415014 into main Aug 30, 2026
4 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

2 participants