Skip to content

serval-admin: serval-builds: support chapter-aware project book display#3847

Open
marksvc wants to merge 4 commits into
masterfrom
task/sb-chapters
Open

serval-admin: serval-builds: support chapter-aware project book display#3847
marksvc wants to merge 4 commits into
masterfrom
task/sb-chapters

Conversation

@marksvc
Copy link
Copy Markdown
Collaborator

@marksvc marksvc commented May 5, 2026

Recently a change was made in the backend where Serval builds might be
reported with chapter numbers, indicating a partial book. This patch
modifies the Serval builds tab to display that chapter information.
Unfortunately, it may not be possible to actually test this behvaiour
very easily until we start to use partial book drafting. It is
possible to see the new frontend behaviour by modifying the backend to
re-write data with chapter lists.

In draft-jobs.component.ts there is a change to using a new
DraftJobsProjectBooks instead of projectBooks. This is so the new
feature doesn't need to also be implemented in the draft jobs
component.

Screenshot showing chapter numbers in table row: (note: I didn't try to make the chapter usage make sense in this example screenshot; this is just to show the information)
Screenshot_20260505_163422

Screenshot showing chapter numbers in expanded details:
Screenshot_20260505_163446


This change is Reviewable

@marksvc marksvc requested a review from Copilot May 5, 2026 22:43
@marksvc marksvc added e2e Run e2e tests for this pull request will require testing PR should not be merged until testers confirm testing is complete labels May 5, 2026
@marksvc marksvc marked this pull request as draft May 5, 2026 22:43
@marksvc marksvc added testing not required and removed will require testing PR should not be merged until testers confirm testing is complete labels May 5, 2026
Copy link
Copy Markdown

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

Updates the Serval Administration “Serval builds” UI to display chapter-aware scripture ranges (partial-book builds) by parsing chapter ranges from backend scriptureRange strings and formatting them for display.

Changes:

  • Extend ProjectBooks to carry booksAndChapters (book id + optional chapter list) instead of a plain books array.
  • Parse chapter numbers from semicolon-delimited scriptureRange segments and display them in compact range notation (e.g., GEN 10-11, 16-19; EXO).
  • Keep Draft Jobs insulated from the new chapter-aware model by introducing DraftJobsProjectBooks and only adapting when exporting.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds.component.ts Adds formatting helpers to render book+chapter ranges and updates project-books formatting to use the new model.
src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds.component.spec.ts Updates existing expectations and adds coverage for compact chapter-range formatting.
src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds.component.html Switches UI display/tooltip rendering from books to formatted booksAndChapters.
src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds-statistics.ts Updates book counting logic to use booksAndChapters.
src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-build-report.ts Introduces BookAndChapters, updates ProjectBooks, and parses chapter ranges from scriptureRange.
src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-build-report.spec.ts Updates expectations for the new booksAndChapters model and adds a chapter-parsing test.
src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/draft-jobs.component.ts Introduces DraftJobsProjectBooks and adapts export formatting without implementing chapter-aware display in Draft Jobs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@marksvc marksvc marked this pull request as ready for review May 5, 2026 22:49
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.07%. Comparing base (dbe86e2) to head (38fa016).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../app/serval-administration/draft-jobs.component.ts 40.00% 6 Missing ⚠️
...p/serval-administration/serval-builds.component.ts 84.21% 1 Missing and 2 partials ⚠️
.../serval-administration/serval-builds-statistics.ts 80.00% 2 Missing ⚠️
...c/app/serval-administration/serval-build-report.ts 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3847      +/-   ##
==========================================
- Coverage   81.07%   81.07%   -0.01%     
==========================================
  Files         630      630              
  Lines       40613    40651      +38     
  Branches     6580     6592      +12     
==========================================
+ Hits        32929    32956      +27     
- Misses       6654     6662       +8     
- Partials     1030     1033       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@marksvc marksvc force-pushed the task/sb-chapters branch from 687ff86 to 7ea0138 Compare May 8, 2026 21:00
@marksvc marksvc temporarily deployed to screenshot_diff May 8, 2026 21:06 — with GitHub Actions Inactive
@pmachapman pmachapman self-requested a review May 11, 2026 22:37
@pmachapman pmachapman self-assigned this May 11, 2026
Copy link
Copy Markdown
Collaborator

@pmachapman pmachapman left a comment

Choose a reason for hiding this comment

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

:lgtm: This worked well for a test build I did a couple of months ago for partial books drafting:

image.png

@pmachapman reviewed 7 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on marksvc).

@Nateowami Nateowami enabled auto-merge (squash) May 12, 2026 01:00
Copy link
Copy Markdown
Collaborator Author

@marksvc marksvc left a comment

Choose a reason for hiding this comment

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

Oh, that's great; thanks for showing!

@marksvc made 1 comment.
Reviewable status: 3 of 7 files reviewed, all discussions resolved (waiting on pmachapman).

@marksvc marksvc temporarily deployed to screenshot_diff May 12, 2026 17:18 — with GitHub Actions Inactive
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

No screenshot differences — all stories are identical.

View the diff page at: https://pr-3847--sf-screenshot-diffs.netlify.app

Copy link
Copy Markdown

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

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment on lines +146 to +148
/** Help template access static methods. */
protected ServalBuildsComponent = ServalBuildsComponent;

Comment on lines +927 to +938
const trainingBooksProjectBooks: ProjectBooks[] = row.trainingBooks.map(bookInfo => ({
sfProjectId: bookInfo.sfProjectId,
projectDisplayName: bookInfo.projectDisplayName,
shortName: bookInfo.shortName,
booksAndChapters: bookInfo.books.map(book => ({ bookId: book }))
}));
const translationBooksProjectBooks: ProjectBooks[] = row.translationBooks.map(bookInfo => ({
sfProjectId: bookInfo.sfProjectId,
projectDisplayName: bookInfo.projectDisplayName,
shortName: bookInfo.shortName,
booksAndChapters: bookInfo.books.map(book => ({ bookId: book }))
}));
@marksvc
Copy link
Copy Markdown
Collaborator Author

marksvc commented May 12, 2026

Thank you @pmachapman . I discovered that this change was regressing how the unique-book-usage count was working and made some additional changes to fix it. So if you could point your eyes to it again for a bit that would be great! Thank you!

Copy link
Copy Markdown
Collaborator

@pmachapman pmachapman left a comment

Choose a reason for hiding this comment

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

:lgtm:

@pmachapman reviewed 4 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on marksvc).

marksvc added 4 commits May 13, 2026 07:48
Recently a change was made in the backend where Serval builds might be
reported with chapter numbers, indicating a partial book. This patch
modifies the Serval builds tab to display that chapter information.
Unfortunately, it may not be possible to actually test this behvaiour
very easily until we start to use partial book drafting. It is
possible to see the new frontend behaviour by modifying the backend to
re-write data with chapter lists.

In draft-jobs.component.ts there is a change to using a new
`DraftJobsProjectBooks` instead of `projectBooks`. This is so the new
feature doesn't need to also be implemented in the draft jobs
component.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e Run e2e tests for this pull request testing not required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants