microsoft / pxt-microbit

A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
https://makecode.microbit.org
Other
726 stars 638 forks source link

Hot Potato Python/JS tutorial: Highlight background frame for code is not fit #4131

Open Sheila111 opened 3 years ago

Sheila111 commented 3 years ago

Describe the bug Hot Potato Python/JS tutorial: Highlight background frame for code is not fit

Steps to reproduce the behavior

3-19-2023 -- see note in https://github.com/microsoft/pxt-microbit/issues/4131#issuecomment-1474662251 and later for clarification of expected behavior.

1.Nabigate to https://makecode.microbit.org/beta# 2.Games----->Hot Potato------>Python Start Tutorial 3.Cllick step 3,4,5,6,7

Expect behavior It need to be fit for code image

Actual behavior Hot Potato Python/JS tutorial: Highlight background frame for code is not fit image

Additional context 1.OS: Windows(rs6) 2.makecode.microbit.org version: 3.1.87 3.Microsoft MakeCode version: 6.13.42

ganicke commented 2 years ago

@Sheila111 - The current display appears like this:

image

What is not fitting inside? The text of the code or the area of the yellow highlight?

The code progression from Step 1 to Step 2. The highlight of the difference is correct.

Step 1

def on_button_pressed_a():
    pass
input.on_button_pressed(Button.A, on_button_pressed_a)

Step 2

timer = 0

def on_button_pressed_a():
    global timer
    timer = randint(5, 15)
input.on_button_pressed(Button.A, on_button_pressed_a)

Document view: https://makecode.microbit.org/projects/spy/hot-potato

Sheila111 commented 1 year ago

@ganicke What is not fitting inside? -----> The area of the yellow highlight is too long. Maybe adapting code length is better? image

ganicke commented 1 year ago

@Sheila111 - are you expecting it to look more like this?

image

Sheila111 commented 1 year ago

@ganicke yes, I think it's better for user.

ganicke commented 1 year ago

This is a request to change the css to only highlight the text span in diffs.