Skip to content

Use one HRTechify template and send Light/Dark as two attachments - #87

Merged
hrtechifyed merged 14 commits into
mainfrom
fix/two-attachment-profile-summary
Jul 28, 2026
Merged

Use one HRTechify template and send Light/Dark as two attachments#87
hrtechifyed merged 14 commits into
mainfrom
fix/two-attachment-profile-summary

Conversation

@hrtechifyed

Copy link
Copy Markdown
Owner

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 Light PDF is generated;
  • one Dark PDF is generated;
  • both remain separate report files;
  • both are attached to one customer email;
  • no combined Light-and-Dark PDF is created;
  • no second customer email is sent for the other edition;
  • the server rejects any dual-edition request that does not contain exactly one Light and one Dark PDF.

One template, two palettes

  • Light and Dark use the same renderer, section order, cards, dimensions, spacing and page geometry;
  • the only intended visual difference is the colour palette;
  • generation fails if Light and Dark page counts diverge for the same assessment;
  • both editions retain separate filenames and remain available as individual browser downloads.

HRTechify branding

  • the report is locked to assets/hrtechify-logo.png;
  • the HRTechify logo is used on the cover and closing page;
  • a compact HRTechify logo is applied to the Table of Contents and content pages;
  • the image is scaled without distorting its aspect ratio;
  • report modules do not select another logo asset.

Executive-summary intelligence

The summary is tailored using the complete organisation profile, not only an owner-only OPC rule. It combines:

  • legal structure;
  • sector;
  • workforce size and growth stage;
  • employee, worker and contractor mix;
  • operating states and multi-state footprint;
  • remote, hybrid, site or workplace model;
  • shifts and night operations;
  • manufacturing or production activity;
  • stated growth and expansion priorities.

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

  • package version remains 0.20.0;
  • no database, authentication, storage-key or assessment-evaluation change;
  • /api/send-advisory remains the delivery endpoint;
  • single-edition email delivery remains unchanged;
  • existing report sections, official-source links, action cards, roadmap and legal boundaries remain.

Validation

  • static syntax and contract checks for the shared template, HRTechify-only branding, profile combinations and dual attachments;
  • browser tests for Light/Dark page parity, logo placement, multiple organisation combinations and one email request with two separate PDFs;
  • server validation for exactly one Light and one Dark PDF;
  • full GrowWithHR CI, M4 Report Integration and Executive Assessment workflows required before review.

@hrtechifyed
hrtechifyed marked this pull request as ready for review July 28, 2026 05:01
@hrtechifyed
hrtechifyed merged commit e5afb46 into main Jul 28, 2026
4 checks passed

@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: 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, {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +144 to +151
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()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +68 to +69
sameGeometry: true,
onlyPaletteChanges: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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