This commit is contained in:
2026-09-13 17:18:54 +07:00
parent 2741ab6ac6
commit 4be75253cd
8 changed files with 136 additions and 103 deletions
+27 -13
View File
@@ -199,30 +199,44 @@ Verify the duplication before extracting; each could be intentional.
Files: `crates/workspace/src/views/pull_requests/mod.rs`,
`crates/workspace/src/views/issues/mod.rs`
- [ ] Confirm the filter enum, visible-index rebuild, counts tuple, and
virtual-list resize are the same shape.
- [ ] If so, extract one small helper for the filtered index + counts + notify
decision and use it in both.
- [x] Confirm the shape. The two `rebuild`s are the same mechanic: one pass over a
root list, per-status counts, keep matching indices, early-return when
filter/indices/counts are unchanged, resize the item sizes, notify.
- [x] Extract `crates/workspace/src/views/status_list.rs` with `StatusCounts` and
`filter_by_status`. Both views now use it; the tuple counts were replaced by
`StatusCounts`. The notify decision stays local because it would need a trait
over the two filter enums.
### 3.2 Relay URL normalize/display
Files: `crates/workspace/src/views/sidebar/settings_dialog.rs`,
`crates/workspace/src/views/sidebar/grasp_servers.rs`
- [ ] Confirm both pairs do prepend-scheme, parse, dedupe, and host-display.
- [ ] Extract one normalize helper and one display helper. Decide the crate
(check whether `signed_ui` may depend on `nostr`).
- [x] Confirm both pairs do prepend-scheme, parse, dedupe, and host-display.
- [x] Extract `normalize_server` and `server_host` into `sidebar/mod.rs`. They live
in `workspace`, not `signed_ui`: `signed_ui` does not depend on `nostr`, and
these are used only by the two sidebar modules. Dedupe differs per caller
(`Vec<RelayUrl>` vs persisted `Vec<String>`) and stays at the call site.
### 3.3 `crates/dock` vs the pinned `gpui_component` dock renderer
Files: `crates/dock/src/*` vs the pinned rev's `crates/ui/src/dock/*`
- [ ] Spike only: pick one part (`SignedTabGroupSkin` or `SignedTilesSkin`) and
determine whether it can delegate to the upstream `DockSkin` trait
implementation and keep only the Signed deltas (window controls in the tab
bar, plain-sidebar detection, prev/next, i18n).
- [ ] Report effort and risk before doing any replacement. Do not start a
rewrite of this crate in this cleanup.
- [x] Spike: `SignedTabGroupSkin` cannot delegate to the pinned upstream skin.
- `TabGroupSkin`, `TilesSkin` and `SkinShared` are `pub(crate)` in
`gpui_component::ui`; only the opaque `DockSkin` renderer is public, and it
holds that private shared state.
- `TabGroupRenderer`/`TilesRenderer` are all-or-nothing per method. The
Signed deltas (window controls, prev/next, plain-sidebar detection, i18n)
live *inside* `render_tab_bar` and `frame`. There is no hook below the whole
method, so "delegate and keep only the deltas" has no seam to hang on.
- Composing `Rc<DockSkin>` would still leave `render_tab_bar` a near-full
reimplementation while adding a dependency on upstream internals, for no
line reduction.
- [x] Effort/risk: high effort, high churn, no achievable reduction on this rev.
`SignedTilesSkin` is the same shape. Recommend keeping the fork as-is. A
future upstream change (public `DockSkin` with per-part hooks) would be the
precondition for any delegation.
---