On touch, a tap on a post opens its thread
On a phone the only way into a post's thread was a small Expand button (and now an entry in More), while a tap on the post pinned it to a globe that is usually hidden there, outlining the card. Where the pointer can't hover, a tap on a post that isn't on its links, controls or menus and doesn't end a text selection opens its thread through the card's own thread link (main.js, data-thread on the card); cards are pinned to the globe with a mouse only. The globe's corner stats have 12px text on touch. Phone flow: a tap in a post's margin opens its thread and pins nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
1 parent
da8f4ffcab
commit
7b1bfa71c0
5 files changed
+39
-5
No files matched your search
@@ -123,6 +123,23 @@ window.clearAppBadge = () => {
|
||||
window.logFromJs(e.message, "clearAppBadge")
|
||||
}
|
||||
}
|
||||
// On a touch screen a tap on a post (not on its links, controls or menus, and not ending a text selection) opens its
|
||||
// thread, through the card's own thread link (Content.razor, data-thread-link), which Blazor's router takes.
|
||||
document.addEventListener("click", event => {
|
||||
try {
|
||||
if (window.matchMedia("(hover: hover)").matches || !(event.target instanceof Element))
|
||||
return
|
||||
const card = event.target.closest("[data-thread]")
|
||||
if (!card || event.target.closest("a, button, input, textarea, select, label, summary, video, audio, [role=button], .dropdown, .modal, [data-sheet]"))
|
||||
return
|
||||
if (!window.getSelection()?.isCollapsed)
|
||||
return
|
||||
card.querySelector("a[data-thread-link]")?.click()
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
window.logFromJs(e.message, "openThread")
|
||||
}
|
||||
})
|
||||
window.canHover = () => {
|
||||
try {
|
||||
return window.matchMedia("(hover: hover)").matches
|
||||
|
||||
Reference in new issue
Block a user