ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:109949] [Ruby master Bug#19010] Follow up of #18996: Support changing irb's autocompletion background
@ 2022-09-18 14:18 st0012 (Stan Lo)
  2022-09-18 17:29 ` [ruby-core:109951] " kaiquekandykoga
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: st0012 (Stan Lo) @ 2022-09-18 14:18 UTC (permalink / raw)
  To: ruby-core

Issue #19010 has been reported by st0012 (Stan Lo).

----------------------------------------
Bug #19010: Follow up of #18996: Support changing irb's autocompletion background
https://bugs.ruby-lang.org/issues/19010

* Author: st0012 (Stan Lo)
* Status: Open
* Priority: Normal
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
If the APIs proposed in #18996 (or similar ones) are accepted, we'll be able to configure `irb`'s autocompletion dialog colors.

And for the `irb` side, I want to propose 2 levels of configurations:

### 1. Theme selection

Consider most users don't care about individual colors if the text are readable and roughly match with the terminal background, I want to provide 2 basic themes (dark/light) for users to choose:


**Theme`:dark`**

<img width="40%" alt="Light terminal - dark theme" src="https://user-images.githubusercontent.com/5079556/180603528-8a8b60d1-6a1e-4be8-9c18-5e73cae7a24c.png">

<img width="40%" alt="Dark terminal - dark theme" src="https://user-images.githubusercontent.com/5079556/180603526-3618f181-fff3-45c5-b925-061110366adf.png">

**Theme `:light`**


<img width="40%" alt="Light terminal - light theme" src="https://user-images.githubusercontent.com/5079556/180603529-0d8a24af-3d93-4573-afbd-0d354b3145cc.png">

<img width="40%" alt="Dark terminal - light theme" src="https://user-images.githubusercontent.com/5079556/180603527-4d0fcbf7-fbd5-4099-ac78-9236f8b8c782.png">

**Default**

In terms of default, I think `dark` is better than `light`. Because when in a light terminal, seeing a dark dropdown isn't so troubling. But when in a dark terminal, seeing a large light dropdown can bring discomfort to eyes.

Side note: It's possible to detect the terminal's background color from an xterm-compatible terminal emulator ([example gist](https://gist.github.com/blueyed/c8470c2aad3381c33ea3)), so `irb` may automatically assign themes based on users' terminal theme. But we still need to pick a default as the fallback.

**Interface for theme selection**

If we think it's possible to introduce more themes than just dark/light, we can expose the API as 

```rb
IRB.conf[:DIALOG_THEME] = theme_name
```

If we don't consider introducing other themes, we can make it a toggle for the non-default theme, like 

```rb
IRB.conf[:USE_LIGHT_THEME] = true
```


### 2. Per-color configurations

For users who want to configure individual colors, we should also provide options on the `irb` side, like 

```rb
IRB.conf[:dialog_default_bg_color] = :black
```

This prevents directly exposing `reline`'s API to normal `irb` users.


**I implemented the ideas in this [proof of concept PR](https://github.com/ruby/irb/pull/380).**



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:109951] [Ruby master Bug#19010] Follow up of #18996: Support changing irb's autocompletion background
  2022-09-18 14:18 [ruby-core:109949] [Ruby master Bug#19010] Follow up of #18996: Support changing irb's autocompletion background st0012 (Stan Lo)
@ 2022-09-18 17:29 ` kaiquekandykoga
  2022-09-18 21:30 ` [ruby-core:109952] " st0012 (Stan Lo)
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: kaiquekandykoga @ 2022-09-18 17:29 UTC (permalink / raw)
  To: ruby-core

Issue #19010 has been updated by kaiquekandykoga (Kaíque Koga).

File Screenshot_20220918_135231.png added

I like the idea of having multiple themes. I use light screen for everything, and I enjoy the way irb is currently displayed. Perhaps keeping the current irb's colors as one alternative, and add the proposed light theme and dark theme too. Some people use other colors than black or white for terminals, like blue for instance, so having a few themes thinking about that can help.

About the default color. I like to use autocompletion, but I know that some people dislike having enabled autocompletion by default. So if irb start showing the autocompletion only if a theme is set, there is not need to think about a default color.

----------------------------------------
Bug #19010: Follow up of #18996: Support changing irb's autocompletion background
https://bugs.ruby-lang.org/issues/19010#change-99199

* Author: st0012 (Stan Lo)
* Status: Open
* Priority: Normal
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
If the APIs proposed in #18996 (or similar ones) are accepted, we'll be able to configure `irb`'s autocompletion dialog colors.

And for the `irb` side, I want to propose 2 levels of configurations:

### 1. Theme selection

Consider most users don't care about individual colors if the text are readable and roughly match with the terminal background, I want to provide 2 basic themes (dark/light) for users to choose:


**Theme`:dark`**

<img width="40%" alt="Light terminal - dark theme" src="https://user-images.githubusercontent.com/5079556/180603528-8a8b60d1-6a1e-4be8-9c18-5e73cae7a24c.png">

<img width="40%" alt="Dark terminal - dark theme" src="https://user-images.githubusercontent.com/5079556/180603526-3618f181-fff3-45c5-b925-061110366adf.png">

**Theme `:light`**


<img width="40%" alt="Light terminal - light theme" src="https://user-images.githubusercontent.com/5079556/180603529-0d8a24af-3d93-4573-afbd-0d354b3145cc.png">

<img width="40%" alt="Dark terminal - light theme" src="https://user-images.githubusercontent.com/5079556/180603527-4d0fcbf7-fbd5-4099-ac78-9236f8b8c782.png">

**Default**

In terms of default, I think `dark` is better than `light`. Because when in a light terminal, seeing a dark dropdown isn't so troubling. But when in a dark terminal, seeing a large light dropdown can bring discomfort to eyes.

Side note: It's possible to detect the terminal's background color from an xterm-compatible terminal emulator ([example gist](https://gist.github.com/blueyed/c8470c2aad3381c33ea3)), so `irb` may automatically assign themes based on users' terminal theme. But we still need to pick a default as the fallback.

**Interface for theme selection**

If we think it's possible to introduce more themes than just dark/light, we can expose the API as 

```rb
IRB.conf[:DIALOG_THEME] = theme_name
```

If we don't consider introducing other themes, we can make it a toggle for the non-default theme, like 

```rb
IRB.conf[:USE_LIGHT_THEME] = true
```


### 2. Per-color configurations

For users who want to configure individual colors, we should also provide options on the `irb` side, like 

```rb
IRB.conf[:dialog_default_bg_color] = :black
```

This prevents directly exposing `reline`'s API to normal `irb` users.


**I implemented the ideas in this [proof of concept PR](https://github.com/ruby/irb/pull/380).**

---Files--------------------------------
Screenshot_20220918_135231.png (70.8 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:109952] [Ruby master Bug#19010] Follow up of #18996: Support changing irb's autocompletion background
  2022-09-18 14:18 [ruby-core:109949] [Ruby master Bug#19010] Follow up of #18996: Support changing irb's autocompletion background st0012 (Stan Lo)
  2022-09-18 17:29 ` [ruby-core:109951] " kaiquekandykoga
@ 2022-09-18 21:30 ` st0012 (Stan Lo)
  2022-09-18 22:20 ` [ruby-core:109953] [Ruby master Feature#19010] " kaiquekandykoga
  2022-09-22 23:46 ` [ruby-core:110018] " mame (Yusuke Endoh)
  3 siblings, 0 replies; 5+ messages in thread
From: st0012 (Stan Lo) @ 2022-09-18 21:30 UTC (permalink / raw)
  To: ruby-core

Issue #19010 has been updated by st0012 (Stan Lo).


kaiquekandykoga (Kaíque Koga) wrote in #note-1:
> Perhaps keeping the current irb's colors as one alternative

`irb` doesn't have a theme at the moment. The colours we see are `reline`'s default values for the dialog UI. And it's not a complete set of configurations either. `reline` only sets background colours of items, but not the foreground (text) colours. That's why it works for some users but not others (like me), depends on the text colours of their themes.

You can learn more about `reline`'s colour APIs in #18996 

> Some people use other colors than black or white for terminals, like blue for instance, so having a few themes thinking about that can help.

People can have dozens or even hundreds of different background colours, so it's not possible for `irb` to have themes to nicely match them. And it's not the purpose of themes either. It's to provide acceptable colour contrasts to help users read the content.

> About the default color. I like to use autocompletion, but I know that some people dislike having enabled autocompletion by default. So if irb start showing the autocompletion only if a theme is set, there is not need to think about a default color.

I disagree with this. People usually don't look up a tool's features proactively. So if we disabled it, it's likely that most users won't even know about it. And this very helpful feature will end up benefit a lot fewer users than it could have helped.

What we should do instead, is to 

1. Reduce the things that make people dislike it as much as we can (like improving the colours)
2. Make it easy to disable the feature

So even if some users disabled it now, at least they now this feature exists and there are people improving it. It's way better than having most people unaware of it IMO.


----------------------------------------
Bug #19010: Follow up of #18996: Support changing irb's autocompletion background
https://bugs.ruby-lang.org/issues/19010#change-99200

* Author: st0012 (Stan Lo)
* Status: Open
* Priority: Normal
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
If the APIs proposed in #18996 (or similar ones) are accepted, we'll be able to configure `irb`'s autocompletion dialog colors.

And for the `irb` side, I want to propose 2 levels of configurations:

### 1. Theme selection

Consider most users don't care about individual colors if the text are readable and roughly match with the terminal background, I want to provide 2 basic themes (dark/light) for users to choose:


**Theme`:dark`**

<img width="40%" alt="Light terminal - dark theme" src="https://user-images.githubusercontent.com/5079556/180603528-8a8b60d1-6a1e-4be8-9c18-5e73cae7a24c.png">

<img width="40%" alt="Dark terminal - dark theme" src="https://user-images.githubusercontent.com/5079556/180603526-3618f181-fff3-45c5-b925-061110366adf.png">

**Theme `:light`**


<img width="40%" alt="Light terminal - light theme" src="https://user-images.githubusercontent.com/5079556/180603529-0d8a24af-3d93-4573-afbd-0d354b3145cc.png">

<img width="40%" alt="Dark terminal - light theme" src="https://user-images.githubusercontent.com/5079556/180603527-4d0fcbf7-fbd5-4099-ac78-9236f8b8c782.png">

**Default**

In terms of default, I think `dark` is better than `light`. Because when in a light terminal, seeing a dark dropdown isn't so troubling. But when in a dark terminal, seeing a large light dropdown can bring discomfort to eyes.

Side note: It's possible to detect the terminal's background color from an xterm-compatible terminal emulator ([example gist](https://gist.github.com/blueyed/c8470c2aad3381c33ea3)), so `irb` may automatically assign themes based on users' terminal theme. But we still need to pick a default as the fallback.

**Interface for theme selection**

If we think it's possible to introduce more themes than just dark/light, we can expose the API as 

```rb
IRB.conf[:DIALOG_THEME] = theme_name
```

If we don't consider introducing other themes, we can make it a toggle for the non-default theme, like 

```rb
IRB.conf[:USE_LIGHT_THEME] = true
```


### 2. Per-color configurations

For users who want to configure individual colors, we should also provide options on the `irb` side, like 

```rb
IRB.conf[:dialog_default_bg_color] = :black
```

This prevents directly exposing `reline`'s API to normal `irb` users.


**I implemented the ideas in this [proof of concept PR](https://github.com/ruby/irb/pull/380).**

---Files--------------------------------
Screenshot_20220918_135231.png (70.8 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:109953] [Ruby master Feature#19010] Follow up of #18996: Support changing irb's autocompletion background
  2022-09-18 14:18 [ruby-core:109949] [Ruby master Bug#19010] Follow up of #18996: Support changing irb's autocompletion background st0012 (Stan Lo)
  2022-09-18 17:29 ` [ruby-core:109951] " kaiquekandykoga
  2022-09-18 21:30 ` [ruby-core:109952] " st0012 (Stan Lo)
@ 2022-09-18 22:20 ` kaiquekandykoga
  2022-09-22 23:46 ` [ruby-core:110018] " mame (Yusuke Endoh)
  3 siblings, 0 replies; 5+ messages in thread
From: kaiquekandykoga @ 2022-09-18 22:20 UTC (permalink / raw)
  To: ruby-core

Issue #19010 has been updated by kaiquekandykoga (Kaíque Koga).


I agree and support your arguments.

Thank you for the detailed explanation and the reline's reference.

----------------------------------------
Feature #19010: Follow up of #18996: Support changing irb's autocompletion background
https://bugs.ruby-lang.org/issues/19010#change-99203

* Author: st0012 (Stan Lo)
* Status: Open
* Priority: Normal
----------------------------------------
If the APIs proposed in #18996 (or similar ones) are accepted, we'll be able to configure `irb`'s autocompletion dialog colors.


And for the `irb` side, I want to propose 2 levels of configurations:

#### TL;DR

- Have `dark`/`bright` themes in `irb`
- Use `dark` theme by default because a bright dropdown in dark background is more uncomfortable to read than a dark dropdown in bright background.
- `irb` will pass per-colour configuration to `reline` too. So users can still configure individual colours if they want to.

### 1. Theme selection

Consider most users don't care about individual colors if the text are readable and roughly match with the terminal background, I want to provide 2 basic themes (dark/bright) for users to choose:


**Theme`:dark`**

<img width="40%" alt="Bright terminal - dark theme" src="https://user-images.githubusercontent.com/5079556/180603528-8a8b60d1-6a1e-4be8-9c18-5e73cae7a24c.png">

<img width="40%" alt="Dark terminal - dark theme" src="https://user-images.githubusercontent.com/5079556/180603526-3618f181-fff3-45c5-b925-061110366adf.png">

**Theme `:bright`**


<img width="40%" alt="Bright terminal - bright theme" src="https://user-images.githubusercontent.com/5079556/180603529-0d8a24af-3d93-4573-afbd-0d354b3145cc.png">

<img width="40%" alt="Dark terminal - bright theme" src="https://user-images.githubusercontent.com/5079556/180603527-4d0fcbf7-fbd5-4099-ac78-9236f8b8c782.png">

**Default**

In terms of default, I think `dark` is better than `bright`. Because when in a bright terminal, seeing a dark dropdown isn't so troubling. But when in a dark terminal, seeing a large bright dropdown can bring discomfort to eyes.

Side note: It's possible to detect the terminal's background color from an xterm-compatible terminal emulator ([example gist](https://gist.github.com/blueyed/c8470c2aad3381c33ea3)), so `irb` may automatically assign themes based on users' terminal theme. But we still need to pick a default as the fallback.

**Interface for theme selection**

If we think it's possible to introduce more themes than just dark/bright, we can expose the API as 

```rb
IRB.conf[:DIALOG_THEME] = theme_name
```

If we don't consider introducing other themes, we can make it a toggle for the non-default theme, like 

```rb
IRB.conf[:USE_BRIGHT_THEME] = true
```


### 2. Per-color configurations

For users who want to configure individual colors, we should also provide options on the `irb` side, like 

```rb
IRB.conf[:dialog_default_bg_color] = :black
```

This prevents directly exposing `reline`'s API to normal `irb` users.


**I implemented the ideas in this [proof of concept PR](https://github.com/ruby/irb/pull/380).**

---Files--------------------------------
Screenshot_20220918_135231.png (70.8 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:110018] [Ruby master Feature#19010] Follow up of #18996: Support changing irb's autocompletion background
  2022-09-18 14:18 [ruby-core:109949] [Ruby master Bug#19010] Follow up of #18996: Support changing irb's autocompletion background st0012 (Stan Lo)
                   ` (2 preceding siblings ...)
  2022-09-18 22:20 ` [ruby-core:109953] [Ruby master Feature#19010] " kaiquekandykoga
@ 2022-09-22 23:46 ` mame (Yusuke Endoh)
  3 siblings, 0 replies; 5+ messages in thread
From: mame (Yusuke Endoh) @ 2022-09-22 23:46 UTC (permalink / raw)
  To: ruby-core

Issue #19010 has been updated by mame (Yusuke Endoh).


Briefly discussed at the dev meeting, but we agreed that we need to finish #18996 first.

Here are the opinions expressed at the meeting:

* The color there should be not only for the dialog but also other things (such as the syntax highlight). So `DIALOG_THEME` is not a good name. `IRB_THEME`?
* The names `:dark` and `:bright` is confusing because those who use a bright (white background) terminal must choose `:dark` theme. Better names are wanted.

----------------------------------------
Feature #19010: Follow up of #18996: Support changing irb's autocompletion background
https://bugs.ruby-lang.org/issues/19010#change-99269

* Author: st0012 (Stan Lo)
* Status: Open
* Priority: Normal
----------------------------------------
If the APIs proposed in #18996 (or similar ones) are accepted, we'll be able to configure `irb`'s autocompletion dialog colors.


And for the `irb` side, I want to propose 2 levels of configurations:

#### TL;DR

- Have `dark`/`bright` themes in `irb`
- Use `dark` theme by default because a bright dropdown in dark background is more uncomfortable to read than a dark dropdown in bright background.
- `irb` will pass per-colour configuration to `reline` too. So users can still configure individual colours if they want to.

### 1. Theme selection

Consider most users don't care about individual colors if the text are readable and roughly match with the terminal background, I want to provide 2 basic themes (dark/bright) for users to choose:


**Theme`:dark`**

<img width="40%" alt="Bright terminal - dark theme" src="https://user-images.githubusercontent.com/5079556/180603528-8a8b60d1-6a1e-4be8-9c18-5e73cae7a24c.png">

<img width="40%" alt="Dark terminal - dark theme" src="https://user-images.githubusercontent.com/5079556/180603526-3618f181-fff3-45c5-b925-061110366adf.png">

**Theme `:bright`**


<img width="40%" alt="Bright terminal - bright theme" src="https://user-images.githubusercontent.com/5079556/180603529-0d8a24af-3d93-4573-afbd-0d354b3145cc.png">

<img width="40%" alt="Dark terminal - bright theme" src="https://user-images.githubusercontent.com/5079556/180603527-4d0fcbf7-fbd5-4099-ac78-9236f8b8c782.png">

**Default**

In terms of default, I think `dark` is better than `bright`. Because when in a bright terminal, seeing a dark dropdown isn't so troubling. But when in a dark terminal, seeing a large bright dropdown can bring discomfort to eyes.

Side note: It's possible to detect the terminal's background color from an xterm-compatible terminal emulator ([example gist](https://gist.github.com/blueyed/c8470c2aad3381c33ea3)), so `irb` may automatically assign themes based on users' terminal theme. But we still need to pick a default as the fallback.

**Interface for theme selection**

If we think it's possible to introduce more themes than just dark/bright, we can expose the API as 

```rb
IRB.conf[:DIALOG_THEME] = theme_name
```

If we don't consider introducing other themes, we can make it a toggle for the non-default theme, like 

```rb
IRB.conf[:USE_BRIGHT_THEME] = true
```


### 2. Per-color configurations

For users who want to configure individual colors, we should also provide options on the `irb` side, like 

```rb
IRB.conf[:dialog_default_bg_color] = :black
```

This prevents directly exposing `reline`'s API to normal `irb` users.


**I implemented the ideas in this [proof of concept PR](https://github.com/ruby/irb/pull/380).**

---Files--------------------------------
Screenshot_20220918_135231.png (70.8 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-22 23:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-18 14:18 [ruby-core:109949] [Ruby master Bug#19010] Follow up of #18996: Support changing irb's autocompletion background st0012 (Stan Lo)
2022-09-18 17:29 ` [ruby-core:109951] " kaiquekandykoga
2022-09-18 21:30 ` [ruby-core:109952] " st0012 (Stan Lo)
2022-09-18 22:20 ` [ruby-core:109953] [Ruby master Feature#19010] " kaiquekandykoga
2022-09-22 23:46 ` [ruby-core:110018] " mame (Yusuke Endoh)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).