Repository: vscode
Issue: responsive GUI regarding `search.smartCase`
Labels: feature-request,search,polish

<!-- ⚠️⚠️ Do Not Delete This! feature_request_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. -->

## Introduction

I'd like to present several proposals regarding the representation of `search.smartCase` within the "match case" button interface. These proposals aim to enhance user experience by providing clearer visual cues about the current search mode. The options include:

- Minimal Modification: Conceal the "match case" button to introduce minimal change and serve as a temporary solution.
- Original Design Fulfillment: Implement the design as outlined in issue #42687, which offers a suitable method to indicate the current search mode.
- Ternary State Introduction: Introduce a new state for the "match case" button to more accurately reflect the current search status, albeit at the complexity's expense.

## Background

Since its inception in January 2018 (version 1.20), `search.smartCase` has been a significant feature. However, its subtle operation often leaves users unaware of its activation, leading to confusion. This issue has been echoed in multiple reports:

- #190022
- #187960
- #174452

## Issue Statement

Upon reviewing the design mentioned in #42687, it appears its full potential has not been realized in the current implementation. The design proposed four distinct states to signify the interaction between the user's input and the "match case" functionality.
![original-design](https://user-images.githubusercontent.com/323878/35653008-f89c2dee-069a-11e8-9ce3-8207e69cd09e.png)
**state A**: searching with all lowercase with "match case" off
**state B**: searching with uppercase, with "match case" off -> `search.smartCase` is activated, which turns on "match case" in a non-sticky way.
**state C**: searching with uppercase, from **state B**, a click turns off "match case". By my assumption, this remembers "smart case" is off for this search, to distinguish from **state A**.
**state D**: searching with uppercase, from **state C**, a click turns on "match case", in a sticky way.

However, my experience, especially with version 1.87.0-insider at commit e73419bef379f7956f024557cbf40bd3755a0645, suggests a deviation from these intended states, particularly never encountering the transitional "smart case" activation state. This deviation might be tolerable if intended as a simplification, yet it inadvertently complicates user interaction and understanding, especially concerning the elusive state C.

## Proposals for Enhancement

### Minimal Modification: Concealing the "Match Case" Button

Given the current functionality of `search.smartCase`:

1. Ignoring case with entirely lowercase input.
2. Searching exclusively in lowercase with lowercase input.
3. Conducting a case-sensitive search with any uppercase input, rendering the "match case" button superfluous.

This proposal suggests hiding the "match case" button when `search.smartCase` activates with uppercase input. This adjustment would subtly inform advanced users of the feature's activation, simplifying the interface.

### Original Design Fulfillment: Comprehensive Implementation of #42687

Adhering more closely to the original design would enhance the graphical user interface by vividly demonstrating the state of `search.smartCase`. This approach may require additional development to align with the current behavior of `search.smartCase`, but it promises a more intuitive user experience by clarifying the logic behind state transitions, especially state C.

### Ternary State Introduction: A New Dimension for the "Match Case" Button

Considering the ambiguity surrounding **state C** in the original proposal, introducing a ternary state ("on", "off", and "smart case") for the "match case" button could provide a clearer representation of the search's current state. This approach, while more complex, enriches the user interface by indicating the active mode of `search.smartCase` through distinctive icons (e.g., hollow/solid stars for "smart case" activation).
![smart-match-case](https://github.com/microsoft/vscode/assets/36828324/49173c9a-dfdd-4110-8437-fde83184f5ee)
(Designing the icon is hard for me, this is just the idea)

- hollow(left): "match case" in "smart case" mode, but all search text is lowercase
- solid(right): "match case" in "smart case" mode, and there are uppercase letters in the search text

## Further Discussion and Contribution

I invite @roblourens and @octref to engage in further discussion about this topic, particularly around `ripgrep` integration and optimal representations of case sensitivity in search functionalities. Additionally, I've prepared a flowchart to facilitate understanding of the proposed "smart case" and "match case" functionalities and I added a flowchart to help understand the logic of the "smart case" and "match case" button.
<img width="788" alt="image" src="https://github.com/microsoft/vscode/assets/36828324/55d656a1-a096-4091-ae5b-d86ccf8271de"> <!-- markdownlint-disable MD033 -->

I am eager to contribute to either the Minimal Modification or Ternary State proposals through a pull request

<!-- Describe the feature you'd like. -->