bluesky / tiled

API to structured data
https://blueskyproject.io/tiled
BSD 3-Clause "New" or "Revised" License
59 stars 50 forks source link

In the new UI, can the list of runs (by uid) be presented with newest first? #191

Open prjemian opened 2 years ago

prjemian commented 2 years ago

In the tiled web server UI, the list of runs for a catalog is presented in chronological order, with the newest runs at the end.

As the catalog grows in size, the features of the UI make it tedious to see the newest (likely most interesting) content. Such as this example (which would take >70 page loads to reach the end of the list): pager

The standard media player buttons (|< << >> >|) would be helpful but these features might be our of reach for the UI framework.

The ability to sort the list by increasing or decreasing ID (uid) is not useful.

It would be a major advancement to present this list in reverse chronological order by default. Is it possible?

danielballan commented 2 years ago

Sorting works now; click the three dots to the right of the column you want to sort by. Now, for that to solve your problem you need a “time” column to exist. That works too (as shown in the live demo) but we haven’t documented how to do it yet. Will post here later with instructions (it’s easy but I want to double check it).

Reading a little more, I found how to add the pagination buttons in a way that seems reasonable.

danielballan commented 2 years ago

As demonstrated at https://tiled-demo.blueskyproject.io/ui/browse/bmm/raw you can add a time column (would be nice to format it prettier...)

At first "Time" column is switched off:

image

With "Time" column switched on:

image

Clicking three dots to the right of the "Time" column and sorting...

image

How to do this on your own deployment

The details here are still subject to change without notice but this is how the columns are customized to add bluesky-specific columns:

  1. Find share/tiled on your system:
>>> import tiled.utils
>>> tiled.utils.get_share_tiled_path()
'/srv/tiled/venv/share/tiled'
  1. Place this at share/tiled/ui/config/bluesky.yml:
specs:
  - spec: CatalogOfBlueskyRuns
    columns:
      - header: Bluesky Plan
        select_metadata: start.plan_name
        field: plan_name
      - header: Scan ID
        select_metadata: start.scan_id
        field: scan_id
      - header: Time
        select_metadata: start.time
        field: start_time
    default_columns:
      - plan_name
      - scan_id
  1. Place this at share/tiled/ui/configuration_management.yml (replacing the existing file).
# Relative paths to every UI configuration file.
# To extend the UI (teaching it about additional formats or specs)
# add new configuration. All of these will be loaded.
manifest:
  - config/default.yml
  - config/bluesky.yml
prjemian commented 2 years ago

Was only missing the configuration_management.yml file. Still not getting any columns other than the uid. Questioning my setup.

In [1]: import tiled

In [2]: tiled.__version__
Out[2]: '0.1.0a57'

What about shared/tiled/ui/configuration_manifest.yml? Looks very similar. The share/tiled directory is ~/.conda/envs/tiled/share/tiled

Running in a screen session in directory ~/.local/share/intake/tiled (for some historical reasons, that's where my tiled_config.yml file is located now):

(tiled) jemian@wow ~/.../intake/tiled $ more start_tiled_server.sh 
#!/bin/bash

SERVER_HOST=$(hostname)
SERVER_PORT=8010
CONFIG_FILE=./tiled_config.yml

source /APSshare/miniconda/x86_64/bin/activate tiled

tiled serve config \
    --host "${SERVER_HOST}" \
    --port "${SERVER_PORT}" \
    "${CONFIG_FILE}"
prjemian commented 2 years ago

It's configuration_manifest.yml, per: https://github.com/bluesky/tiled/blob/4ff2f6189ec9a9c4003f3f7272fe05cd3922709f/web-frontend/src/config.ts#L33

danielballan commented 2 years ago

Oops, indeed it is. Sorry about that.

Works now?

prjemian commented 2 years ago

Nope, only ID on the three bullet menu. Restarting tiled server each time.

On Wed, Mar 30, 2022, 8:02 AM Dan Allan @.***> wrote:

Oops, indeed it is. Sorry about that.

Works now?

— Reply to this email directly, view it on GitHub https://github.com/bluesky/tiled/issues/191#issuecomment-1083112999, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARMUMCYGSJ5FFHW7ES6KL3VCRGFLANCNFSM5RVHNTUQ . You are receiving this because you authored the thread.Message ID: @.***>

danielballan commented 2 years ago

This configuration is cached in the browser sessionStorage to avoid paying the cost of re-loading it every time.

Try clearing that cache. In Chrome it looks like this:

image

danielballan commented 2 years ago

This episode is evidence that maybe it would be better not to cache it....

prjemian commented 2 years ago

Quickest way to test is use a different browser which has not yet visited this web site.

prjemian commented 2 years ago

Confirmed the edits work, using a fresh browser.

prjemian commented 2 years ago

Using the original browser, the new configuration was "found" by waiting until the next day, without any steps to clear the cache. I assume this code expired from the cache.

prjemian commented 2 years ago

Browsers involved were:

danielballan commented 2 years ago

Thanks. I think I'll pull back on the amount of caching here.

prjemian commented 1 year ago

Still a problem with 0.1.0a75