Web client comments describe the code to a stranger (#6222)
CI & Build / Build now, or wait for Android? (push) Successful in 2s
Android / Build, or is the channel already serving this? (push) Successful in 2s
CI & Build / Python lint (push) Successful in 2s
Android / Core and FFI clippy and tests (push) Skipped
Android / Kotlin + Rust (APK) (push) Skipped
Android / Build the server image (push) Skipped
Desktop (Tauri) / Build, or is the channel already serving this? (push) Successful in 2s
CI & Build / Web typecheck and unit tests (push) Successful in 10s
CI & Build / Python tests (push) Successful in 13s
CI & Build / integration (push) Successful in 1m40s
CI & Build / Build & push image (push) Successful in 35s
Desktop (Tauri) / Web tests, clippy, Rust tests and rustfmt (push) Successful in 2m20s
Desktop (Tauri) / Windows installer (cross-compiled) (push) Successful in 2m36s
Desktop (Tauri) / Tauri desktop (Linux) (push) Successful in 3m21s
Desktop (Tauri) / Update manifest (push) Successful in 3s
CI & Build / Build now, or wait for Android? (push) Successful in 2s
Android / Build, or is the channel already serving this? (push) Successful in 2s
CI & Build / Python lint (push) Successful in 2s
Android / Core and FFI clippy and tests (push) Skipped
Android / Kotlin + Rust (APK) (push) Skipped
Android / Build the server image (push) Skipped
Desktop (Tauri) / Build, or is the channel already serving this? (push) Successful in 2s
CI & Build / Web typecheck and unit tests (push) Successful in 10s
CI & Build / Python tests (push) Successful in 13s
CI & Build / integration (push) Successful in 1m40s
CI & Build / Build & push image (push) Successful in 35s
Desktop (Tauri) / Web tests, clippy, Rust tests and rustfmt (push) Successful in 2m20s
Desktop (Tauri) / Windows installer (cross-compiled) (push) Successful in 2m36s
Desktop (Tauri) / Tauri desktop (Linux) (push) Successful in 3m21s
Desktop (Tauri) / Update manifest (push) Successful in 3s
Milestone 546 "Bring the repo to the comment standard (rule 32) and compose defaults (rule 198)", step #6222 "Comment standard sweep: web client (frontend/)". Comments, docstrings and template notes across frontend/ now say what the code does and the non-obvious why as present-tense facts. Issue, task, note, milestone and family-idea references are gone, along with narration of what used to happen: the titles index's wiki-link origin and its once-per-session load (#5165), the card-controls overlap a phone showed (task 2697), the M7 and M10.9 labels, and the card unification behind the reminders lens (task 1913). Hazards stay as facts, among them LEAVE_MS matching the editor's leave duration, the Android client twin that must not be widened, and keeping leavers in flow in the multi-column masonry. 62 files, comments only: a comment-stripping diff of every changed file against HEAD is identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,16 +3,9 @@ import { ref } from "vue";
|
||||
/**
|
||||
* The card reorder gesture, shared across every NoteCard on screen.
|
||||
*
|
||||
* Module-level refs on purpose: with native HTML5 drag-and-drop the browser routed
|
||||
* `dragover`/`drop` to whatever element was under the cursor, so each card learned
|
||||
* on its own that it was the drop target. Pointer Events don't work that way — once
|
||||
* a pointer is captured, every move goes to the element that captured it. The card
|
||||
* being dragged therefore has to hit-test for itself and publish the result
|
||||
* somewhere the other cards can see, which is what these are.
|
||||
*
|
||||
* Why replace native DnD at all: its events never fire from touch. It predates
|
||||
* touch and was never wired to it, so on a phone reordering did nothing whatsoever.
|
||||
* Pointer Events cover mouse, touch and stylus on one code path.
|
||||
* Module-level refs: a captured pointer sends every move to the card being dragged,
|
||||
* so it hit-tests for itself and publishes the result here for the other cards.
|
||||
* Pointer Events rather than HTML5 drag-and-drop, which never fires from touch.
|
||||
*/
|
||||
|
||||
/** The card currently being dragged, or null. */
|
||||
@@ -32,10 +25,8 @@ export function endCardDrag(): void {
|
||||
/**
|
||||
* The id of the card under this point, ignoring `self`.
|
||||
*
|
||||
* Reads the DOM rather than tracking geometry because the board is a CSS masonry
|
||||
* (`columns-*`), where the visual order isn't derivable from the model order and
|
||||
* cards reflow as the column count changes. Asking the browser what is actually
|
||||
* under the finger is the only answer that stays true.
|
||||
* Reads the DOM rather than tracking geometry: in a CSS masonry (`columns-*`) the
|
||||
* visual order isn't derivable from the model order.
|
||||
*/
|
||||
export function cardIdAt(x: number, y: number, self: string): string | null {
|
||||
const el = document.elementFromPoint(x, y)?.closest<HTMLElement>("[data-note-id]");
|
||||
|
||||
Reference in New Issue
Block a user