Fossil Forum

"Current tab" underline in SQLite forum behaving strangely
Login

"Current tab" underline in SQLite forum behaving strangely

"Current tab" underline in SQLite forum behaving strangely

(1) By anonymous on 2021-06-15 08:43:24 [source]

Hi. Noticed the WebApp for the SQLite forum has weird underlining behavior (on Chrome desktop latest):

  • On = (the hamburger menu), the underline is sticky when open.
  • On About the underline goes away, it is not sticky.
  • On Threads, its sticky, but Post also gets a sticky underline.
  • On Post, only itself gets the sticky underline (unlike above).
  • And of course, the SQLite tab completely moves away to a different website.

I'd have expected underlines to only apply to the current tab in sticky fashion, for all tabs (except the last, which is special).

As currently behaving, seems a little haphazard perhaps. Very minor though, of course.

(2) By Stephan Beal (stephan) on 2021-06-15 09:22:47 in reply to 1 [link] [source]

On = (the hamburger menu), the underline is sticky when open.

i'm unable to reproduce that one.

I'd have expected underlines to only apply to the current tab in sticky fashion, for all tabs (except the last, which is special). As currently behaving, seems a little haphazard perhaps.

The underline on the Threads and Post menu entries is part of the CSS applied for the "active" class. That both Threads and Post have that CSS class at the same time looks like a site-specific skin-level bug to me (the main fossil forum site does not have that issue). Only one person here (drh) has admin-level access to the sqlite3 forum to tweak that, though.

Interestingly/strangely, Firefox doesn't underline those at all, despite having the CSS telling it to. It's clearly visible in the browser dev tools but FF seems to be ignoring that aspect of the style (a 2-pixel border along the bottom of those elements). That's just plain weird.

On About the underline goes away, it is not sticky.

That also seems like a skin-level bug: that link is not getting the "active" class assigned to it, so has no underlining. This might (not sure) be a side effect of /about being either a URL alias or intercepted by the front-end web server (it's not a path which comes preinstalled by fossil).

And of course, the SQLite tab completely moves away to a different website.

It is a different site. The forum and source repos are, like for the main fossil project, separate sites and the main sqlite site is not simply a fossil repo like the sqlite forum and fossil's main site are.

(3) By Stephan Beal (stephan) on 2021-06-15 13:54:24 in reply to 2 [link] [source]

The underline on the Threads and Post menu entries is part of the CSS applied for the "active" class. That both Threads and Post have that CSS class at the same time looks like a site-specific skin-level bug to me

Cloning the sqlite forum reveals that it's caused by an overzealous wildcard check in the skin header:

if {[string match /$current_page* $url]}

Threads=>/forum

Post=>/forumnew

So when current_page is Threads, that also matches the Post link.

i'm attempting to patch this locally using th1's regex command instead of string match but have yet to find the magic pattern necessary for that case.

(4.2) By Stephan Beal (stephan) on 2021-06-15 14:58:38 edited from 4.1 in reply to 3 [link] [source]

@drh this skin patch seems to fix the extra "active" flag on the sqlite forum Posts menu entry:

foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {[regexp "/($current_page|$current_page/.+)\$" "$url"]} {
      set class "active $class"
  }
  set url $home$url
  html "<a href='$url' class='$class'>$name</a>\n"
}

This works for me in a local clone, in any case.

Edit: fixed in fossil:769167578b47fcb2 for all skins which do 'active' marking.

(5) By Stephan Beal (stephan) on 2021-06-15 17:23:24 in reply to 1 [link] [source]

On About the underline goes away, it is not sticky. On Threads, its sticky, but Post also gets a sticky underline. On Post, only itself gets the sticky underline (unlike above).

Those are all now resolved and online. Thank you for the report.

On = (the hamburger menu), the underline is sticky when open.

That one i still can't reproduce in FF or Chrome on a desktop, but can imagine that it maybe happens on mobile when tapping on the hamburger (where'd my tablet go?). Apropos: the missing active-menu-entry underlining on Firefox was also fixed.

(6) By Richard Hipp (drh) on 2021-06-15 17:54:45 in reply to 5 [link] [source]

Confirmed: The "active" class is sticky on the hamburger menu on mobile (FF on iPhone in my case) after opening and closing that menu. But if after the menu finishes its opening slide-in, you scroll the screen slightly, or make any other screen interaction, the highlight goes away. Investigating....

(7) By Richard Hipp (drh) on 2021-06-16 10:37:08 in reply to 6 [link] [source]

This is known as the "sticky hover problem". It seems to emerge because mobile browsers activate "hover" on a click but do not deactivate it after the click. There are work-arounds, but they are ugly. In as much as this is a really a bug in the mobile web browsers, we have decided to ignore the problem for now.

(8) By Warren Young (wyoung) on 2021-06-16 19:00:13 in reply to 7 [link] [source]

I wouldn't describe it as a bug but as a conceptual mismatch owing to fundamental differences in input device affordances. Capacitance touch screens don't have a way to reliably detect "hover," and even if they did, no one would want to leave their finger hovering over the screen in same the way that people leave their mouse cursor hovering over a UI element.

I reply not out of pedantry but to show that this problem is insoluble in principle short of delivering two different UIs depending on the target device, the mobile one not trying to do something with "hover" state at all.

Patches thoughtfully considered, y'all. :)

(9) By John Rouillard (rouilj) on 2021-06-16 19:42:23 in reply to 8 [link] [source]

Might adding:

@media (hover: hover) {
  button:hover {
    border: 3px solid green; /* solves sticky problem */
  }
}

per https://css-tricks.com/solving-sticky-hover-states-with-media-hover-hover/ help?

(10) By Stephan Beal (stephan) on 2021-06-16 21:15:03 in reply to 9 [link] [source]

Might adding: @media (hover: hover) ...

We actually tried that, but FF on Android apparently reports that it supports hover (or else it's refusing to reload the page and is stuck with a cached copy - it's seemingly impossible to tell which), so the hover stays stays active on tapping for that browser.

We decided (in /chat) to punt on the problem for the time being. As Warren says, though: patches...