Skip to content

refactor: migrate AuthChanged from CommandResult to EventBus #43

Description

@assapir

Background

PR implementing model selection (#3, #34) introduces an EventBus (tokio broadcast channel) for decoupled component communication. The first events are ModelChanged and AuthChanged.

Problem

CommandResult::AuthChanged(String) is currently a special return variant that the REPL loop handles manually to update auth display state. This is the same pattern the EventBus replaces for model changes.

Proposed solution

  • Remove CommandResult::AuthChanged variant
  • Have /login and /logout commands emit Event::AuthChanged on the EventBus instead
  • REPL subscribes to AuthChanged events to update display state (same as it does for ModelChanged)
  • Unifies both patterns under one mechanism

Depends on

  • Model selection PR (introduces the EventBus)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions