Skip to content

Refactor Layout component and improve badge styling and visuals#41

Merged
sumitsahoo merged 5 commits intomainfrom
dev
Apr 10, 2026
Merged

Refactor Layout component and improve badge styling and visuals#41
sumitsahoo merged 5 commits intomainfrom
dev

Conversation

@sumitsahoo
Copy link
Copy Markdown
Owner

This pull request removes the dependency on @pdf-lib/fontkit from the project and updates the UI to dynamically color certain elements based on the active tool's category. The most significant changes are grouped below:

Dependency removal and code cleanup:

  • Removed @pdf-lib/fontkit from package.json and cleaned up all related references in pnpm-lock.yaml, as well as imports and usage in src/utils/pdf-operations.ts. The PDF operations now rely solely on standard fonts, removing the need for custom fontkit registration. [1] [2] [3] [4] [5] [6] [7]
  • Updated the documentation in README.md to remove mention of fontkit in the "Font Support" section.

UI enhancements:

  • Added logic in src/App.tsx to compute a badgeAccent object based on the active tool's category, mapping to specific background, border, text colors, and optional logo filter. This is passed to the Layout component.
  • Updated the Layout component (src/components/Layout.tsx) to accept and use the new badgeAccent prop, applying the accent colors and logo filter to the privacy badge, logo, and GitHub link for a more dynamic and visually cohesive UI. [1] [2] [3] [4]

Copilot AI review requested due to automatic review settings April 10, 2026 10:17
@sumitsahoo sumitsahoo merged commit 8080e10 into main Apr 10, 2026
6 checks passed
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

This PR removes the project’s direct dependency on @pdf-lib/fontkit and updates the UI layout header styling so the privacy badge (and related header elements) can adopt category-specific accent colors based on the currently active tool.

Changes:

  • Removed @pdf-lib/fontkit from dependencies/lockfile and eliminated fontkit registration calls in PDF operations.
  • Added category→accent mapping in App.tsx and passed the computed badgeAccent into Layout.
  • Updated Layout to apply the provided accent classes (and optional logo filter) to the privacy badge, logo, and GitHub link.

Reviewed changes

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

Show a summary per file
File Description
src/utils/pdf-operations.ts Removes fontkit import/registration; continues using standard fonts only.
src/components/Layout.tsx Accepts badgeAccent and applies dynamic accent styling to header elements.
src/App.tsx Computes badgeAccent from the active tool’s category and passes it into Layout.
README.md Removes Fontkit from the documented tech stack.
package.json Drops @pdf-lib/fontkit dependency.
pnpm-lock.yaml Removes @pdf-lib/fontkit entries from lockfile.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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.

2 participants