1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
//! The §8.3 **Login** surface: brazen's browser sign-in flow.
//!
//! **It is a tab focus, not a fold in the roster** (bl-1ca2). It used to be a `ui.collapsing` inside the left
//! panel, where opening it put ten provider rows and a live command stream
//! into a column sized for conversation titles. It is now one of the §11
//! center tabs ([`super::center`]), reached by the left-panel entry that names
//! it, by the strip, or by Command+Shift+3 — and the auth-failed banner in the
//! conversation still renders the same [`login_section`] inline where the
//! wound is (§11), which is one machinery in two seats, not two surfaces.
//!
//! Coverage-excluded egui glue (the `src/shell/*` precedent, §12). Its one
//! mutating affordance is Login (§8.3 as amended, bz's sole interactive
//! surface): a per-provider button spawns
//! `bz --login --provider <row> --browser` through the streamed-piped class
//! ([`crate::login`]) and paints its lines live — **stderr included**, which is
//! where bz writes the authorize URL and any failure's reason and remedy —
//! converging to an outcome (and, on a non-zero exit, the exact run-by-hand
//! fallback).
//!
//! **Every row states its own state in words** (bl-402f): its credential fact
//! ("signed in" / "not signed in" / "no credential needed" / "no credential
//! stored") beside the name, and then either the Login verb or — for a row
//! brazen's table says cannot be signed in — the reason there is none
//! ("keyless — nothing to log in", "api-key provider — set the key in Config").
//! A dead button hiding its reason behind a hover was the defect; a row that
//! could only exit 78 now renders no verb at all. Both facts come from
//! [`ProviderRowView`] — the same derivation the §9.5 config rows render, so
//! the two surfaces cannot say different things about one provider.
//!
//! Everything it calls — the row derivation and its capability read, [`LoginRun`]
//! poll/finalize — is covered; only these widgets are not.
//!
//! *Was the toolchain pane* until §16.7 W13 deleted the phase-1 capability gate
//! it fronted: with the substrates embedded as exact-pinned crates there is no
//! host-tool verdict to render and no install command to show (§16.4), so what
//! remains of the pane is exactly the Login surface it always also carried.
use Path;
use crateCli;
use crateProviderRowView;
use crate;
use cratetheme;
use LoginHolder;
/// The Login surface (§8.3): offer a Login per provider row, and paint the
/// active streamed run. The rows are brazen's effective provider table — read
/// **in-process** through the linked crate since §16.7 W10 (#20/#21, built-ins
/// included) — and they are already there: [`LoginHolder::new`] asks at
/// construction (bl-e290), so this surface opens populated and `↻ providers`
/// is a **re-**ask for after a config edit, not the way rows first appear.
/// `pub(super)`: the §11 Login tab and the conversation center's auth-failed
/// banner both paint it (§11) — one machinery, two seats.
pub
/// One provider row: its name, its credential fact in words, and then the Login
/// verb — but **only** where `bz --login` can serve the row (§8.3 as amended by
/// bl-402f). Everywhere else the verb is replaced by the reason there is none,
/// in the same place the button would have been: a row is never a dim shape the
/// operator has to click to learn about. Returns whether Login was clicked.
///
/// The verb is laid **first** (§11 rule 1b, [`super::row::control_last`]): name
/// and fact are greedy text, and laid before the button they ate the row and
/// left `[ … ]` in place of Login — on `claude-session-direct`, the longest
/// name brazen's table carries, which is exactly the row an operator who is not
/// signed in has to press (bl-bc06).
///
/// **The trailing slot holds a control, never prose** (bl-5410). The blocked
/// branch used to pin the reason there, and a sentence pinned at its natural
/// width is not a control: at 420x320 the reason alone (221 pt) was wider than
/// the 194 pt pane, so the row was allocated from the right edge *leftwards past
/// its own left edge* and the whole row — name, fact and reason — was clipped
/// on the left, mid-glyph, with no ellipsis anywhere. Rule 1b buys the verb by
/// pinning it; it cannot buy a paragraph. So the reason takes the line beneath
/// the row and **wraps** there, where it is bounded by the pane on one axis and
/// free on the other, and nothing is cut at any width.
pub
/// Paint the active login run: every line bz printed — **both** streams, in
/// arrival order, verbatim (§8.3); bz's authorize URL and its terminal
/// error/remedy line both ride stderr, so both land here. Then, once settled,
/// the outcome and, on a non-zero exit, the run-by-hand fallback (§8.3).