This commit is contained in:
2026-09-13 17:14:45 +07:00
parent a051cb165e
commit 2741ab6ac6
5 changed files with 21 additions and 41 deletions
+4 -18
View File
@@ -15,7 +15,7 @@ use gpui_base::dock::{
}; };
use gpui_base::resize_handle; use gpui_base::resize_handle;
use gpui_component::scroll::ScrollbarMode; use gpui_component::scroll::ScrollbarMode;
use gpui_component::{ActiveTheme as _, Side, StyledExt as _}; use gpui_component::{ActiveTheme as _, Side};
use crate::invalid_panel::InvalidPanel; use crate::invalid_panel::InvalidPanel;
use crate::tab_panel::SignedTabGroupSkin; use crate::tab_panel::SignedTabGroupSkin;
@@ -155,27 +155,13 @@ impl DockAreaRenderer for SignedDockSkin {
cx: &mut App, cx: &mut App,
) -> AnyElement { ) -> AnyElement {
let placement = dock.placement(); let placement = dock.placement();
let open = dock.is_open();
// A closed left or right dock takes no space.
// A closed bottom dock keeps a strip so its tab bar stays clickable.
if !open && !placement.is_bottom() {
return div().into_any_element();
}
div() div()
.flex() .flex()
.flex_none() .size_full()
.relative() .relative()
.overflow_hidden() // A closed bottom dock keeps a strip, and that strip is the tab bar.
.map(|this| match placement { .when(!dock.is_open() && placement.is_bottom(), |this| {
DockPlacement::Left | DockPlacement::Right => this.h_flex().h_full().w(dock.size()),
DockPlacement::Bottom => this.w_full().h(dock.size()),
// Base never builds a dock for the centre.
DockPlacement::Center => this,
})
// The closed bottom dock's strip is the tab bar itself, a full tab bar tall.
.when(!open && placement.is_bottom(), |this| {
this.h(TAB_BAR_HEIGHT) this.h(TAB_BAR_HEIGHT)
}) })
.child(content) .child(content)
+1 -1
View File
@@ -198,7 +198,7 @@ impl SignedTabGroupSkin {
DockPlacement::Bottom => area DockPlacement::Bottom => area
.layout(DockPlacement::Bottom) .layout(DockPlacement::Bottom)
.and_then(|tree| left_top_group(tree.root())), .and_then(|tree| left_top_group(tree.root())),
DockPlacement::Center => None, DockPlacement::Center => return None,
}; };
if designated != Some(group.node()) { if designated != Some(group.node()) {
return None; return None;
-4
View File
@@ -1707,10 +1707,6 @@ async fn push_staged_to_grasps(
) -> PushOutcome { ) -> PushOutcome {
let mut outcome = PushOutcome::default(); let mut outcome = PushOutcome::default();
if refs.is_empty() {
return outcome;
}
for relay in servers { for relay in servers {
let Some(base) = grasp_base_url(relay) else { let Some(base) = grasp_base_url(relay) else {
outcome.servers.push(GraspServerResult::failed( outcome.servers.push(GraspServerResult::failed(
+1 -6
View File
@@ -1,6 +1,5 @@
use std::collections::HashMap; use std::collections::HashMap;
use std::sync::Arc; use std::sync::Arc;
use std::time::Duration;
use anyhow::Error; use anyhow::Error;
use dock::{BasePanel, DockArea, Panel, PanelEvent}; use dock::{BasePanel, DockArea, Panel, PanelEvent};
@@ -21,7 +20,6 @@ use utils::relative_time;
use super::{RepoItem, open_repo_item}; use super::{RepoItem, open_repo_item};
const REFRESH_DEBOUNCE: Duration = Duration::from_millis(300);
const LIST_OVERDRAW: Pixels = px(400.); const LIST_OVERDRAW: Pixels = px(400.);
const MAX_SUB_ACTIVITIES: usize = 5; const MAX_SUB_ACTIVITIES: usize = 5;
@@ -196,10 +194,7 @@ impl InboxView {
return; return;
} }
self.tasks.push(cx.spawn(async move |this, cx| { self.run_refresh(cx);
cx.background_executor().timer(REFRESH_DEBOUNCE).await;
this.update(cx, |this, cx| this.run_refresh(cx))
}));
} }
fn run_refresh(&mut self, cx: &mut Context<Self>) { fn run_refresh(&mut self, cx: &mut Context<Self>) {
+15 -12
View File
@@ -145,11 +145,14 @@ renderer when the extent is `px(0.)`, and wraps the renderer's output in
`dock_frame`. `dock_extent` is `px(0.)` exactly when `!open && !is_bottom`, which `dock_frame`. `dock_extent` is `px(0.)` exactly when `!open && !is_bottom`, which
is precisely the condition of the early return here. is precisely the condition of the early return here.
- [ ] Delete the `if !open && !placement.is_bottom() { return div(); }` guard. - [x] Delete the `if !open && !placement.is_bottom() { return div(); }` guard.
- [ ] Stop re-applying `.flex().flex_none().relative().overflow_hidden()` and the - [x] Stop re-applying the box. The chrome is now `.flex().size_full().relative()`,
per-placement width/height; base already applies them. the same shape the pinned reference skin (`crates/ui/src/dock/dock.rs`) uses;
- [ ] Keep the closed-bottom strip height override, but confirm against base's base's `dock_frame` supplies the extent and the overflow clip.
`CLOSED_BOTTOM_STRIP` that the intended height is `TAB_BAR_HEIGHT`. - [x] Keep the closed-bottom strip height override. Note: base's `dock_frame`
hard-codes `CLOSED_BOTTOM_STRIP` (29px) with `overflow_hidden`, so the
`TAB_BAR_HEIGHT` (44px) override is clipped and has no visible effect. The
strip is 29px today; changing it needs an upstream change.
- [ ] Smoke test: open and close left, bottom, and right docks; check widths, - [ ] Smoke test: open and close left, bottom, and right docks; check widths,
the bottom strip height, and resize handles. the bottom strip height, and resize handles.
@@ -157,7 +160,7 @@ is precisely the condition of the early return here.
File: `crates/signed_state/src/backend.rs` File: `crates/signed_state/src/backend.rs`
- [ ] Delete the `if refs.is_empty() { return outcome; }` guard. - [x] Delete the `if refs.is_empty() { return outcome; }` guard.
All three call sites pass a non-empty `refs`: one passes a literal one-element All three call sites pass a non-empty `refs`: one passes a literal one-element
vec, one is inside `if !refs.is_empty()`, one is the `else` of that check. vec, one is inside `if !refs.is_empty()`, one is the `else` of that check.
@@ -169,19 +172,19 @@ File: `crates/workspace/src/views/inbox.rs`
The backend pump already coalesces relay bursts into one `NostrUpdate`, and The backend pump already coalesces relay bursts into one `NostrUpdate`, and
`query_inbox` reads only the local database. `query_inbox` reads only the local database.
- [ ] Delete the `REFRESH_DEBOUNCE` constant. - [x] Delete the `REFRESH_DEBOUNCE` constant.
- [ ] In `refresh`, drop the spawned timer; call `run_refresh` directly after - [x] In `refresh`, drop the spawned timer; call `run_refresh` directly after
`refresh.request()` returns `Schedule`, matching `RepoStore::refresh`. `refresh.request()` returns `Schedule`, matching `RepoStore::refresh`.
- [ ] Keep `RefreshGate` for fold/overlap. - [x] Keep `RefreshGate` for fold/overlap.
- [ ] Smoke test: inbox updates live as relay events land, with no added delay. - [ ] Smoke test: inbox updates live as relay events land, with no added delay.
### 2.4 `DockPlacement::Center` arms in `dock_toggle_button` (optional) ### 2.4 `DockPlacement::Center` arms in `dock_toggle_button` (optional)
File: `crates/dock/src/tab_panel.rs` File: `crates/dock/src/tab_panel.rs`
- [ ] The only call sites pass `Left`, `Bottom`, `Right`. Collapse the `Center` - [x] The only call sites pass `Left`, `Bottom`, `Right`. The `designated`
arms to `unreachable!()` or restructure so the match is exhaustive without match's `Center` arm now returns early instead of yielding a dead `None`;
a dead branch. the icon match keeps `Center => return None` for exhaustiveness.
Low value; skip if it makes the match less readable. Low value; skip if it makes the match less readable.