tiled icon indicating copy to clipboard operation
tiled copied to clipboard

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

Open prjemian opened this issue 2 years ago • 14 comments

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?

prjemian avatar Mar 25 '22 20:03 prjemian

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 avatar Mar 26 '22 19:03 danielballan

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

danielballan avatar Mar 29 '22 20:03 danielballan

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 avatar Mar 29 '22 21:03 prjemian

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

prjemian avatar Mar 29 '22 21:03 prjemian

Oops, indeed it is. Sorry about that.

Works now?

danielballan avatar Mar 30 '22 13:03 danielballan

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: @.***>

prjemian avatar Mar 30 '22 13:03 prjemian

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 avatar Mar 30 '22 18:03 danielballan

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

danielballan avatar Mar 30 '22 18:03 danielballan

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

prjemian avatar Mar 30 '22 18:03 prjemian

Confirmed the edits work, using a fresh browser.

prjemian avatar Mar 30 '22 20:03 prjemian

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 avatar Mar 31 '22 15:03 prjemian

Browsers involved were:

  • firefox (original)
  • brave (fresh)

prjemian avatar Mar 31 '22 15:03 prjemian

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

danielballan avatar Mar 31 '22 16:03 danielballan

Still a problem with 0.1.0a75

prjemian avatar Nov 22 '22 20:11 prjemian