Skip to content
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

Bad wording/casing of command title #133960

Closed
jrieken opened this issue Sep 28, 2021 · 16 comments
Closed

Bad wording/casing of command title #133960

jrieken opened this issue Sep 28, 2021 · 16 comments
Assignees
Labels
insiders-released Patch has been released in VS Code Insiders polish Cleanup and polish issue terminal General terminal issues that don't fall under another label
Milestone

Comments

@jrieken
Copy link
Member

jrieken commented Sep 28, 2021

Testing #133550

Without reading the TPI I would have not understood what this means: "Toggle size to content width". Do I toggle the size or what? How about "Fixed Content Width" and a check mark that represents on/off. IMO a check mark will help a lot since there is no immediate effect when toggling the mode (e.g existing lines don't get re-rendered)

Screen Shot 2021-09-28 at 10 43 55

@meganrogge
Copy link
Contributor

meganrogge commented Sep 28, 2021

@jrieken we tried using the toggled property and couldn't get it to show up in the context menu. tried modeling the View -> Show Breadcrumbs checkmark to no avail

meganrogge added a commit that referenced this issue Sep 28, 2021
@meganrogge meganrogge added this to the September 2021 milestone Sep 28, 2021
@jrieken
Copy link
Member Author

jrieken commented Sep 29, 2021

@jrieken we tried using the toggled property and couldn't get it to show up in the context menu.

Details? This is working well in many other places

@TarunavBA
Copy link

Testing #133550

Without reading the TPI I would have not understood what this means: "Toggle size to content width". Do I toggle the size or what? How about "Fixed Content Width" and a check mark that represents on/off. IMO a check mark will help a lot since there is no immediate effect when toggling the mode (e.g existing lines don't get re-rendered)

Screen Shot 2021-09-28 at 10 43 55

@jrieken what theme do u use ? Can you provide the name or json?

@jrieken
Copy link
Member Author

jrieken commented Sep 29, 2021

It's Github Light Default at version 4.x (I didn't like the 5.x changes they made). Also these tweaks

	"workbench.colorCustomizations": {
		"sash.hoverBorder": "#5a505042",
		"statusBarItem.remoteBackground": "#00000000",
		"statusBarItem.remoteForeground": "#55810e",
		"list.focusOutline": "#00000000",
		"editorWhitespace.foreground": "#a8929256"
	},

@TarunavBA
Copy link

It's Github Light Default at version 4.x (I didn't like the 5.x changes they made). Also these tweaks

	"workbench.colorCustomizations": {
		"sash.hoverBorder": "#5a505042",
		"statusBarItem.remoteBackground": "#00000000",
		"statusBarItem.remoteForeground": "#55810e",
		"list.focusOutline": "#00000000",
		"editorWhitespace.foreground": "#a8929256"
	},

@jrieken Thanks! I'll surely check it out! 🎉

@meganrogge
Copy link
Contributor

meganrogge commented Sep 29, 2021

@jrieken the checkmark doesn't show up
recording (76)

@jrieken
Copy link
Member Author

jrieken commented Sep 29, 2021

I cannot help you, when you show me gifs :-) Do you already use toggled? Do you update the right context key service? Do you know how to debug these things? Do you know F1 > Inspect Context keys?

@meganrogge
Copy link
Contributor

meganrogge commented Sep 29, 2021

you'll see the code responsible for it in the window in the gif

registerAction2(class extends Action2 {
		constructor() {
			super({
				id: TerminalCommandId.SizeToContentWidthInstance,
				title: terminalStrings.toggleSizeToContentWidth,
				f1: false,
				category,
				toggled: TerminalContextKeys.terminalHasFixedWidth,
				precondition: ContextKeyExpr.and(TerminalContextKeys.processSupported, TerminalContextKeys.focus)
			});
		}
		async run(accessor: ServicesAccessor) {
			return getSelectedInstances(accessor)?.[0].toggleSizeToContentWidth();
		}
	});

@meganrogge
Copy link
Contributor

meganrogge commented Sep 29, 2021

When I inspect that context key, the value is correctly updating. I don't think this kind of menu supports the checkmark, which I concluded when I originally tried to do this.

@meganrogge meganrogge added polish Cleanup and polish issue terminal General terminal issues that don't fall under another label labels Sep 29, 2021
@jrieken
Copy link
Member Author

jrieken commented Sep 29, 2021

The menu does support it. I suspect that the TerminalContextKeys.processSupported is broken because from time to time I also see Cmd+K not clearing the terminal (and that command uses the same context key)

@meganrogge
Copy link
Contributor

just commented out the precondition and it still doesn't work

@jrieken
Copy link
Member Author

jrieken commented Sep 29, 2021

Yeah, sorry worng hint. The precondition is never used for the check mark. It's only the toggled-condition, e.g terminalHasFixedWidth, and the context key inspector tells me its false no matter how often I toggle

@meganrogge
Copy link
Contributor

in the run action when I log the value of that context key, it's correct. not sure why the value is false when you inspect it.

async run(accessor: ServicesAccessor) {
return getSelectedInstances(accessor)?.[0].toggleSizeToContentWidth();
}

I know the context key is updating correctly because otherwise toggling wouldn't happen as you'll see here

async toggleSizeToContentWidth(): Promise<void> {
if (!this._xterm?.buffer.active) {
return;
}
if (this._terminalHasFixedWidth.get() === true) {
this._terminalHasFixedWidth.set(false);
this._fixedCols = undefined;
this._fixedRows = undefined;
this._hasScrollBar = false;
this._initDimensions();
await this._resize();
this._horizontalScrollbar?.setScrollDimensions({ scrollWidth: 0 });
} else {
let maxCols = 0;
for (let i = this._xterm.buffer.active.viewportY; i < this._xterm.buffer.active.length; i++) {
const lineWidth = this._getLineWidth(i, this._xterm.buffer.active);
maxCols = Math.max(maxCols, lineWidth.width || 0);
i = lineWidth.newIndex;
}
maxCols = Math.min(maxCols, Constants.MaxSupportedCols);
if (maxCols > this.maxCols) {
this._fixedCols = maxCols;
await this._addScrollbar();
}
}
this.focus();
}

@meganrogge
Copy link
Contributor

Also if I use a different context key - notFindVisible for instance - even when find isn't visible the checkmark isn't appearing.

@meganrogge
Copy link
Contributor

reverting as it's more complicated than just using that context key since that is shared between instances. for now, we'll just keep toggle. I'll work on this next iteration.

@meganrogge meganrogge reopened this Sep 29, 2021
@meganrogge meganrogge removed the unreleased Patch has not yet been released in VS Code Insiders label Sep 29, 2021
@meganrogge
Copy link
Contributor

meganrogge commented Sep 29, 2021

@github-actions github-actions bot locked and limited conversation to collaborators Nov 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
insiders-released Patch has been released in VS Code Insiders polish Cleanup and polish issue terminal General terminal issues that don't fall under another label
Projects
None yet
Development

No branches or pull requests

5 participants
@jrieken @Tyriar @meganrogge @TarunavBA and others