Skip to content

UI improvements#103

Merged
Nayjest merged 4 commits intomainfrom
ui-improvements
Jan 11, 2026
Merged

UI improvements#103
Nayjest merged 4 commits intomainfrom
ui-improvements

Conversation

@Nayjest
Copy link
Owner

@Nayjest Nayjest commented Jan 11, 2026

No description provided.

- bugfix: reset color after info / debug / error / warning
- ask_yn, ask_choose: improve messaging
- ask_yn: highlight default with bright text style
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Nayjest
Copy link
Owner Author

Nayjest commented Jan 11, 2026

@gito fix 1

@github-actions
Copy link

I've Reviewed the Code

This PR updates GitHub Actions dependencies to newer versions, bumps the gito.bot package from 3.1 to 3.6, refactors the UI module to consolidate terminal color output through a single info function with proper color reset, improves the ask_yn prompt styling, and contains two bugs related to undefined variables (bright, magenta) and incorrect boolean handling (if default: instead of if default is True:).

⚠️ 2 issues found across 5 files

#1 Undefined variables bright and magenta used in ask_yn

microcore/ui.py L45-L48

The function ask_yn uses bright("y") and magenta on lines 46-48, but these variables are defined later in the file (lines 133 and 138). At the point where ask_yn is called, these names will not be resolved correctly if the module hasn't fully loaded, and more critically, they are referenced before their definition in the module's execution order. However, since Python resolves names at runtime and the function is only called after module load, this will work. But the issue is that bright and magenta are used inconsistently - in one branch bright("y") is called as a function returning a styled string, but magenta is used as a string for concatenation without the reset. This creates inconsistent styling.
Tags: bug
Affected code:

45:     if default:
46:         yn = bright("y") + magenta + "/n"
47:     else:
48:         yn = "y/" + bright('n')

Proposed change:

    if default:
        yn = bright("y") + magenta("/n")
    else:
        yn = magenta("y/") + bright('n')

#2 Logic error: if default: treats False same as None

microcore/ui.py L45

The condition if default: on line 45 will be False when default=False, treating it the same as default=None. This means when the user explicitly passes default=False, the prompt will incorrectly highlight 'n' as bright (correct behavior), but the logic conflates two distinct cases. The condition should check if default is True: to properly distinguish between True, False, and None states.
Tags: bug
Affected code:

45:     if default:

Proposed change:

    if default is True:

@Nayjest Nayjest merged commit ab5823e into main Jan 11, 2026
10 checks passed
@Nayjest Nayjest deleted the ui-improvements branch January 14, 2026 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments