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_component::scroll::ScrollbarMode;
use gpui_component::{ActiveTheme as _, Side, StyledExt as _};
use gpui_component::{ActiveTheme as _, Side};
use crate::invalid_panel::InvalidPanel;
use crate::tab_panel::SignedTabGroupSkin;
@@ -155,27 +155,13 @@ impl DockAreaRenderer for SignedDockSkin {
cx: &mut App,
) -> AnyElement {
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()
.flex()
.flex_none()
.size_full()
.relative()
.overflow_hidden()
.map(|this| match placement {
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| {
// A closed bottom dock keeps a strip, and that strip is the tab bar.
.when(!dock.is_open() && placement.is_bottom(), |this| {
this.h(TAB_BAR_HEIGHT)
})
.child(content)
+1 -1
View File
@@ -198,7 +198,7 @@ impl SignedTabGroupSkin {
DockPlacement::Bottom => area
.layout(DockPlacement::Bottom)
.and_then(|tree| left_top_group(tree.root())),
DockPlacement::Center => None,
DockPlacement::Center => return None,
};
if designated != Some(group.node()) {
return None;
-4
View File
@@ -1707,10 +1707,6 @@ async fn push_staged_to_grasps(
) -> PushOutcome {
let mut outcome = PushOutcome::default();
if refs.is_empty() {
return outcome;
}
for relay in servers {
let Some(base) = grasp_base_url(relay) else {
outcome.servers.push(GraspServerResult::failed(
+1 -6
View File
@@ -1,6 +1,5 @@
use std::collections::HashMap;
use std::sync::Arc;
use std::time::Duration;
use anyhow::Error;
use dock::{BasePanel, DockArea, Panel, PanelEvent};
@@ -21,7 +20,6 @@ use utils::relative_time;
use super::{RepoItem, open_repo_item};
const REFRESH_DEBOUNCE: Duration = Duration::from_millis(300);
const LIST_OVERDRAW: Pixels = px(400.);
const MAX_SUB_ACTIVITIES: usize = 5;
@@ -196,10 +194,7 @@ impl InboxView {
return;
}
self.tasks.push(cx.spawn(async move |this, cx| {
cx.background_executor().timer(REFRESH_DEBOUNCE).await;
this.update(cx, |this, cx| this.run_refresh(cx))
}));
self.run_refresh(cx);
}
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
is precisely the condition of the early return here.
- [ ] Delete the `if !open && !placement.is_bottom() { return div(); }` guard.
- [ ] Stop re-applying `.flex().flex_none().relative().overflow_hidden()` and the
per-placement width/height; base already applies them.
- [ ] Keep the closed-bottom strip height override, but confirm against base's
`CLOSED_BOTTOM_STRIP` that the intended height is `TAB_BAR_HEIGHT`.
- [x] Delete the `if !open && !placement.is_bottom() { return div(); }` guard.
- [x] Stop re-applying the box. The chrome is now `.flex().size_full().relative()`,
the same shape the pinned reference skin (`crates/ui/src/dock/dock.rs`) uses;
base's `dock_frame` supplies the extent and the overflow clip.
- [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,
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`
- [ ] 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
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
`query_inbox` reads only the local database.
- [ ] Delete the `REFRESH_DEBOUNCE` constant.
- [ ] In `refresh`, drop the spawned timer; call `run_refresh` directly after
- [x] Delete the `REFRESH_DEBOUNCE` constant.
- [x] In `refresh`, drop the spawned timer; call `run_refresh` directly after
`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.
### 2.4 `DockPlacement::Center` arms in `dock_toggle_button` (optional)
File: `crates/dock/src/tab_panel.rs`
- [ ] The only call sites pass `Left`, `Bottom`, `Right`. Collapse the `Center`
arms to `unreachable!()` or restructure so the match is exhaustive without
a dead branch.
- [x] The only call sites pass `Left`, `Bottom`, `Right`. The `designated`
match's `Center` arm now returns early instead of yielding a dead `None`;
the icon match keeps `Center => return None` for exhaustiveness.
Low value; skip if it makes the match less readable.