Prune commentary and stale Rust port notes
This commit is contained in:
1 parent
5428cd75c9
commit
25370731d0
193 files changed
+693
-16219
No files matched your search
@@ -1,27 +1,7 @@
|
||||
//! A tap on something in the transcript, and holding the reader's edge
|
||||
//! while what they tapped changes height.
|
||||
//!
|
||||
//! Both halves are shared by everything in the transcript that opens: a
|
||||
//! tool card and its group ([`crate::ui::tool`]), and a message's "Show all"
|
||||
//! ([`crate::ui::row`]). They are here rather than in either of those because
|
||||
//! there is one right answer to "was that a tap?" on this screen, and two
|
||||
//! copies of it would eventually disagree -- which on a scrolling screen
|
||||
//! means one of them firing at the end of a pan.
|
||||
|
||||
use crate::ui::selection::Selection;
|
||||
use iris::prelude::*;
|
||||
use std::{cell::RefCell, rc::Rc};
|
||||
|
||||
/// Register `f` as `ptr`'s **tap**, panning the list instead when the
|
||||
/// finger moves.
|
||||
///
|
||||
/// `Selection::drag` with no row is the same call `row.rs` makes with one:
|
||||
/// it drives the shared `DragArbiter`, so a drag starting on a card
|
||||
/// scrolls (and flings) the transcript exactly as one starting on a
|
||||
/// paragraph does, and only a press that committed to nothing comes back
|
||||
/// as `Tapped`. A bare `CursorSense::click()` would be a second,
|
||||
/// disagreeing detector -- it fires at the end of a pan too, so every
|
||||
/// scroll that began on a card would also toggle it.
|
||||
pub(crate) fn on_tap<Rsc: HasEvents>(
|
||||
rsc: &mut Rsc,
|
||||
ptr: WeakWidget<WidgetPtr>,
|
||||
@@ -31,9 +11,6 @@ pub(crate) fn on_tap<Rsc: HasEvents>(
|
||||
) where
|
||||
Rsc::State: FocusHost + OpenUrl,
|
||||
{
|
||||
// The whole `drag_senses()` set -- what any widget driving a
|
||||
// `DragGesture` registers, `Cancel` included. See `row.rs`'s twin
|
||||
// registration for what leaving `Cancel` out did.
|
||||
ptr.on(CursorSense::drag_senses(), move |ctx, rsc| {
|
||||
let outcome = selection.borrow_mut().drag(
|
||||
rsc,
|
||||
@@ -51,29 +28,7 @@ pub(crate) fn on_tap<Rsc: HasEvents>(
|
||||
.add(rsc);
|
||||
}
|
||||
|
||||
/// Hold the edge the reader is looking at while row `key` changes height.
|
||||
///
|
||||
/// `LazySpan::note_tap` wants a viewport-relative position and a row only
|
||||
/// knows its own box, so `LazySpan::extent` (last frame's on-screen box
|
||||
/// for this key) turns the two into the position `lazy_span.rs`'s
|
||||
/// hold-the-edge pass resolves against -- the two-step contract that
|
||||
/// module's doc describes for `AGENTS.md`'s `holdTopEdge`.
|
||||
///
|
||||
/// Call it **before** the change, from every handler that makes a row
|
||||
/// taller or shorter: opening a card, opening a group, asking for the
|
||||
/// whole of a capped block or message. A handler that skips it is one
|
||||
/// where the transcript jumps under the reader's finger.
|
||||
pub(crate) fn hold_edge(rsc: &mut impl UiRsc, list: WeakWidget<LazySpan>, key: RowKey) {
|
||||
// Only when the list actually has an extent for this row. `None`
|
||||
// means the row has not been drawn yet -- which happens the moment
|
||||
// something opens a group before the first frame
|
||||
// (`TranscriptScreen::expand_tail_tools`, the headless screenshot) --
|
||||
// and standing in `0.0` for it tells the layout pass to hold an edge
|
||||
// at the top of the viewport that nothing was ever at. The whole list
|
||||
// then places itself against that invented anchor: rows drawn at each
|
||||
// other's cached heights, tool cards as empty bars with their text a
|
||||
// group's height below them (`docs/bench/p1b-2026-09-06/`'s first
|
||||
// attempt). Nothing to hold is not the same as an edge at zero.
|
||||
if let Some((top, _bottom)) = list(rsc).extent(key) {
|
||||
list(rsc).note_tap(top);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user