Skip to content

refactor(tables): implement default alignment and configuration options for table formatting#83

Merged
adcondev merged 2 commits intomasterfrom
feat/emulator
Dec 5, 2025
Merged

refactor(tables): implement default alignment and configuration options for table formatting#83
adcondev merged 2 commits intomasterfrom
feat/emulator

Conversation

@adcondev
Copy link
Copy Markdown
Owner

@adcondev adcondev commented Dec 5, 2025

  • 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.

Description

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation only
  • 🔧 Configuration/DevOps
  • ♻️ Code refactoring
  • 📦 Dependency update
  • ⚡ Performance improvement
  • 🧪 Test addition/modification

Component(s) Affected

  • composer - ESC/POS protocol composer
  • connection - Printer connections
  • commands - ESC/POS command implementations
  • document - Document processing
  • graphics - Image processing
  • printer - Barcode generation
  • profile - Printer profiles
  • service - High-level printer service
  • github - GitHub related files and workflows

How Has This Been Tested?

  • Unit tests pass locally
  • Integration tests pass
  • Manual testing with physical printer
  • Examples built and run successfully
  • N/A (documentation/configuration only)

Test Configuration

  • Go Version:
  • OS:
  • Printer Model (if applicable):

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Screenshots/Examples

Breaking Changes

Additional Notes

…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>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 5, 2025

👋 Thanks for opening this PR, @adcondev!

Here's what will happen next:

  • 🤖 Automated checks will run
  • 🏷️ Labels will be added automatically
  • 👀 A maintainer will review your changes

Please make sure:

  • ✅ All tests pass
  • 📝 The PR title follows conventional commits
  • 📋 The PR template is filled out completely

Copy link
Copy Markdown
Contributor

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 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/constants package
  • Consolidated command data structures into a dedicated exec_types.go file 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.

Comment thread pkg/document/executor/table_handler.go Outdated
Comment thread pkg/tables/table.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Adrián Constante <ad_con.reload@proton.me>
@adcondev adcondev merged commit 949fa9f into master Dec 5, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builder documentation Improvements or additions to documentation executor size/L tables tests

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants