Bug #4836

[Workbench] Ensure first tab content loads when shown, even if location hash indicated a different tab during initial page render

Added by Tom Clegg almost 7 years ago. Updated over 6 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Brett Smith
Category:
Workbench
Target version:
Start date:
01/05/2015
Due date:
% Done:

100%

Estimated time:
(Total: 1.00 h)
Story points:
0.5

Description

These two links show me one collection in the Data collections tab.

However, if I load this page...

...the tab heading says "Data collections (1)" but when I click it, I get a table with name and description headings but no collections.

It looks like the "load content for collections table" trigger fires during initial page load (and only if that tab is active), and should also (instead?) fire when that tab/table is first exposed.


Subtasks

Task #4870: Review 4836-first-tab-load-wip and merge if goodResolvedBrett Smith

Associated revisions

Revision 1a72b1b7
Added by Brett Smith over 6 years ago

Merge branch '4836-first-tab-load-wip'

Closes #4836, #4870.

History

#1 Updated by Tom Clegg almost 7 years ago

  • Description updated (diff)
  • Category set to Workbench

#2 Updated by Brett Smith over 6 years ago

  • Assigned To set to Brett Smith
  • Target version changed from Bug Triage to 2015-01-07 sprint

#3 Updated by Tom Clegg over 6 years ago

  • Status changed from New to In Progress

#4 Updated by Tom Clegg over 6 years ago

At 3233ded:

Diagnosis makes sense, thank you.

However, I suspect the is(':visible') test is still needed. Even though it's no longer needed to prevent infinite-scroll content from going into the wrong div, it is needed to prevent infinite-scroll content from being loaded into an invisible div merely because it would have reached its load threshold if it were visible. For example, with 3233ded, I can do this:
  1. View my home project (lots of content on collections and jobs/pipelines tabs)
  2. Click the jobs/pipelines tab (first page of j/p loads)
  3. Click the collections tab (first page of collections loads)
  4. Scroll down
  5. The infinite scroll code notices I have scrolled beyond threshold for the j/p content, and (according to chrome network activity) loads another page of j/p. But this is a (probably) a waste of time, because I'm not even looking at that tab.
Would something like this address the issue, without causing invisible content to be loaded?
  • $(document).on('shown.bs.tab', function() {
        $('.infinite-scroller').trigger('scroll');
    });
    

#5 Updated by Brett Smith over 6 years ago

Tom Clegg wrote:

Would something like this address the issue, without causing invisible content to be loaded?

That makes sense, thanks for catching that. Implemented with some additional bounds checking in ab6840d1. Ready for another look.

#6 Updated by Tom Clegg over 6 years ago

ab6840d1 LGTM, thanks.

#7 Updated by Brett Smith over 6 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Applied in changeset arvados|commit:1a72b1b7b46d771129c1ec93221a5934fa33ef75.

Also available in: Atom PDF