pxt-microbit icon indicating copy to clipboard operation
pxt-microbit copied to clipboard

Open Instruction in editor Help doc which is a wrong place

Open v-katherine opened this issue 1 year ago • 1 comments

Describe the bug Open Instruction in editor Help doc which is a wrong place

Steps to reproduce the behavior 1.Navigate to https://makecode.microbit.org/beta. 2.Radio Games->Mood Radio->Show Instructions. 3.Observe it.

Actual behavior: Open instruction in editor Help doc section.

Expected behavior: Open instruction in a new tab.

Screen Recording: Instruction

Additional context: 1.OS: Windows 11 2.makecode.microbit,org version: 7.0.4 3.Microsoft MakeCode version: 10.0.11

v-katherine avatar Mar 12 '24 03:03 v-katherine

Expected behavior: Open the instruction in a new tab. Expected

v-katherine avatar Mar 12 '24 03:03 v-katherine

This bug also reproduced in Radio Games->Tele-potato->Show Instructions Tools->Analog Pin Tester->Show Instructions Tools->Servo Calibrator->Show Instructions Turtle->Spiral->Show Instruction Turtle->Scanner->Show Instruction Blocks to JavaScript->Hello JavaScript->Show Instruction Blocks to JavaScript->Starter Blocks->Show Instruction Blocks to JavaScript->Writing Code->Show Instruction Blocks to JavaScript->Complex Conditionals->Show Instruction Blocks to JavaScript->Conditional Loops->Show Instruction Blocks to JavaScript->Command Responder->Show Instruction Blocks to JavaScript->Writing Functions->Show Instruction

v-katherine avatar Mar 15 '24 07:03 v-katherine

@abchatra, @v-katherine - So, this is really a question of whether an activity page is opened as a sidedoc in the editor or as a doc page in a separate window. This is determined by the cardType field in the gallery entry (side or link, the default). In both cases though, the Show Instructions label is on the launch button (default case)...

function codeCardButtonLabel(cardType: string, youTubeId?: string, youTubePlaylistId?: string) {
    if (cardType == "tutorial")
        return lf("Start Tutorial");
    else if (cardType == "codeExample" || cardType == "example")
        return lf("Open Example");
    else if (cardType == "forumUrl")
        return lf("Open in Forum");
    else if (cardType == "sharedExample")
        return lf("Open in Editor");
    else if (cardType == "template")
        return lf("New Project");
    else if (youTubeId)
        return lf("Watch Video");
    else if (youTubePlaylistId)
        return lf("Watch Playlist");
    return lf("Show Instructions");
}

This might make one think that both side and link type cards will open in a separate window when the former actually opens in the editor. We could add cardType == "side" to the Open in Editor case or make a new case that sets the label to Show in Editor or something similar to that?

ganicke avatar Jul 18 '24 22:07 ganicke

@ganicke makes sense. Thanks for clarifiying.

abchatra avatar Jul 19 '24 16:07 abchatra