Skip to content

Commit

Permalink
First pass to Re-design the dashboard
Browse files Browse the repository at this point in the history
This is a first pass in which only the dashboard
navigation widget and the "Settings" pane have
been revisited.

Reference work:
- https://app.abstract.com/share/54f1465e-8d1c-4e7b-9ae4-f37e21bef7fe
  • Loading branch information
gorhill committed Apr 5, 2020
1 parent 20332c6 commit 453f545
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 149 deletions.
4 changes: 0 additions & 4 deletions src/css/dashboard-common.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ input[type="checkbox"][disabled] + label {
.para {
width: 40em;
}
.synopsis {
display: inline-block;
padding: 0.25em 0;
}
.whatisthis {
margin: 0 0 0 8px;
border: 0;
Expand Down
76 changes: 25 additions & 51 deletions src/css/dashboard.css
Original file line number Diff line number Diff line change
@@ -1,69 +1,54 @@
html, body {
margin: 0;
border: 0;
font: 16px/24px sans-serif;
height: 100%;
margin: 0;
overflow: hidden;
padding: 0;
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
}
@media screen and (max-device-width: 960px) {
#dashboard-nav {
zoom: 1.2;
}
}
#dashboard-nav {
background-color: #f9f9fb;
border: 0;
margin: 0;
border-bottom: 1px solid rgba(14, 13, 26, 0.12);
display: flex;
flex-wrap: wrap;
overflow-x: hidden;
padding: 0;
position: sticky;
top: 0;
width: 100%;
z-index: 10;
}
#dashboard-nav-widgets {
align-items: stretch;
background-color: white;
border-bottom: 1px solid #ccc;
display: flex;
margin: 0;
padding: 4px 0 0;
white-space: nowrap;
}
#dashboard-nav-widgets > span {
#dashboard-nav > span {
align-items: center;
display: inline-flex;
padding: 0 0.5em;
width: 1.25em;
}
#dashboard-nav-widgets > span > img {
#dashboard-nav > span > img {
width: 100%;
}
.tabButton {
background-color: #eee;
border: 1px solid #ccc;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-bottom: 1px solid #ccc;
color: black;
border: 0;
border-bottom: 3px solid #f9f9fb;
box-sizing: border-box;
color: #20123a;
cursor: pointer;
display: inline-block;
font-size: 110%;
margin: 0 0.2em 0 0;
overflow: hidden;
padding: 4px;
position: relative;
padding: 0.5em 1.5em;
text-decoration: none;
top: 1px;
white-space: nowrap;
}
.tabButton:focus {
outline: 0;
}
.tabButton:active,.tabButton:visited {
color: inherit;
color: #20123a;
}
.tabButton.selected {
background-color: white;
border-bottom: 1px solid white;
border-bottom: 3px solid #592acb;
color: #592acb;
}
iframe {
background-color: transparent;
Expand Down Expand Up @@ -97,20 +82,9 @@ body:not(.canUpdateShortcuts) .tabButton[href="#shortcuts.html"] {
display: none;
}

@media (max-width: 640px) {
@media (pointer: coarse) {
#dashboard-nav {
position: relative;
}
#dashboard-nav-widgets {
padding: 1px 0 0 0;
}
.hverbose {
display: none !important;
}
.tabButton {
font-size: 90%;
}
.tabButton.selected {
border-bottom: 1px solid #ccc;
}
flex-wrap: nowrap;
overflow-x: auto;
}
}
55 changes: 31 additions & 24 deletions src/css/settings.css
Original file line number Diff line number Diff line change
@@ -1,37 +1,44 @@
ul {
padding-left: 1em;
padding-right: 0;
body {
border: 0;
font: 16px/24px sans-serif;
margin: 0;
padding: 0;
}
hr {
border: 0;
border-top: 1px solid #ccc;
margin: 1.5em 0;
}
.body {
color: #20123a;
margin-top: 1em;
}
body[dir="rtl"] ul {
padding-left: 0;
padding-right: 1em;
.entries {
margin: 0.5em 0;
}
ul#userSettings {
padding-left: 0;
.section {
font-size: large;
font-weight: bold;
margin-top: 0.75em;
}
li {
margin-top: 0.25em;
.synopsis {
font-size: smaller;
}
ul#userSettings,
ul#userSettings ul {
list-style-type: none;
.entry {
align-items: baseline;
display: flex;
margin: 0.5em 0;
}
ul#userSettings .subgroup {
margin-top: 1em;
.entry > * {
margin-inline-end: 0.5em;
-webkit-margin-end: 0.5em;
}
ul#userSettings .subgroup > span {
font-size: larger;
font-weight: bold;
.entry > input[type="checkbox"] {
align-self: center;
}
#advanced-user-enabled ~ a.fa {
display: none;
}
body.advancedUser #advanced-user-enabled ~ a.fa {
display: inline;
}
#localData > ul > li {
margin-top: 1em;
}
#localData > ul > li > ul > li:nth-of-type(2) {
font-family: monospace;
}
22 changes: 10 additions & 12 deletions src/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,23 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<title data-i18n="dashboardName"></title>
<link href="css/dashboard.css" rel="stylesheet" type="text/css">
<link href="css/common.css" rel="stylesheet" type="text/css">
<link href="css/dashboard.css" rel="stylesheet" type="text/css">
<link rel="shortcut icon" type="image/png" href="img/icon_16.png"/>
</head>

<body>
<div id="dashboard-nav">
<div id="dashboard-nav-widgets">
<span class="hverbose" data-i18n-title="extName"><img src="img/ublock.svg"></span><!--
--><a class="tabButton" href="#settings.html" data-i18n="settingsPageName"></a><!--
--><a class="tabButton" href="#3p-filters.html" data-i18n="3pPageName"></a><!--
--><a class="tabButton" href="#1p-filters.html" data-i18n="1pPageName"></a><!--
--><a class="tabButton" href="#dyna-rules.html" data-i18n="rulesPageName"></a><!--
--><a class="tabButton" href="#whitelist.html" data-i18n="whitelistPageName"></a><!--
--><a class="tabButton" href="#shortcuts.html" data-i18n="shortcutsPageName"></a><!--
--><a class="tabButton" href="#about.html" data-i18n="aboutPageName"></a>
</div>
<span class="hverbose" ><img data-i18n-title="extName" src="img/ublock.svg"></span><!--
--><a class="tabButton" href="#settings.html" data-i18n="settingsPageName"></a><!--
--><a class="tabButton" href="#3p-filters.html" data-i18n="3pPageName"></a><!--
--><a class="tabButton" href="#1p-filters.html" data-i18n="1pPageName"></a><!--
--><a class="tabButton" href="#dyna-rules.html" data-i18n="rulesPageName"></a><!--
--><a class="tabButton" href="#whitelist.html" data-i18n="whitelistPageName"></a><!--
--><a class="tabButton" href="#shortcuts.html" data-i18n="shortcutsPageName"></a><!--
--><a class="tabButton" href="#about.html" data-i18n="aboutPageName"></a>
</div>
<div id="unsavedWarning">
<div>
Expand Down
9 changes: 6 additions & 3 deletions src/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,15 @@ const discardUnsavedData = function(synchronous = false) {
};

const loadDashboardPanel = function(pane, first) {
const tabButton = uDom(`[href="#${pane}"]`);
if ( !tabButton || tabButton.hasClass('selected') ) { return; }
const tabButton = uDom.nodeFromSelector(`[href="#${pane}"]`);
if ( tabButton === null || tabButton.classList.contains('selected') ) {
return;
}
const loadPane = ( ) => {
self.location.replace(`#${pane}`);
uDom('.tabButton.selected').toggleClass('selected', false);
tabButton.toggleClass('selected', true);
tabButton.classList.add('selected');
tabButton.scrollIntoView();
uDom.nodeFromId('iframe').setAttribute('src', pane);
vAPI.localStorage.setItem('dashboardLastVisitedPane', pane);
};
Expand Down
27 changes: 13 additions & 14 deletions src/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,11 @@ const exportToFile = async function() {
/******************************************************************************/

const onLocalDataReceived = function(details) {
uDom('#localData > ul > li:nth-of-type(1)').text(
vAPI.i18n('settingsStorageUsed')
.replace(
'{{value}}',
typeof details.storageUsed === 'number' ? details.storageUsed.toLocaleString() : '?'
)
);
uDom.nodeFromId('storageUsed').textContent =
vAPI.i18n('settingsStorageUsed').replace(
'{{value}}',
typeof details.storageUsed === 'number' ? details.storageUsed.toLocaleString() : '?'
);

const timeOptions = {
weekday: 'long',
Expand All @@ -138,18 +136,19 @@ const onLocalDataReceived = function(details) {
const lastBackupFile = details.lastBackupFile || '';
if ( lastBackupFile !== '' ) {
const dt = new Date(details.lastBackupTime);
uDom('#localData > ul > li:nth-of-type(2) > ul > li:nth-of-type(1)').text(dt.toLocaleString('fullwide', timeOptions));
//uDom('#localData > ul > li:nth-of-type(2) > ul > li:nth-of-type(2)').text(lastBackupFile);
uDom('#localData > ul > li:nth-of-type(2)').css('display', '');
const text = vAPI.i18n('settingsLastBackupPrompt');
const node = uDom.nodeFromId('settingsLastBackupPrompt');
node.textContent = text + '\xA0' + dt.toLocaleString('fullwide', timeOptions);
node.style.display = '';
}

const lastRestoreFile = details.lastRestoreFile || '';
uDom('#localData > p:nth-of-type(3)');
if ( lastRestoreFile !== '' ) {
const dt = new Date(details.lastRestoreTime);
uDom('#localData > ul > li:nth-of-type(3) > ul > li:nth-of-type(1)').text(dt.toLocaleString('fullwide', timeOptions));
uDom('#localData > ul > li:nth-of-type(3) > ul > li:nth-of-type(2)').text(lastRestoreFile);
uDom('#localData > ul > li:nth-of-type(3)').css('display', '');
const text = vAPI.i18n('settingsLastRestorePrompt');
const node = uDom.nodeFromId('settingsLastRestorePrompt');
node.textContent = text + '\xA0' + dt.toLocaleString('fullwide', timeOptions);
node.style.display = '';
}

if ( details.cloudStorageSupported === false ) {
Expand Down
Loading

8 comments on commit 453f545

@gwarser
Copy link
Contributor

@gwarser gwarser commented on 453f545 Apr 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I miss in new mobile interface is quick access to version info.

@gorhill
Copy link
Owner Author

@gorhill gorhill commented on 453f545 Apr 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could comment about this at https://share.goabstract.com/54f1465e-8d1c-4e7b-9ae4-f37e21bef7fe?collectionLayerId=5d7b3b93-381e-42c6-ab6a-404ed874f520&sha=95d331bab08df7e733f2aa54eb60fc5acff40765?

I don't have an account there so I don't know if just creating an account would allow to comment. Maybe there could be a small label out of the way somewhere in the popup panel with the version number.

@uBlock-user
Copy link
Contributor

@uBlock-user uBlock-user commented on 453f545 Apr 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

font size in the settings pane have become noticably larger, was this intentional ?

font: 16px/24px sans-serif;

is noticably higher than the previous one, will this be customizable in future builds ?

@gorhill
Copy link
Owner Author

@gorhill gorhill commented on 453f545 Apr 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Firefox Preview design, I was suggested to use 16px/24px.

I will use 14px/21px as default size, and use 16px/24px for touchscreen devices.

@uBlock-user
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will use 14px/21px as default size

Yes, that's the previous setting and this new setting jumps right into my face when I open the settings page.

@gwarser
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version information on top:

unnamed1


Version information on the bottom:

unnamed2
unnamed3

@gorhill
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am undecided for now. I prefer to not put back the title bar, it existed only because originally this was how I made the dashboard accessible.

So currently I lean toward rendering the version at the bottom, but I feel this should be more discrete, it's not a key piece of information related to the current web site.

@gorhill
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I finally went with the second suggestion, with a minor change: since the version line can also be toggled on/off (like the firewall panel), it is shown before the firewall panel instead of after.

cc @brampitoyo

Please sign in to comment.