Skip to content

RFC: Cover letter module modernization (#96)#164

Merged
yunanwg merged 4 commits intomainfrom
worktree-issue-96-letter
Mar 17, 2026
Merged

RFC: Cover letter module modernization (#96)#164
yunanwg merged 4 commits intomainfrom
worktree-issue-96-letter

Conversation

@yunanwg
Copy link
Owner

@yunanwg yunanwg commented Mar 15, 2026

Summary

Modernizes the cover letter module to sync with CV module patterns and addresses feature requests from #96.

Phase A: Code Consistency Fixes

  • Fix file comment (was incorrectly saying "CV template")
  • Import injection utility + add keyword/ATS injection support in cover letter
  • Read font size from metadata.toml instead of hardcoding 9pt
  • Non-Latin header font handling (match CV pattern)
  • Backward-compat panics for deprecated inject_ai_prompt / inject_keywords fields
  • Fix array index out of bounds for non-Latin font insert (bug: non-Latin font insert crashes when regular_fonts has fewer than 3 entries #165)

Phase B: User-Requested Features (#96)

  • sender-address defaults to auto, reads from metadata.personal.address (with manual override)
  • address-style parameter: "smallcaps" (default) or "normal" to control address case
  • Multiline address support (updated template examples)
  • Date manual override documentation

Out of scope (follow-up issues)

  • Language-specific letter layouts (e.g., French date positioning) — needs architecture redesign
  • Letter integration into CV via importModules() — needs page setup mechanism changes

Test plan

Partially addresses #96
Fixes #165

🤖 Generated with Claude Code

Initial changes toward syncing the cover letter module with CV patterns:
- Fix file comment (was incorrectly saying "CV template")
- Import injection utility for upcoming keyword injection support
- Add address-style parameter to _letter-header for case control

Part of #96

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@spark-by-yunan spark-by-yunan bot added the enhancement New feature or request label Mar 15, 2026
@spark-by-yunan spark-by-yunan bot added this to the v3.3.0 milestone Mar 15, 2026
Phase A - Code consistency:
- Read font size from metadata.toml instead of hardcoding 9pt
- Add header-font handling for non-Latin languages (match CV pattern)
- Add keyword injection support (ATS keywords in cover letter)
- Add backward-compat panics for deprecated inject fields

Phase B - User-requested features (#96):
- sender-address defaults to auto, reads from metadata.personal.address
- Add address-style parameter ("smallcaps" or "normal")
- Update template with multiline address examples and usage comments

Closes #96

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
yunanwg and others added 2 commits March 15, 2026 22:22
Use calc.min(2, fonts.len()) instead of hardcoded index 2 when inserting
non-Latin fonts. This prevents a crash when regular_fonts has fewer than
3 entries. Fixes both cv() and letter() functions.

Fixes #165

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@yunanwg
Copy link
Owner Author

yunanwg commented Mar 15, 2026

@codex Review this PR.

spark-by-yunan[bot]

This comment was marked as duplicate.

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Breezy!

ℹ️ 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".

@yunanwg yunanwg marked this pull request as ready for review March 17, 2026 12:26
@yunanwg yunanwg merged commit d0ae1d6 into main Mar 17, 2026
4 checks passed
@yunanwg yunanwg deleted the worktree-issue-96-letter branch March 17, 2026 12:26
Copy link

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

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: b09d3d9210

ℹ️ 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".

}

// Backward compatibility: panic if old inject fields are detected
if metadata.inject.at("inject_ai_prompt", default: none) != none {

Choose a reason for hiding this comment

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

P2 Badge Guard access to inject config in letter()

This new direct dereference of metadata.inject will fail at runtime for metadata files that don't define an [inject] table (for example older or letter-only configs), so letter() now panics before rendering instead of using defaults. Because this access path was added in this commit, it introduces a backward-compatibility regression; read inject via metadata.at("inject", default: (:)) (or equivalent) before calling .at(...) on its keys.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: non-Latin font insert crashes when regular_fonts has fewer than 3 entries

1 participant