Skip to content

QF-2514: Navigation redesign #2436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: testing
Choose a base branch
from
Open

QF-2514: Navigation redesign #2436

wants to merge 15 commits into from

Conversation

AhmedCodeGuy
Copy link
Collaborator

@AhmedCodeGuy AhmedCodeGuy commented Jun 11, 2025

Summary

Closes: QF-2514

  • refactor: reorganize ContextMenu component with improved structure and accessibility
  • feat: add reading and translation mode icons in solid and outline variants
  • refactor: redesign reading preference switcher UI with improved icons and transitions
  • feat: add page bookmark functionality to Quran reader context menu
  • feat: add page bookmarking functionality with local storage support for logged-out users
  • feat: add mobile reading preference tabs with improved UI layout
  • feat: redesign context menu with new progress bar and improved styling
  • fix: sidebar navigation positioning for home page and quran reader on all devices

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Test plan

The changes was tested on home page and the Quran reader for responsiveness.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link

vercel bot commented Jun 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
quran-com ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 15, 2025 4:32am

@osamasayed
Copy link
Member

bugbot run

@osamasayed osamasayed requested a review from Copilot June 11, 2025 19:43
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the Quran reader’s navigation and context menu components while introducing new features such as improved reading preference switching, page bookmarking, and mobile reading tabs. Key changes include a reorganization of the ContextMenu component with enhanced accessibility and styling, new icons and UI adjustments for the reading preference switcher, and added functionality for bookmarking pages.

Reviewed Changes

Copilot reviewed 37 out of 37 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/components/QuranReader/ReadingPreferenceSwitcher/ReadingPreferenceSwitcher.module.scss Updated width definitions and introduced new CSS variables for context menu variants.
src/components/QuranReader/ReadingPreferenceSwitcher/ReadingPreferenceOption.tsx Renamed the component and revised its loading state logic along with enhanced JSDoc comments.
src/components/QuranReader/ReadingPreferenceSwitcher/ReadingPreferenceIcon.tsx New component to encapsulate reading preference icon rendering.
src/components/QuranReader/ReadingPreferenceSwitcher/ReadingPreference.module.scss Added new theme-based styling rules and transitions.
src/components/QuranReader/QuranReaderView.tsx Updated usage of the ReadingPreferenceSwitcher via a new type prop.
src/components/QuranReader/ContextMenu/* Introduced refactored components with improved layout, theming, and mobile responsiveness, including progress tracking, mobile tabs, bookmark actions, and chapter navigation.
locales/en/* Updated textual content and fixed duplicate keys in translations.
Comments suppressed due to low confidence (1)

src/components/QuranReader/ReadingPreferenceSwitcher/ReadingPreferenceOption.tsx:44

  • The loading condition has been simplified to always render the spinner when isLoading is true, removing the check for whether readingPreference equals selectedReadingPreference. Please verify that this behavior change is intentional and will not cause unintended UI behavior.
return isLoading ? (

cursor-com[bot]

This comment was marked as resolved.

…gTabs.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@osamasayed

This comment was marked as resolved.

@AhmedCodeGuy
Copy link
Collaborator Author

@osamasayed resolved all bot reported bugs.

Copy link
Member

@osamasayed osamasayed left a comment

Choose a reason for hiding this comment

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

Screenshot 2025-06-15 at 10 11 33 am

After merging master, the expanded states on mobile looks too streteched with a lot of white space at the top.

@@ -1,3 +1,12 @@
/**
Copy link
Member

Choose a reason for hiding this comment

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

let's remove this file if we don't need it.

} = usePersistPreferenceGroup();

// Extract verse number from the last read verse key
const lastReadVerse = lastReadVerseKey.verseKey?.split(':')[1];
Copy link
Member

Choose a reason for hiding this comment

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

We have a util called getVerseNumberFromKey which we should use instead.

@@ -5,7 +5,7 @@ import classNames from 'classnames';
import useTranslation from 'next-translate/useTranslation';
import { shallowEqual, useSelector } from 'react-redux';

import ContextMenu from './ContextMenu';
import ContextMenu from './ContextMenu/index';
Copy link
Member

Choose a reason for hiding this comment

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

nit-picking: no need for index in the path as it will be resolved automatically.

};

let bookmarkIcon = <Spinner />;
if (!isPageBookmarkedLoading) {
Copy link
Member

Choose a reason for hiding this comment

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

It seems requested don't get cached in the browser using useSWR on scroll so fresh requests to check if the page is bookmarked keep being fired every time. You should open Albqarah while logged in and scroll up and down to reproduce.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I already have this on my backlog, I will work on it insha'Allah, I forgot to convert this PR to Draft instead of ready for review.

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