Improve rabbit sheet printing functionality for A6 format without UI interference#31
Merged
hankerspace merged 4 commits intoAug 10, 2025
Merged
Conversation
Co-authored-by: hankerspace <303649+hankerspace@users.noreply.github.com>
Co-authored-by: hankerspace <303649+hankerspace@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] retravaille la fonctionalité "imprimer" une fiche lapin. Cette fiche doit tenir au format A6, et le clic sur "imprimer" doit pouvoir lancer l'impression au format A6, sans autre élément d'interface superflux dans la page.
Trouve une solution
Improve rabbit sheet printing functionality for A6 format without UI interference
Aug 10, 2025
Owner
|
@copilot fix tests & lint |
…nimal interface properties Co-authored-by: hankerspace <303649+hankerspace@users.noreply.github.com>
Contributor
Author
Tests and lint have been fixed! The TypeScript compilation errors were resolved by updating the test file to use the correct Animal interface properties. All tests now pass (600 passed), lint passes without issues, and the build completes successfully. Changes committed in 5fb3e8c. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The existing print functionality for rabbit sheets (fiches lapin) had several issues:
Solution
This PR completely reimplements the print functionality to provide a clean, A6-formatted rabbit sheet without any superfluous interface elements.
Key Changes
New dedicated print utility (
src/utils/print.utils.ts):Simplified user experience (
src/pages/Animals/AnimalDetailPage.tsx):Print-optimized layout:
@pagerules ensure correct A6 page size and marginsTechnical Implementation
The new print function opens a dedicated window with self-contained HTML that includes:
Testing
Added comprehensive test suite covering:
Usage
When users click "Imprimer fiche" on an animal detail page:
The result is a clean, professional A6 rabbit identification sheet containing:
This implementation eliminates any risk of printing unwanted UI elements while providing a much smoother user experience.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.