Skip to content

🎨 Palette: Fix CLI table alignment by using _display_len for profile names#997

Merged
abhimehro merged 2 commits into
mainfrom
palette-fix-summary-table-alignment-7765853197347250980
Jul 10, 2026
Merged

🎨 Palette: Fix CLI table alignment by using _display_len for profile names#997
abhimehro merged 2 commits into
mainfrom
palette-fix-summary-table-alignment-7765853197347250980

Conversation

@abhimehro

Copy link
Copy Markdown
Owner

💡 What: Replaced len(r["profile"]) with _display_len(r["profile"]) when calculating max_profile_len in print_summary_table within main.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_len accurately 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

…names

Co-authored-by: abhimehro <84992105+abhimehro@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings July 8, 2026 20:36
@trunk-io

trunk-io Bot commented Jul 8, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

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

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Visual recap — skipped

The visual recap job did not run for this pull request. This is informational only and does not block the PR.

Recap skipped for 038d929: PLAN_RECAP_TOKEN not configured.

@github-actions github-actions Bot added the python label Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA d5a987e.
Ensure 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 Files

None

@snyk-io

snyk-io Bot commented Jul 8, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

codescene-access[bot]

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown

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 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_table to 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.json to 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.

Comment thread main.py
Comment on lines 2758 to 2760
# 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]
Comment thread pr_body.json
"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"
Comment thread main.py
) -> 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)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Open in Web View Automation 

Sent by Cursor Automation: Automated PR Review & Consolidation Agent

@abhimehro

Copy link
Copy Markdown
Owner Author

/cs-agent skill:fix-code-health-degradations

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

CodeScene Refactoring Agent

Completed

Code Health

Quality gate: ✅ passed

  • 🟢 main.py: findings ✔️ improved
    • Lines of Code in a Single File
    • Low Cohesion
    • Complex Method
    • Bumpy Road Ahead
    • Overall Code Complexity

Finished at 2026-07-09 13:31:12 UTC · View logs

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

@codescene-access codescene-access Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@abhimehro abhimehro merged commit 789bb17 into main Jul 10, 2026
6 checks passed
@abhimehro abhimehro deleted the palette-fix-summary-table-alignment-7765853197347250980 branch July 10, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants