Skip to content

feat: implement playing ta'awwudh and basmalah for Surah and Ayah playback - #3281

Open
chabandou wants to merge 1 commit into
quran:productionfrom
chabandou:feature/audio-intros
Open

feat: implement playing ta'awwudh and basmalah for Surah and Ayah playback#3281
chabandou wants to merge 1 commit into
quran:productionfrom
chabandou:feature/audio-intros

Conversation

@chabandou

@chabandou chabandou commented Apr 11, 2026

Copy link
Copy Markdown

Summary

Saying Taʿawwudh (أعوذ بالله من الشيطان الرجيم) is Obligatory (wājib) according to many Muslim scholars
This is based directly on the Qur’an:
“So when you recite the Qur’an, seek refuge in Allah from Shayṭān, the expelled.”
— Surah An-Nahl (16:98)

This PR implements a feature where the Taʿawwudh and Basmalah are played before the recitation of a full Surah starts and Taʿawwudh only when a recitation of a single Ayah starts. May Allah accept this humble contribution.

Closes: QF-XXXX

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)

Rollback Safety

  • Can be safely reverted without data issues or migrations

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed

Testing steps:

  1. Open a chapter page,
  2. Click on any audio play button (for Surah or Ayah)

Edge Cases Verified

  • ⏳ Loading state handled (I don't think it's needed but open to adding it if so.)
  • ❌ Error state handled
  • 📭 Empty state handled
  • 👤 Logged-in vs guest behavior (if applicable)

Pre-Review Checklist

Code Quality

  • I have performed a self-review of my code (file by file)
  • My code follows the project style guidelines - couldn't find this.
  • [X ] No any types used (or justified if unavoidable)
  • No unused code, imports, or dead code included
  • Complex logic has inline comments explaining "why"
  • Functions are under 30 lines and follow single responsibility

Testing & Validation

  • All tests pass locally (yarn test)
  • Linting passes (yarn lint)
  • Build succeeds (yarn build)
  • Edge cases and error scenarios are handled

Documentation

  • Code is self-documenting with clear naming
  • README updated (if adding features or setup changes)
  • Inline comments added for complex logic

AI Assistance Disclosure

  • AI tools were NOT used for this PR
  • AI tools were used, and I have thoroughly reviewed and validated all generated code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d15e200d2d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

onError: '#audioPlayer.VISIBLE.LOADING_CUSTOM_RECITER_DATA',
},
on: {
END: '#audioPlayer.VISIBLE.LOADING_CUSTOM_RECITER_DATA',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve reciter payload before entering custom loading state

This transition now enters LOADING_CUSTOM_RECITER_DATA from an END event emitted after intro playback, but fetchCustomReciter reads event.surah and event.reciterId. END (and PAUSE) do not carry those fields, so custom-reciter flows lose the selected reciter/chapter context and can issue invalid fetches (e.g. reciter/chapter becoming undefined) after intro audio completes. Please persist the needed custom-reciter parameters in context before intro playback (or transition with an event that still includes them) before invoking fetchCustomReciter.

Useful? React with 👍 / 👎.

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.

1 participant