Skip to content

Commit

Permalink
Enhance browser search experience (#2621)
Browse files Browse the repository at this point in the history
* Change DOM order of left sidebar

* Change flex order to bring sidebar to left visually

* Update test package files to reflect the changes
  • Loading branch information
CaptainIRS authored Apr 22, 2021
1 parent 6efbf78 commit 819b1c4
Show file tree
Hide file tree
Showing 31 changed files with 185 additions and 179 deletions.
3 changes: 3 additions & 0 deletions lib/resources/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ main {

.sidebar-offcanvas-left {
flex: 0 1 230px;
order: 1;
overflow-y: scroll;
padding: 20px 0 15px 30px;
margin: 5px 20px 0 0;
Expand All @@ -93,13 +94,15 @@ main {

.main-content {
flex: 1;
order: 2;
overflow-y: scroll;
padding: 10px 20px 0 20px;
visibility: hidden; /* shown by Javascript after scroll position restore */
}

.sidebar-offcanvas-right {
flex: 0 1 12em;
order: 3;
overflow-y: scroll;
padding: 20px 15px 15px 15px;
margin-top: 5px;
Expand Down
12 changes: 6 additions & 6 deletions lib/templates/html/404error.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{{>head}}

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5><span class="package-name">{{self.name}}</span> <span class="package-kind">{{self.kind}}</span></h5>
{{>packages}}
</div>

<div id="dartdoc-main-content" class="main-content">
<h1>404: Something's gone wrong :-(</h1>

Expand All @@ -21,6 +15,12 @@ <h1>404: Something's gone wrong :-(</h1>
</section>
</div> <!-- /.main-content -->

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5><span class="package-name">{{self.name}}</span> <span class="package-kind">{{self.kind}}</span></h5>
{{>packages}}
</div>

<div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
</div>

Expand Down
13 changes: 7 additions & 6 deletions lib/templates/html/category.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{{>head}}

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5><span class="package-name">{{parent.name}}</span> <span class="package-kind">{{parent.kind}}</span></h5>
{{>packages}}
</div>

<div id="dartdoc-main-content" class="main-content">
{{#self}}
<h1><span class="kind-category">{{name}}</span> {{kind}}</h1>
Expand Down Expand Up @@ -121,6 +115,13 @@ <h2>Exceptions / Errors</h2>
{{/self}}

</div> <!-- /.main-content -->

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5><span class="package-name">{{parent.name}}</span> <span class="package-kind">{{parent.kind}}</span></h5>
{{>packages}}
</div>

<div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
<h5>{{self.name}} {{self.kind}}</h5>
{{>sidebar_for_category}}
Expand Down
12 changes: 6 additions & 6 deletions lib/templates/html/class.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{{>head}}

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{{sidebarForLibrary}}}
</div>

<div id="dartdoc-main-content" class="main-content">
{{#self}}
<div>{{>source_link}}<h1><span class="kind-class">{{{nameWithGenerics}}}</span> {{kind}} {{>feature_set}} {{>categorization}}</h1></div>
Expand Down Expand Up @@ -173,6 +167,12 @@ <h2>Constants</h2>

</div> <!-- /.main-content -->

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{{sidebarForLibrary}}}
</div>

<div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
{{{sidebarForContainer}}}
</div><!--/.sidebar-offcanvas-->
Expand Down
12 changes: 6 additions & 6 deletions lib/templates/html/constructor.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{{>head}}

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{{sidebarForContainer}}}
</div><!--/.sidebar-offcanvas-left-->

<div id="dartdoc-main-content" class="main-content">
{{#self}}
<div>{{>source_link}}<h1><span class="kind-constructor">{{{nameWithGenerics}}}</span> {{kind}} {{>feature_set}}</h1></div>
Expand Down Expand Up @@ -33,6 +27,12 @@ <h5>{{parent.name}} {{parent.kind}}</h5>
{{/constructor}}
</div> <!-- /.main-content -->

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{{sidebarForContainer}}}
</div><!--/.sidebar-offcanvas-left-->

<div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
</div><!--/.sidebar-offcanvas-->

Expand Down
12 changes: 6 additions & 6 deletions lib/templates/html/enum.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{{>head}}

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{{sidebarForLibrary}}}
</div>

<div id="dartdoc-main-content" class="main-content">
{{#self}}
<div>{{>source_link}}<h1><span class="kind-enum">{{{name}}}</span> {{kind}} {{>feature_set}} {{>categorization}}</h1></div>
Expand Down Expand Up @@ -163,6 +157,12 @@ <h2>Static Methods</h2>
{{/eNum}}
</div> <!-- /.main-content -->

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{{sidebarForLibrary}}}
</div>

<div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
{{{sidebarForContainer}}}
</div><!--/.sidebar-offcanvas-->
Expand Down
12 changes: 6 additions & 6 deletions lib/templates/html/extension.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{{>head}}

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{{sidebarForLibrary}}}
</div>

<div id="dartdoc-main-content" class="main-content">
{{#self}}
<div>{{>source_link}}<h1><span class="kind-class">{{{nameWithGenerics}}}</span> {{kind}} {{>feature_set}} {{>categorization}}</h1></div>
Expand Down Expand Up @@ -98,6 +92,12 @@ <h2>Constants</h2>

</div> <!-- /.main-content -->

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{{sidebarForLibrary}}}
</div>

<div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
{{{sidebarForContainer}}}
</div><!--/.sidebar-offcanvas-->
Expand Down
12 changes: 6 additions & 6 deletions lib/templates/html/function.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{{>head}}

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{{sidebarForLibrary}}}
</div><!--/.sidebar-offcanvas-left-->

<div id="dartdoc-main-content" class="main-content">
{{#self}}
<div>{{>source_link}}<h1><span class="kind-function">{{{nameWithGenerics}}}</span> {{kind}} {{>feature_set}} {{>categorization}}</h1></div>
Expand All @@ -22,6 +16,12 @@ <h5>{{parent.name}} {{parent.kind}}</h5>
{{/function}}
</div> <!-- /.main-content -->

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{{sidebarForLibrary}}}
</div><!--/.sidebar-offcanvas-left-->

<div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
</div><!--/.sidebar-offcanvas-->

Expand Down
12 changes: 6 additions & 6 deletions lib/templates/html/index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{{>head}}

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5 class="hidden-xs"><span class="package-name">{{self.name}}</span> <span class="package-kind">{{self.kind}}</span></h5>
{{>packages}}
</div>

<div id="dartdoc-main-content" class="main-content">
{{#defaultPackage}}
{{>documentation}}
Expand Down Expand Up @@ -35,6 +29,12 @@ <h3>{{name}}</h3>

</div> <!-- /.main-content -->

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5 class="hidden-xs"><span class="package-name">{{self.name}}</span> <span class="package-kind">{{self.kind}}</span></h5>
{{>packages}}
</div>

<div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
</div>

Expand Down
12 changes: 6 additions & 6 deletions lib/templates/html/library.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{{>head}}

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5><span class="package-name">{{parent.name}}</span> <span class="package-kind">{{parent.kind}}</span></h5>
{{>packages}}
</div>

<div id="dartdoc-main-content" class="main-content">
{{#self}}
<div>{{>source_link}}<h1><span class="kind-library">{{{name}}}</span> {{kind}} {{>feature_set}} {{>categorization}}</h1></div>
Expand Down Expand Up @@ -125,6 +119,12 @@ <h2>Exceptions / Errors</h2>

</div> <!-- /.main-content -->

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5><span class="package-name">{{parent.name}}</span> <span class="package-kind">{{parent.kind}}</span></h5>
{{>packages}}
</div>

<div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
<h5>{{self.name}} {{self.kind}}</h5>
{{{sidebarForLibrary}}}
Expand Down
12 changes: 6 additions & 6 deletions lib/templates/html/method.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{{>head}}

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{{sidebarForContainer}}}
</div><!--/.sidebar-offcanvas-->

<div id="dartdoc-main-content" class="main-content">
{{#self}}
<div>{{>source_link}}<h1><span class="kind-method">{{{nameWithGenerics}}}</span> {{kind}} {{>feature_set}}</h1></div>
Expand All @@ -23,6 +17,12 @@ <h5>{{parent.name}} {{parent.kind}}</h5>
{{/method}}
</div> <!-- /.main-content -->

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{{sidebarForContainer}}}
</div><!--/.sidebar-offcanvas-->

<div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
</div><!--/.sidebar-offcanvas-->

Expand Down
12 changes: 6 additions & 6 deletions lib/templates/html/mixin.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{{>head}}

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{{sidebarForLibrary}}}
</div>

<div id="dartdoc-main-content" class="main-content">
{{#self}}
<div>{{>source_link}}<h1><span class="kind-mixin">{{{nameWithGenerics}}}</span> {{kind}} {{>feature_set}} {{>categorization}}</h1></div>
Expand Down Expand Up @@ -172,6 +166,12 @@ <h2>Constants</h2>
{{/mixin}}
</div> <!-- /.main-content -->

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{{sidebarForLibrary}}}
</div>

<div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
{{{sidebarForContainer}}}
</div><!--/.sidebar-offcanvas-->
Expand Down
12 changes: 6 additions & 6 deletions lib/templates/html/property.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{{>head}}

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{{sidebarForContainer}}}
</div><!--/.sidebar-offcanvas-->

<div id="dartdoc-main-content" class="main-content">
{{#self}}
<div>{{>source_link}}<h1><span class="kind-property">{{name}}</span> {{kind}} {{>feature_set}}</h1></div>
Expand Down Expand Up @@ -34,6 +28,12 @@ <h5>{{parent.name}} {{parent.kind}}</h5>
{{/self}}
</div> <!-- /.main-content -->

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{{sidebarForContainer}}}
</div><!--/.sidebar-offcanvas-->

<div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
</div><!--/.sidebar-offcanvas-->

Expand Down
12 changes: 6 additions & 6 deletions lib/templates/html/top_level_property.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{{>head}}

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{{sidebarForLibrary}}}
</div><!--/.sidebar-offcanvas-left-->

<div id="dartdoc-main-content" class="main-content">
{{#self}}
<div>{{>source_link}}<h1><span class="kind-top-level-property">{{{name}}}</span> {{kind}} {{>feature_set}} {{>categorization}}</h1></div>
Expand All @@ -30,6 +24,12 @@ <h5>{{parent.name}} {{parent.kind}}</h5>
{{/self}}
</div> <!-- /.main-content -->

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{{sidebarForLibrary}}}
</div><!--/.sidebar-offcanvas-left-->

<div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
</div><!--/.sidebar-offcanvas-->

Expand Down
12 changes: 6 additions & 6 deletions lib/templates/html/typedef.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{{>head}}

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{{sidebarForLibrary}}}
</div><!--/.sidebar-offcanvas-left-->

<div id="dartdoc-main-content" class="main-content">
{{#self}}
<div>{{>source_link}}<h1><span class="kind-typedef">{{{nameWithGenerics}}}</span> {{kind}} {{>feature_set}} {{>categorization}}</h1></div>
Expand All @@ -24,6 +18,12 @@ <h5>{{parent.name}} {{parent.kind}}</h5>

</div> <!-- /.main-content -->

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{{sidebarForLibrary}}}
</div><!--/.sidebar-offcanvas-left-->

<div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
</div><!--/.sidebar-offcanvas-->

Expand Down
12 changes: 6 additions & 6 deletions testing/test_package_custom_templates/templates/404error.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{{>head}}

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5><span class="package-name">{{self.name}}</span> <span class="package-kind">{{self.kind}}</span></h5>
{{>packages}}
</div>

<div id="dartdoc-main-content" class="main-content">
<h1>404: Something's gone wrong :-(</h1>

Expand All @@ -21,6 +15,12 @@ <h1>404: Something's gone wrong :-(</h1>
</section>
</div> <!-- /.main-content -->

<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5><span class="package-name">{{self.name}}</span> <span class="package-kind">{{self.kind}}</span></h5>
{{>packages}}
</div>

<div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
</div>

Expand Down
Loading

0 comments on commit 819b1c4

Please sign in to comment.