-
Notifications
You must be signed in to change notification settings - Fork 2
Fix spreadsheet cell text overflow with automatic wrapping #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
8
commits into
master
Choose a base branch
from
copilot/fix-cell-sizing-and-wrapping
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
- Added text wrapping functionality using textwrap module - Configured cells to wrap text at 80 chars for responses, 50 for questions - Increased row height to 110px to accommodate up to 5 lines - Text exceeding 5 lines is truncated with ellipsis - Created comprehensive unit tests for wrapping functionality - All 11 tests passing Co-authored-by: mcasalaina <1323111+mcasalaina@users.noreply.github.com>
- Fixed ttk import in test file - Added bounds checking for truncation to prevent negative slice - Added test for very small width edge case - All 12 tests passing Co-authored-by: mcasalaina <1323111+mcasalaina@users.noreply.github.com>
- Moved ttk import to top of test file per Python conventions - Added additional bounds checking in truncation logic - Prevents IndexError when max_lines-1 >= len(lines) - All 12 tests still passing Co-authored-by: mcasalaina <1323111+mcasalaina@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix spreadsheet response cell sizing and text wrapping
Fix spreadsheet cell text overflow with automatic wrapping
Nov 4, 2025
- Calculate characters per line dynamically from actual column pixel widths - Calculate required row height by checking all wrapped content - Update row height when answers are completed - Start with minimal height and expand only when needed - Remove fixed CHARS_PER_LINE constants in favor of dynamic calculation
- Replaced limited tkinter Treeview with tksheet library - Enables automatic row height adjustment based on content - Native support for text wrapping within cells - Better Excel-like appearance and performance - No more manual row height calculations needed - Added tksheet>=7.5.0 to requirements.txt - Removed old treeview-based implementation
Owner
Update: Replaced tkinter Treeview with tksheetMajor Change: Completely replaced the tkinter Treeview implementation with tksheet library for proper spreadsheet functionality. What was changed:
Benefits:
Still fixing:
The tksheet library is specifically designed for this use case and eliminates the fundamental limitations we were hitting with tkinter's Treeview widget. |
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.
Response cells truncate text at the right edge, making long answers unreadable without manual column resizing.
Changes
Text wrapping implementation:
_wrap_text()method usingtextwrapfor word-boundary wrappingLayout adjustments:
_populate_rows()andupdate_cell()for both columnsExample behavior:
Error handling:
Testing
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
esm.ubuntu.com/usr/lib/apt/methods/https(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.