Skip to content

Make a text container's width in columns the line width of its snippet - #107

Merged
marcosqlbi merged 2 commits into
mainfrom
feature/text-columns
Sep 6, 2026
Merged

Make a text container's width in columns the line width of its snippet#107
marcosqlbi merged 2 commits into
mainfrom
feature/text-columns

Conversation

@marcosqlbi

Copy link
Copy Markdown
Collaborator

Why

The DAX formatter wraps at 65 characters, but a new text container showed about 58, so formatted DAX wrapped on screen at once. And there was no way to give one snippet longer lines short of entering edit mode, dragging, formatting, and committing. Only DAX has a width to configure; SQL and KQL break lines by structure. So instead of a width setting, the container's own width becomes the line width. Decision 29 has the reasoning, including why display-mode scaling was kept.

What changes

  • A new container is 65 columns wide, measured in the code font, so it agrees with the formatter. The old fixed 600 pixels showed 58.
  • F6 wraps DAX to the container's columns, in display mode and in edit mode. Columns are invariant under display-mode scaling, so this works on a container enlarged for the room. The language services take a columns argument; SQL and KQL ignore it.
  • Shift while dragging the handle changes a text container's width in columns and reflows the text, keeping the font size; the handle shows the count while dragging. A plain drag still scales the container like a picture, as every container does. Linked strokes follow the container as they do for any resize.
  • Guide, shortcuts, README, and a 1.3.1 release note say how it works, in two lines each.

Verified

Build clean; smoke tests cover the formatter honouring a given width. A harness against the real font metrics confirms the default width is 65 columns, a 65-character line does not wrap, scaling leaves the count unchanged, and the count clamps to 40 to 200. The Shift-drag gesture itself was reviewed but not driven by a test, since it is a pointer gesture on the canvas.

Not to be merged yet.

🤖 Generated with Claude Code

marcosqlbi and others added 2 commits September 6, 2026 06:28
The DAX formatter wraps at 65 characters; a new container showed 58, so
formatted DAX wrapped on screen at once. A new container is now 65
columns wide, measured in the code font, and F6 wraps DAX to the columns
the container shows, which are invariant under display-mode scaling.
SQL and KQL break by structure and ignore the width.

Shift while dragging a text container's handle changes its width in
columns and reflows the text, keeping the size; the handle shows the
count while dragging. A plain drag keeps scaling the container like a
picture, which is what a presenter needs and what every other container
does. Decision 29 records why scaling was kept.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Dragging the right edge changes the width in columns and reflows, with
the horizontal resize cursor on hover, which is what makes it
discoverable; Shift on the corner still does the same, and a plain drag
of the corner still scales.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@marcosqlbi

Copy link
Copy Markdown
Collaborator Author

Added: the right edge of a text container is now a width handle too. Hovering it shows the horizontal resize cursor, and dragging it changes the columns and reflows, the same as Shift on the corner. The corner without Shift still scales.

@marcosqlbi
marcosqlbi merged commit f76cb61 into main Sep 6, 2026
5 checks passed
@marcosqlbi
marcosqlbi deleted the feature/text-columns branch September 6, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant