Coder Social home page Coder Social logo

Comments (9)

simonw avatar simonw commented on July 24, 2024

This may also be an option to help solve a bit of a "mystery meat" navigation problem: the cog icon doesn't exactly help people understand what it's for, and there's a good chance people are missing it completely.

Showing the icon along with a menu label might be better:

⚙️ Database actions

And:

⚙️ Table actions

For example.

from datasette.

simonw avatar simonw commented on July 24, 2024

The word "actions" is a bit weird but I think it's OK here? Could mock it up and see how it feels.

from datasette.

simonw avatar simonw commented on July 24, 2024

Initial prototype:

<!DOCTYPE html>
<html>
<head>
    <style>
body { font-family: helvetica; }
        .icon-text {
font-size: 16px; 
            display: inline-flex;
            align-items: center;
            border: 2px solid #666;
            border-radius: 6px;
            padding: 6px 14px 4px 8px; 
        }
.icon-text:hover { background-color: #ccc; cursor: pointer; }
        .icon {
            width: 22px;
            height: 22px;
            margin-right: 4px;
        }
    </style>
</head>
<body>
    <div class="icon-text">
        <svg class="icon" aria-labelledby="actions-menu-links-title" role="img" style="color: #666" xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
            <title id="actions-menu-links-title">Table actions</title>
            <circle cx="12" cy="12" r="3"></circle>
            <path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
        </svg>
        <span>Table actions</span>
    </div>
</body>
</html>

table-actions

from datasette.

simonw avatar simonw commented on July 24, 2024

New mockup:

table-actions-mockup

from datasette.

simonw avatar simonw commented on July 24, 2024

Implementation needs a bit more thought because I have to unwind some of the old styles that I used to get the cog to show where it did before (various flex and inline things) - I don't want to leave stale styles in there.

from datasette.

simonw avatar simonw commented on July 24, 2024

acec927 is what I have so far. Needs a good amount of CSS cleanup, plus I'd like to add the little tip as seen on the column menus:

CleanShot 2024-02-23 at 14 13 17@2x

And set the hover color to the same as the color used on the menu items.

from datasette.

simonw avatar simonw commented on July 24, 2024

Now looks like this:

hook-preview

from datasette.

simonw avatar simonw commented on July 24, 2024

Potential alternative design:

CleanShot 2024-02-23 at 15 02 41@2x

diff --git a/datasette/static/app.css b/datasette/static/app.css
index 1fabf7da..ac29ec56 100644
--- a/datasette/static/app.css
+++ b/datasette/static/app.css
@@ -376,9 +376,10 @@ details .nav-menu-inner {
     font-size: 15px;
     display: inline-flex;
     align-items: center;
-    border: 2px solid #666;
     border-radius: 6px;
     padding: 5px 12px 3px 7px;
+    color: #fff;
+    background: linear-gradient(180deg, #4B91F7 0%, #367AF6 100%);
 }
 .page-action-menu .icon-text span {
     /* Nudge text up a bit */
diff --git a/datasette/templates/table.html b/datasette/templates/table.html
index 80eac602..0c2be672 100644
--- a/datasette/templates/table.html
+++ b/datasette/templates/table.html
@@ -29,7 +29,7 @@
 <details class="actions-menu-links details-menu">
     <summary>
         <div class="icon-text">
-            <svg class="icon" aria-labelledby="actions-menu-links-title" role="img" style="color: #666" xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+            <svg class="icon" aria-labelledby="actions-menu-links-title" role="img" style="color: #fff" xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                 <title id="actions-menu-links-title">Table actions</title>
                 <circle cx="12" cy="12" r="3"></circle>
                 <path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>

from datasette.

simonw avatar simonw commented on July 24, 2024

On iOS Safari:

C0934AEE-53D5-4E4E-AAEA-B6585DEFA844_1_201_a

2F64034D-83DC-4916-8F62-939EFDCC1C71_1_201_a

066B3F04-C6AA-4063-B6AB-6EEA834F3D2E_1_201_a

AD270AE7-9243-4111-BED6-CC15634063F6_1_201_a

from datasette.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.