Use one HRTechify template and send Light/Dark as two attachments - #87
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c140cf96e7
ℹ️ 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".
| selectedThemes: ["light", "dark"], | ||
| attachmentDelivery: "two-separate-pdfs-one-email" | ||
| }; | ||
| const response = await window.fetch(endpoint, { |
There was a problem hiding this comment.
Apply a timeout to dual-edition delivery requests
When the delivery server or network stops responding, this direct window.fetch can remain pending indefinitely, leaving the assessment's active operation locked and preventing an in-page retry. Single-edition delivery avoids this through fetchWithTimeout and the configured 60-second limit, so the dual path should apply the same timeout and abort behavior.
Useful? React with 👍 / 👎.
| const fields = { | ||
| Name: cleanText(lead.name, "Not provided"), | ||
| Email: cleanText(lead.email, "Not provided"), | ||
| Company: companyName, | ||
| Industry: cleanText(report.industry || lead.industry, "Not provided"), | ||
| Employees: cleanText(report.employees || lead.employees, "Not provided"), | ||
| "Delivery format": "One email with separate Light and Dark PDF attachments", | ||
| Submitted: new Date().toISOString() |
There was a problem hiding this comment.
Preserve lead details in dual-edition notifications
When a capture request uses the Both option, this replacement internal notification omits the role, hiring plans, and priorities that createInternalEmail in server.js includes for single-edition submissions; it also never consumes body.answers. Consequently, selecting Both silently removes useful lead context from the internal email even though the browser sent it, so this handler should preserve the existing notification fields and pass the answers through.
Useful? React with 👍 / 👎.
| sameGeometry: true, | ||
| onlyPaletteChanges: true |
There was a problem hiding this comment.
Remove theme-specific text before asserting palette-only output
For every Light/Dark pair, renderCover in js/report-visual-renderers-v021.js still writes either “Light edition” or “Dark edition” on the cover. The generated documents therefore differ in text and text geometry, not only in colour, while this new public contract reports onlyPaletteChanges: true; either make the cover text identical or stop advertising and testing palette-only parity.
Useful? React with 👍 / 👎.
Why this follow-up is required
PR #86 merged before the final delivery clarification. This follow-up corrects the merged behaviour and applies the latest report-template direction.
Both-edition delivery
When a user selects Both:
One template, two palettes
HRTechify branding
assets/hrtechify-logo.png;Executive-summary intelligence
The summary is tailored using the complete organisation profile, not only an owner-only OPC rule. It combines:
It includes distinct guidance for owner-only, contractor-led, employee-led, mixed-workforce, micro, emerging, growing, established and scaled organisations, with sector-aware wording across knowledge services, customer operations, care and education, site operations, manufacturing, financial services, creative or mission-led and general profiles.
Compatibility
0.20.0;/api/send-advisoryremains the delivery endpoint;Validation