Serial monitor and switch case

Good day,
I am using a potentiometer to adjust the brightness of individually adressable LED, aka the NeoPixels. By using Serial monitor I am sending letters to the board to switch between different programs. With the code I got now, I can adjust the brightness, but when I try to switch to another statement; let’s say after typing “a”, then bringing the LED to a desired brightness level, I will type “b”, but I am getting stuck in case “a”. As an easy solution to that I tried closing and opening the Serial monitor, then typed another letter and it works but the brightness level is that of the previous case. Whenever I switch to another case, I need the LED to be completely off, so that when I start using the potentiometer first value would be 0. Can anyone help this noob please?

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif

const int PIXEL_PIN = 10; // NeoPixel input on digital 8.
const int POT_PIN = A1; // Potentiometer output on analog 0.

Adafruit_NeoPixel strip = Adafruit_NeoPixel(400, PIXEL_PIN, NEO_GRBW + NEO_KHZ800);

int alpha = 0;
int reading = 0;
char useCase;

void setup() {
  Serial.begin(9600);
  
  strip.begin();
  strip.show();
}

void loop() {
  if (Serial.available()){
    useCase = Serial.read();
    switch (useCase){
      case 'a':       // Front, Statisch, Rot
      while(useCase == 'a'){
        reading = analogRead(POT_PIN);
        alpha = map(reading, 0, 1023, 0, 255);
        Serial.println(alpha);
        strip.fill(strip.Color(alpha, 0, 0, 0), 116, 353);
        strip.show();
        delay(100);
      }   
      break;
          
      case 'b':       // Front, Statisch, Grün    
      while(useCase == 'b'){
        reading = analogRead(POT_PIN);
        alpha = map(reading, 0, 1023, 0, 255);
        Serial.println(alpha);
        strip.fill(strip.Color(0, alpha, 0, 0), 116, 353);
        strip.show();
        delay(100);
      }
      break;
//some other useCases
   }
  }
}
     case 'a':       // Front, Statisch, Rot
        while (useCase == 'a')
        {
          reading = analogRead(POT_PIN);
          alpha = map(reading, 0, 1023, 0, 255);
          Serial.println(alpha);
          strip.fill(strip.Color(alpha, 0, 0, 0), 116, 353);
          strip.show();
          delay(100);
        }
        break;

Once in case 'a' when will useCase not be equal to 'a' thus allowing the case code to end ? Do away with the while loop and let the loop() function do the looping for you. To do this you need to take the switch/case out of the test for Serial data being available so that the value of useCase stays the same until a different value is entered

You might also change your read statement to:

    useCase = tolower(Serial.read());

just in case the user has the Caps Lock on.

for further interest..
the problem is not always the code I guess. Potentiometer is a mechanical device and even though I change the code to reset the value to 0 after every use case, it physically cannot start at 0 again, since the user previously would have adjusted the value to something else.