🎨 Palette: Fix CLI table alignment by using _display_len for profile names#997
Conversation
…names Co-authored-by: abhimehro <84992105+abhimehro@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
Visual recap — skippedThe visual recap job did not run for this pull request. This is informational only and does not block the PR. Recap skipped for |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Pull request overview
This PR updates the CLI sync summary table rendering in main.py to better handle profile names that include emojis or other full-width characters by basing the Profile ID column width on display width rather than raw string length.
Changes:
- Update
print_summary_tableto compute the Profile ID column width using_display_len()(display-width aware). - Refactor the end-of-sync summary rendering to call
print_summary_table(...)instead of duplicating table formatting logic inline. - Update
pr_body.jsonto reflect the new PR description text.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| main.py | Uses _display_len() when computing the profile column width and routes summary output through print_summary_table. |
| pr_body.json | Updates the stored PR body text for this change. |
| # 1. Setup Data | ||
| max_p = max((len(r["profile"]) for r in sync_results), default=25) | ||
| max_p = max((_display_len(r["profile"]) for r in sync_results), default=25) | ||
| w = [max(25, max_p), 10, 12, 10, 15] |
| "body": "💡 What: Extracted the leading newline `\\n` from `prompt_initial` into a standalone `print()` call within `_get_interactive_restart_confirmation` in `main.py`.\n\n🎯 Why: Embedding a leading newline in `input()` prompt strings confuses the terminal's cursor positioning. When a user cancelled the prompt (e.g., via `KeyboardInterrupt` / Ctrl+C), the terminal clearing logic (`\\r\\033[K`) would fail to clear the `^C` residue and instead displace the cursor, leaving awkward extraneous blank lines. Structurally printing the vertical space before invoking the prompt keeps the terminal state clean.\n\n📸 Before/After: Visual changes affect CLI output formatting on interrupt.\n\n♿ Accessibility: Improves the resilience of the terminal UI to interrupts, ensuring a clean and consistent empty state when actions are cancelled.", | ||
| "head": "jules-ux-prompt-fix", | ||
| "base": "main" | ||
| "body": "💡 What: Replaced `len(r[\"profile\"])` with `_display_len(r[\"profile\"])` when calculating `max_profile_len` in `print_summary_table` within `main.py`.\n\n🎯 Why: If a profile name contains emojis or full-width characters, `len()` calculates the raw character count, which causes the column width to be misaligned because terminal emulators render emojis across two columns. `_display_len` accurately counts these characters as 2 visual columns.\n\n📸 Before/After: Visual changes affect CLI table output formatting.\n\n♿ Accessibility: N/A" |
| ) -> None: | ||
| # 1. Setup Data | ||
| max_p = max((len(r["profile"]) for r in sync_results), default=25) | ||
| max_p = max((_display_len(r["profile"]) for r in sync_results), default=25) |
There was a problem hiding this comment.
Automated PR Review — 2026-07-09
Disposition: DEFER (CodeScene code health)
CI is red on CodeScene Code Health Review (main). Per repo policy, posting remediation trigger before salvage deferral.
Action requested: /cs-agent skill:fix-code-health-degradations
Palette table-alignment change is otherwise merge-eligible once CodeScene is green.
Sent by Cursor Automation: Automated PR Review & Consolidation Agent
|
/cs-agent skill:fix-code-health-degradations |
|
…t_line The palette fix for summary table alignment introduced a Low Cohesion degradation by moving summary table logic to print_summary_table(), which left make_col_separator as an orphaned function not connected to the main module. This fix makes print_line use make_col_separator internally, ensuring all table formatting functions remain in the same connected component. Fixes Code Health degradation introduced in palette-fix-summary-table-alignment.
There was a problem hiding this comment.
Code Health Improved
(1 files improve in Code Health)
Fix Code Health degradations ℹ️
Gates Passed
4 Quality Gates Passed
View Improvements
| File | Code Health Impact | Categories Improved |
|---|---|---|
| main.py | 2.47 → 2.62 | Lines of Code in a Single File, Complex Method, Bumpy Road Ahead, Overall Code Complexity |
Quality Gate Profile: Clean Code Collective
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.


💡 What: Replaced
len(r["profile"])with_display_len(r["profile"])when calculatingmax_profile_leninprint_summary_tablewithinmain.py.🎯 Why: If a profile name contains emojis or full-width characters,
len()calculates the raw character count, which causes the column width to be misaligned because terminal emulators render emojis across two columns._display_lenaccurately counts these characters as 2 visual columns.📸 Before/After: Visual changes affect CLI table output formatting.
♿ Accessibility: N/A
PR created automatically by Jules for task 7765853197347250980 started by @abhimehro