Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions cmd/internal/menu/coursechoose.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import (
"os"
"time"

"amrita_pyq/cmd/internal/configs"
"amrita_pyq/cmd/internal/requestclient"
"amrita_pyq/cmd/util"

"github.com/charmbracelet/huh"
"github.com/charmbracelet/huh/spinner"

"amrita_pyq/cmd/internal/configs"
)

type (
Expand Down Expand Up @@ -49,6 +48,9 @@ func (cs *CourseSelect) ChooseCourse() {
subjects = append(subjects, subject)
options = append(options, huh.NewOption(subject.name, subject.name))
}

// --- Added Go Back and Quit ---
options = append(options, huh.NewOption("Go Back", "Back"))

@Ashrockzzz2003 Ashrockzzz2003 Jan 11, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go back, in the case of course choose page, is the same thing right? Essentially making your change a duplicate of an existing feature of course page

What we need is a stack prolly that can track our path, and then when user chooses go back, we wanna pop one off the stack and go the prev menu.

options = append(options, huh.NewOption("Quit", "Quit"))

// First menu does NOT display history yet
Expand All @@ -67,8 +69,8 @@ func (cs *CourseSelect) ChooseCourse() {
os.Exit(1)
}

// Auto-exit if "Quit" is selected
if selectedOption == "Quit" {
// Auto-exit if "Quit" or "Back" is selected
if selectedOption == "Quit" || selectedOption == "Back" {
util.QuitWithSpinner()
}

Expand Down
Loading