Skip to content

feat(reports): record deaf attendance separately for sign-language congregations - #5320

Open
ux-git wants to merge 2 commits into
sws2apps:mainfrom
ux-git:feat_attendance_deaf_count
Open

feat(reports): record deaf attendance separately for sign-language congregations#5320
ux-git wants to merge 2 commits into
sws2apps:mainfrom
ux-git:feat_attendance_deaf_count

Conversation

@ux-git

@ux-git ux-git commented Jul 26, 2026

Copy link
Copy Markdown
Member

Description

Sign-language congregations count attendance differently: they record both the number of deaf attendees and the total attendance (deaf + hearing). They also use the S-88 differently — the left block holds the total, the right block holds the deaf count for the same service year.

A new congregation setting Record deaf attendance separately (next to Record online meeting attendance, so it also shows up in the attendance page quick settings) enables this. When it is on:

  • the attendance record shows Deaf and Hearing inputs instead of a single field — four inputs when online recording is on as well, grouped under Present / Online captions so the labels stay short in every language;
  • the monthly history gains Total attendance (deaf) and Average attendance (deaf) rows;
  • the S-88 export switches to one page per service year with the total on the left and the deaf count on the right.

Data model

present / online keep their current meaning — the totals, deaf included. The deaf share is stored in the new optional present_deaf / online_deaf, and the hearing count is derived for the input only. That means no migration, no API contract change (the week_* objects are already encrypted as a whole), and every existing consumer — S-1 report, dashboard, yearly averages — keeps working untouched. Turning the setting off leaves the totals correct; turning it back on restores the split.

There is no second S-88 template. The export payload's years became columns, so the deaf variant is the same form at the same size with a different column caption.

Backend

The API needs to accept the new congregation setting cong_settings.attendance_deaf_record — same shape and handling as the existing attendance_online_record ([{ type, value, updatedAt, _deleted }], one entry per data view, encrypted shared on the client). If the congregation settings document uses a strict schema or an allowlist, the key must be added there, otherwise the setting is dropped on sync. Attendance data needs nothing: the deaf counts live inside the already-encrypted week_1..week_5 objects.

Drive-by

Two things came out of the work and are kept in separate commits:

  • fix(ui) — react-pdf hyphenates with English patterns by default, which rendered Total atten-dance and Average At-tendance Each Week in the S-88 header. Words below 14 characters now wrap whole; longer ones still get break points, but only at vowel-consonant boundaries, so long compounds in other languages keep fitting their cell instead of overflowing it. This applies to every exported form.
  • The per-meeting attendance math was duplicated in the S-88 export, the monthly history and the monthly summary. It is now one shared meetingAttendanceGetStats helper (net −366 lines).

Fixes #4695

Type of change

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

Testing

Verified in the running app: all four states of the attendance record (both settings off / online only / deaf only / both), desktop and mobile, light and dark theme, language-group boxes, read-only rendering for users without settings rights, and the round trip of turning the setting off after deaf counts were recorded. Both S-88 variants and the S-21 were exported and checked, including a stress test with deliberately long German strings.

Not covered: the S-140 / S-89 exports, which need imported meeting sources, and the sync round trip against the API.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
staging-organized-app Ready Ready Preview Jul 27, 2026 12:17am
test-organized-app Ready Ready Preview Jul 27, 2026 12:17am

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@ux-git, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 37 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 88553639-efd2-45d1-af31-9f3406c1c076

📥 Commits

Reviewing files that changed from the base of the PR and between 19a422c and a9287e0.

⛔ Files ignored due to path filters (2)
  • src/locales/en/congregation.json is excluded by !**/*.json
  • src/locales/en/meetings.json is excluded by !**/*.json
📒 Files selected for processing (23)
  • src/constants/table_encryption_map.ts
  • src/definition/meeting_attendance.ts
  • src/definition/settings.ts
  • src/features/congregation/settings/congregation_basic/meeting_attendance/index.tsx
  • src/features/congregation/settings/congregation_basic/meeting_attendance/useMeetingAttendance.tsx
  • src/features/congregation/settings/language_groups/group_add/useGroupAdd.tsx
  • src/features/congregation/settings/language_groups/group_delete/useGroupDelete.tsx
  • src/features/reports/meeting_attendance/export_S88/index.types.ts
  • src/features/reports/meeting_attendance/export_S88/useExportS88.tsx
  • src/features/reports/meeting_attendance/hooks/useMeetingAttendance.tsx
  • src/features/reports/meeting_attendance/monthly_history/details_row/index.types.ts
  • src/features/reports/meeting_attendance/monthly_history/details_row/useDetailsRow.tsx
  • src/features/reports/meeting_attendance/monthly_history/meeting_container/useMeetingContainer.tsx
  • src/features/reports/meeting_attendance/monthly_record/attendance_summary/useAttendanceSummary.tsx
  • src/features/reports/meeting_attendance/monthly_record/week_box/index.tsx
  • src/features/reports/meeting_attendance/monthly_record/week_box/index.types.ts
  • src/features/reports/meeting_attendance/monthly_record/week_box/useWeekBox.tsx
  • src/services/app/meeting_attendance.ts
  • src/services/dexie/schema.ts
  • src/states/settings.ts
  • src/views/reports/attendance/TableHeader.tsx
  • src/views/reports/attendance/index.tsx
  • src/views/reports/attendance/index.types.ts

Walkthrough

Changes

Deaf attendance recording was added to settings, attendance entry, centralized statistics, monthly views, and S-88 PDF exports. Export columns now use captions, and PDF hyphenation behavior was customized.

Deaf attendance feature

Layer / File(s) Summary
Attendance settings and contracts
src/constants/..., src/definition/..., src/services/dexie/..., src/states/..., src/features/congregation/settings/...
Deaf attendance settings, typed values, defaults, derived state, toggles, and language-group lifecycle persistence were added.
Attendance entry and persistence
src/features/reports/meeting_attendance/monthly_record/week_box/..., src/services/app/meeting_attendance.ts
Week-box inputs now support hearing and deaf fields, save structured attendance values, and calculate shared attendance statistics.
Monthly attendance views
src/features/reports/meeting_attendance/hooks/..., src/features/reports/meeting_attendance/monthly_history/..., src/features/reports/meeting_attendance/monthly_record/attendance_summary/...
Monthly attendance displays consume centralized statistics and conditionally include online and deaf aggregates.
S-88 export and PDF rendering
src/features/reports/meeting_attendance/export_S88/..., src/views/reports/attendance/..., src/views/registerFonts.ts
S-88 data is built from attendance statistics with deaf and non-deaf columns, caption-based headers, and customized hyphenation.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant WeekBox
  participant AttendanceService
  participant Database
  User->>WeekBox: Enter hearing or deaf attendance values
  WeekBox->>AttendanceService: Save structured values
  AttendanceService->>Database: Persist attendance fields
  AttendanceService-->>WeekBox: Updated attendance state
Loading

Possibly related PRs

Suggested reviewers: rhahao

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The font hyphenation update in src/views/registerFonts.ts is unrelated to #4695 and looks like separate drive-by work. Move the font hyphenation change to a separate PR or commit focused on rendering cleanup.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly reflects the main feature: recording deaf attendance separately for sign-language congregations.
Description check ✅ Passed The description is directly related to the attendance and S-88 changes in the PR.
Linked Issues check ✅ Passed The PR adds separate deaf-attendance recording and updates S-88 output to show total and deaf counts, matching #4695.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

coderabbitai[bot]

This comment was marked as resolved.

react-pdf hyphenates with English patterns by default, so narrow table cells
rendered "Total atten-dance" and "Average At-tendance Each Week" on the S-88.

Words below 14 characters now wrap whole. Longer ones are still offered break
points, but only at vowel-consonant boundaries, so translations with long
compounds keep fitting their cell instead of overflowing it.
coderabbitai[bot]

This comment was marked as resolved.

…ngregations

Sign-language congregations need to report both the total attendance and the
number of deaf attendees. A new congregation setting adds "Deaf" and "Hearing"
inputs to the attendance record, and switches the S-88 export to show the total
in the left block and the deaf count in the right block.

Stored counts keep their meaning: present/online remain the totals, the new
optional present_deaf/online_deaf hold the deaf share, so every existing report
keeps working without migration.

Also replaces the duplicated per-meeting attendance math in the export, the
monthly history and the monthly summary with a single shared service helper.
@ux-git
ux-git force-pushed the feat_attendance_deaf_count branch from 19a422c to a9287e0 Compare July 27, 2026 00:16
@sonarqubecloud

Copy link
Copy Markdown

@mergify

mergify Bot commented Jul 27, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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.

[FEAT]LIBRAS – Attendance Count

1 participant