Skip to content

FIREFLY-1631: Make it possible to pass table UI options - #82

Merged
jaladh-singhal merged 1 commit into
masterfrom
FIREFLY-1631-tbl-options
Nov 25, 2026
Merged

jaladh-singhal merged 1 commit into
masterfrom
FIREFLY-1631-tbl-options

Conversation

@jaladh-singhal

Copy link
Copy Markdown
Member

Fixes FIREFLY-1631

  • Fixed show_table(options=...) being silently ignored: options were nested inside the table request, but Firefly reads them from the top level of the action payload
  • Added set_table_options(tbl_id, **options) to change display options of a table that is already shown. It dispatches Firefly's tableUi.update action using a predictable UI id (<tbl_id>-ui) that show_table now assigns, and passes options through as-is
  • Documented the table options in both methods by linking Firefly's TblOptions typedef
  • Added examples to docs/usage/viewing-tables.ipynb (setting options in show_table, and changing them later with set_table_options) and to examples/reference-guide.ipynb

Testing

See docs built from this PR branch at https://caltech-ipac.github.io/firefly_client/pr/82/ (Usage > Displaying Tables and Catalogs, and API reference for set_table_options).

To try it out, check out this branch and run docs/usage/viewing-tables.ipynb against a Firefly server:

  • Set display options when showing the table: the Spitzer table should show no column units, and its tab should have no close button
  • Changing the display options: the 2MASS table's filter row, column types, and row-selection checkboxes should disappear

@review-notebook-app

Copy link
Copy Markdown

Review Notebooks

Notebooks changed:

Review visual diffs and comment on any notebook cell. All comments sync back to this PR.


Powered by ReviewNB

@aventura121 aventura121 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good to me. One friendly, minor nit about the use of flat checks like "options and tbl_options.update(options)" not seeming idiomatic to me, but I see it's a convention in this project. No worries, etc. Nice job.

@robyww robyww left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. My only concern it just making sure the the table UI id is always. -ui

Comment on lines +390 to +393
def _get_tbl_ui_id(tbl_id):
"""Return the table UI ID that `show_table()` assigns to a table with ID `tbl_id`."""
return f'{tbl_id}-ui'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is they way we typically do it, but I am not sure that is enforced anywhere. It might be worth checking with @loitly

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm explicitly setting the table ui id in dispatching each show table request so I can depend on it when dispatching set table option.

@jaladh-singhal

Copy link
Copy Markdown
Member Author

One friendly, minor nit about the use of flat checks like "options and tbl_options.update(options)" not seeming idiomatic to me, but I see it's a convention in this project

I agree this is not idiomatic in python but early development on this package brought this convention from JS idioms I believe.

@jaladh-singhal
jaladh-singhal merged commit 2ebcbb7 into master Nov 25, 2026
1 check passed
@jaladh-singhal
jaladh-singhal deleted the FIREFLY-1631-tbl-options branch November 25, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants