fix(app): one hover bar at a time, readable API errors
- The hover bar of the message below no longer shows a second bar on the message it overlaps; the bar occludes the rows beneath it - Error notices put the Graph message before the URL, so the cut-off notice still shows the reason Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -1545,13 +1545,11 @@ impl ConversationView {
1545
1545
}
1546
1546
1547
1547
fn toolbar_visible(&self, key: &str) -> bool {
1548
[
1549
&self.hovered_message,
1550
&self.toolbar_hovered,
1551
&self.toolbar_pinned,
1552
]
1553
.iter()
1554
.any(|slot| slot.as_deref() == Some(key))
1548
self.toolbar_pinned
1549
.as_deref()
1550
.or(self.toolbar_hovered.as_deref())
1551
.or(self.hovered_message.as_deref())
1552
== Some(key)
1555
1553
}
1556
1554
1557
1555
fn toggle_reaction(&mut self, message_id: &str, glyph: &str, cx: &mut Context<Self>) {
@@ -1545,13 +1545,11 @@ impl ConversationView {1545
}1545
}1546
1546
1547
fn toolbar_visible(&self, key: &str) -> bool {1547
fn toolbar_visible(&self, key: &str) -> bool {1548
[1548
self.toolbar_pinned1549
&self.hovered_message,1549
.as_deref()1550
&self.toolbar_hovered,1550
.or(self.toolbar_hovered.as_deref())1551
&self.toolbar_pinned,1551
.or(self.hovered_message.as_deref())1552
]1552
== Some(key)1553
.iter()1554
.any(|slot| slot.as_deref() == Some(key))1555
}1553
}1556
1554
1557
fn toggle_reaction(&mut self, message_id: &str, glyph: &str, cx: &mut Context<Self>) {1555
fn toggle_reaction(&mut self, message_id: &str, glyph: &str, cx: &mut Context<Self>) {@@ -166,6 +166,7 @@ pub fn message_toolbar(menu: MessageMenu) -> AnyElement {
166
166
.bg(theme::surface())
167
167
.border_1()
168
168
.border_color(theme::border_strong())
169
.occlude()
169
170
.on_hover(move |hovered, _, cx| hover(*hovered, cx))
170
171
.on_mouse_down(MouseButton::Left, |_, _, cx| {
171
172
GlobalState::suppress_text_selection(cx)
@@ -166,6 +166,7 @@ pub fn message_toolbar(menu: MessageMenu) -> AnyElement {166
.bg(theme::surface())166
.bg(theme::surface())167
.border_1()167
.border_1()168
.border_color(theme::border_strong())168
.border_color(theme::border_strong())169
.occlude()169
.on_hover(move |hovered, _, cx| hover(*hovered, cx))170
.on_hover(move |hovered, _, cx| hover(*hovered, cx))170
.on_mouse_down(MouseButton::Left, |_, _, cx| {171
.on_mouse_down(MouseButton::Left, |_, _, cx| {171
GlobalState::suppress_text_selection(cx)172
GlobalState::suppress_text_selection(cx)@@ -12,7 +12,7 @@ pub enum Error {
12
12
LoginRequired(String),
13
13
#[error("no fresh token for {scope}{detail}")]
14
14
NoFreshToken { scope: String, detail: String },
15
#[error("HTTP {status} from {url}: {message}")]
15
#[error("HTTP {status}: {message} ({url})")]
16
16
Api {
17
17
status: u16,
18
18
url: String,
@@ -49,7 +49,7 @@ mod tests {
49
49
#[test]
50
50
fn api_error_uses_graph_message() {
51
51
let error = Error::api(403, "https://graph.microsoft.com/v1.0/me", json!({"error": {"message": "Forbidden"}}));
52
assert_eq!(error.to_string(), "HTTP 403 from https://graph.microsoft.com/v1.0/me: Forbidden");
52
assert_eq!(error.to_string(), "HTTP 403: Forbidden (https://graph.microsoft.com/v1.0/me)");
53
53
}
54
54
55
55
#[test]
@@ -12,7 +12,7 @@ pub enum Error {12
LoginRequired(String),12
LoginRequired(String),13
#[error("no fresh token for {scope}{detail}")]13
#[error("no fresh token for {scope}{detail}")]14
NoFreshToken { scope: String, detail: String },14
NoFreshToken { scope: String, detail: String },15
#[error("HTTP {status} from {url}: {message}")]15
#[error("HTTP {status}: {message} ({url})")]16
Api {16
Api {17
status: u16,17
status: u16,18
url: String,18
url: String,@@ -49,7 +49,7 @@ mod tests {49
#[test]49
#[test]50
fn api_error_uses_graph_message() {50
fn api_error_uses_graph_message() {51
let error = Error::api(403, "https://graph.microsoft.com/v1.0/me", json!({"error": {"message": "Forbidden"}}));51
let error = Error::api(403, "https://graph.microsoft.com/v1.0/me", json!({"error": {"message": "Forbidden"}}));52
assert_eq!(error.to_string(), "HTTP 403 from https://graph.microsoft.com/v1.0/me: Forbidden");52
assert_eq!(error.to_string(), "HTTP 403: Forbidden (https://graph.microsoft.com/v1.0/me)");53
}53
}54
54
55
#[test]55
#[test]