refactor(tables): implement default alignment and configuration options for table formatting#83
Merged
refactor(tables): implement default alignment and configuration options for table formatting#83
Conversation
…ns for table formatting - Added default alignment settings for table columns to enhance layout consistency. - Updated table options to use centralized default values for better maintainability. - Introduced new constants for table configuration to streamline future adjustments. Signed-off-by: Adrián Constante <ad_con.reload@proton.me>
Contributor
|
👋 Thanks for opening this PR, @adcondev! Here's what will happen next:
Please make sure:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors table formatting to use centralized default configuration constants, improving maintainability and establishing center alignment as the new default for table columns. The PR also consolidates command type definitions and updates documentation to reflect the project's current architecture focus on Windows-based POS printer integration.
Key Changes
- Changed default table column alignment from left to center, with corresponding test updates
- Refactored table options initialization to use centralized constants from
pkg/constantspackage - Consolidated command data structures into a dedicated
exec_types.gofile for better organization
Reviewed changes
Copilot reviewed 8 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
pkg/tables/table.go |
Updated PadString default case to center alignment (with FIXME note for future improvement) |
pkg/tables/table_test.go |
Updated test expectations to reflect new center alignment default |
pkg/constants/defaults.go |
Removed duplicate alignment constants (previously defined but unused) |
pkg/document/executor/table_handler.go |
Refactored to use centralized default constants instead of hardcoded values |
pkg/document/executor/exec_types.go |
New file consolidating all command struct definitions |
pkg/document/builder/doc_types.go |
Added empty placeholder file for future type definitions |
README.md |
Major documentation rewrite focusing on Windows POS printer utility features |
LEARNING.md |
New root-level learning documentation with technical architecture details |
docs/LEARNING.md |
Removed (consolidated into root-level LEARNING.md) |
docs/MOTIVATION4.md |
Added comprehensive Spanish documentation on ESC/POS emulation architecture |
.gitignore |
Updated to include new documentation files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Adrián Constante <ad_con.reload@proton.me>
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.
Description
Type of Change
Component(s) Affected
composer- ESC/POS protocol composerconnection- Printer connectionscommands- ESC/POS command implementationsdocument- Document processinggraphics- Image processingprinter- Barcode generationprofile- Printer profilesservice- High-level printer servicegithub- GitHub related files and workflowsHow Has This Been Tested?
Test Configuration
Checklist
Screenshots/Examples
Breaking Changes
Additional Notes