Skip to content

Tables window details view and other fixes#5997

Open
Baaaaaz wants to merge 9 commits into
RPTools:developfrom
Baaaaaz:feature/2248-tables-window-details-view-and-other-fixes
Open

Tables window details view and other fixes#5997
Baaaaaz wants to merge 9 commits into
RPTools:developfrom
Baaaaaz:feature/2248-tables-window-details-view-and-other-fixes

Conversation

@Baaaaaz

@Baaaaaz Baaaaaz commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Identify the Bug or Feature request

closes #2248

Description of the Change

Provide an optional details view of the tables window in a tabular format. Views can be selected via new toggle buttons in the table window. The details view shows a different set of columns for a GM than a player. Default is the existing Image Panel.

Changes:

  • LookupTableFunction#processMutatedLookupTable() - > centralize handling of table updates from MTScript functions in the same class) to the server and refresh of the LookupTablePanel
  • LookupTableMacro -> updated logging to use I18N.
  • LookupTablePanel - switch to use a CardLayout and addition of the LookupTableDetailsTablePanel.
  • LookupTablePanelView -> Addition of toggle buttons (and associated new button icons) to switch between the image panel and the details table panel.
  • CampaignManager -> adding resetting the temp lookup table.
  • LookupTable -> new methods to get counts of entries, entries with values, and entries with images.
  • MapTool -> reset and refresh the LookupTablePanel when setting a campaign (e.g. resolves stale LookupTablePanel when clients connecting to a server or when gm loads campaign with clients connected).
  • AppActions -> only allow GMs to add default tables (otherwise players may override customised tables with the same names in a connected campaign). Corrected issue where if a server was running and the gm added the default tables, they would not be show in connected clients' Table window.
  • EditLookupTablePanel -> if the lookup table name changes (and is not a new table), delete the original lookup table on the server

New:

  • LookupTableDetailsTablePanel -> Implements a scrollable details table based on the underlying model.
  • LookupTableDetailsTablePanelModel -> Defines the table and (GM/Player) columns for the LookupTableDetailsTablePanel. Employs snapshot list of LookupTables to avoid race conditions when updating the JTable.
  • LookupTableDetailsTableColumnRenderers -> based on the column metadata specify which column renderer to use, one of:
    • TableColumnAlignedRenderers - align columns
    • TableColumnDisabledBooleanRenderer - disable checkboxes
    • TableColumnIconRenderer - fit images to the table row height
Role Image View Details View
Player image image
GM image image

Possible Drawbacks

  • Trying to find all the ways LookupTables get updated across clients was challenging - hopefully I have not missed any.
  • I may not have done things in the best way... so would welcome feedback here!
  • Players can no longer load default tables into a campaign (and overwrite any other tables with the same name)- pretty sure this is undesirable behavior. The GM can still load them okay and now they will appear correctly on clients.

Documentation Notes

  • Table views can be toggled between the image and details views using the buttons at the top rightof the tables window.
  • For Players the details tabular view will show the table image and the table name (good for tables with long names!).
  • For GMs the details tabular view will show table image, table name, entries count, values count, images count; also disabled checkboxes for Show To Player, Allow Player Lookup, and Is Pick Once Table (providing an overview of tables without having to enter edit mode for each table).
  • If a GM in tabular view, double-clicking on the table icon will roll on the table and double-clicking on any other column will open the lookup table edit panel.

Release Notes

  • Added the option to show table details in a tabular view in the Tables Window

This change is Reviewable

@github-actions github-actions Bot added the feature Adding functionality that adds value label Jul 1, 2026

@kwvanderlinde kwvanderlinde left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I still have to go through the implementation, but the UI looks pretty nice on the whole.

I have some suggestions, based partly on the fact that I prefer a narrower Tables window docked to the side of the window. In that case, the details view would end up looking like this:
Image

  • We can do without the #Values and #Image columns. This would also save some CPU cycles for those who run very large tables (not sure how big a deal this latter point will be).
  • The column names can be a bit more concise. Actually, icons or something else narrow would be nice for the checkbox columns, but that's a bigger ask.
    • Show Table to Players -> Show to Players
    • Pick Once Table -> Pick Once
    • Allow Lookup by Players -> … Actually, I don't have an idea for shortening this one.
  • We should probably enforce some minimum size (determined by the column headings, perhaps), and allow the details table to scroll horizontally if that is exceeded. This would guarantee that at least the table structure is readable.

MapTool.getCampaign().getLookupTableMap().remove(origname);
// if not a new table (i.e. create/duplicate) delete the previous named one from the server.
if (!isNew) {
MapTool.serverCommand().deleteLookupTable(origname);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good find - this was a regression in #5868.

A future improvement for us would be to have unique table IDs so renames are actually renames and not delete+create.

@kwvanderlinde kwvanderlinde moved this from Todo to Awaiting-Review in MapTool 1.19 Jul 8, 2026
@Baaaaaz

Baaaaaz commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

I still have to go through the implementation, but the UI looks pretty nice on the whole.

Thanks for taking an initial look!

I was debating whether to:

  • add a third list view (basically what the Players version of the detail view currently shows but also available to GMs) and make the current details view available to GMs only, or
  • or make the details columns GM configurable (but that seemed a lot more work).

Personally I like having all the summary table stats as it enables management of the tables at a glance (esp. when developing or importing tables or getting to grips with others frameworks). Less useful when running a game. I tested it with a several large data tables (with no images though) and had no noticeable drop in performance. I suppose I could create some more with images. Not sure how to add counters/timers to non-zone rendering things though - is that even possible/desirable for this?

Columns icons are good idea, will revisit. I did previously have ticks and cross icons, but the disabled check boxes were on a potential path to enabling them on that panel as well, suppose that could be done with icons though if that was desired.

Will be more concise with the names... I did just use the existing entries for I18N tables for those, but will create some new keys.

Adding horizontal scroll and column sizing. Agree, will add/revisit.

@kwvanderlinde

Copy link
Copy Markdown
Collaborator

I tested it with a several large data tables (with no images though) and had no noticeable drop in performance. I suppose I could create some more with images. Not sure how to add counters/timers to non-zone rendering things though - is that even possible/desirable for this?

Probably if there is no performance issue without images of should also be fine with images since these don't factor into the control flow when counting.

And it's totally possible (and easy!) to add timers anywhere. Figuring out how and when to report them is the hard part. I wouldn't worry about it for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Adding functionality that adds value

Projects

Status: Awaiting-Review

Development

Successfully merging this pull request may close these issues.

Alternative views for Tables in Table Window

2 participants