Skip to content

Demos tab: the Demo File column can be dragged wider again (#801) - #806

Merged
ccoventry merged 4 commits into
devfrom
feat/demo-file-column-resize-801
Oct 18, 2026
Merged

ccoventry merged 4 commits into
devfrom
feat/demo-file-column-resize-801

Conversation

@ccoventry

Copy link
Copy Markdown
Owner

Release note: Fixed: In the in-game DoD Studio window's Demos tab, the Demo File column can be dragged wider again, so long demo names are no longer cut off.

Closes #801

What changes

  • Dragging the right edge of the Demos tab's Demo File heading resizes the column, like Map, Type, Player and Date. Double-clicking that edge now fits the column to the longest name (vgui2's ResizeColumnToContents, which had the same fault).
  • The default stays 170 px: the list is 520 wide and the columns already add up to 544, so a wider default would push Date off the right.

What GameUI showed (both builds)

  • The column was never fixed-size. CDemoPlayerFileDialog adds demoname with flags 0 and the list's width; the 5-argument AddColumnHeader (slot 134) turns flags 0 into a 20..10000 width range, and the drag handle is enabled.
  • The bug: each column's drag handle (vgui2's Dragger) keeps the position its column was added at (Dragger +0x70 PRE, +0x74 Anniversary), and its "ColumnResized" message sends that number. ListPanel::OnColumnResized (slot 189) looks the column up by position now in the column order. AddColumnHeader never renumbers the handles (ResetColumnHeaderCommands only renumbers the headings' sort commands). Studio plays demos on other drives by their full path (no copy, no link) once the hook DLL makes that possible #779 inserted the icon column at position 0, so Demo File's handle still said 0, and dragging it resized the icon column, which is fixed at 22 (min = max), so nothing moved.
  • Column record: a CUtlLinkedList of 0x44-byte records at ListPanel +0x78 (PRE) / +0x7c (Anniversary), allocated count at +4. In a record: +0 heading button, +4 min width, +8 max width, +0x10 resizes-with-window, +0x14 the Dragger *, +0x1c text type, +0x1d hidden, +0x1e unhidable. The order is a CUtlVector<unsigned char> at +0xa4 / +0xa8, count at +0xc. FIXEDSIZE (without RESIZEWITHWINDOW) sets min = max = width, and min == max or FIXEDSIZE turns the handle's movable byte off.
  • No public ListPanel method renumbers the handles, so the fix writes them: after add_demo_columns adds its columns, renumber_draggers sets each column's handle to its position (bounds-checked against the record count). Offsets are three new fields in the Build table (list_columns, list_column_order, dragger_column).

Other lists sharing the class

  • The game's own Load Demo window is untouched: the hook does not change it, and it has one column, whose handle is already right.
  • The Highlights tab (streaks_tab.rs) appends its columns after demoname (index 1 and on), so every handle already matches its position. It is not affected and is not changed.

Verify script

tools/verify_studio_panel.py gets item 26 (verify_column_draggers). It reads off both builds: the 20..10000 range for flags 0; demoname's flags 0; the record list offset, stride 0x44 and allocated count (from the linked list's Alloc); the Dragger * at record +0x14; the stored position in the Dragger after its vftable; the order offset; that nothing AddColumnHeader calls renumbers the handles; OnColumnResized looking up by order, count and records; and the Dragger's "ColumnResized" message sending that field.

It also fixes a bug in the script: the ComboBox check reused the name ok and overwrote the run's result, so an earlier FAIL could still print "OFFSETS VERIFIED". It now has its own name; no check was failing.

Local checks

  • rustup run 1.98.1 cargo fmt --all --check: clean
  • rustup run 1.98.1 cargo clippy -p goldsrc-hooks --all-targets --locked -- -D warnings, on i686 and on the host: clean
  • cargo test -p goldsrc-hooks --target i686-pc-windows-msvc --locked: 577 passed (new: each_drag_handle_names_its_column_position)
  • python -I goldsrc-hooks/tools/verify_studio_panel.py: OFFSETS VERIFIED on PRE and POST
  • cargo build -p goldsrc-hooks --release --target i686-pc-windows-msvc --lib --locked: built; the DLL is in local\test-801\

Live test plan (DLL local\test-801\dodstudio_goldsrc_hooks.dll)

Run on PRE (Half-Life - PRE-Anniversary for Movies), then on POST (Half-Life - POST-Anniversary for Movies):

  1. Open the DoD Studio window and go to the Demos tab, in a folder with a long demo name.
  2. Drag the right edge of the Demo File heading about 100 px to the right. Expected: the column widens and Map, Type, Player and Date move right. Before this fix, nothing moved.
  3. Drag it back left. Expected: it narrows, down to 20 px at least.
  4. Double-click that edge. Expected: the column fits the longest name, up to the room the columns to its right leave.
  5. Drag the Map/Type/Player edges. Expected: they resize as before. The icon column's edge does not move (fixed on purpose).
  6. Click the headings to sort. Expected: sorting is unchanged.
  7. Open the game's own Load Demo window (VCR bar, Load). Expected: its one column still resizes. Open the Highlights tab's list. Expected: its columns still resize.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@ccoventry ccoventry linked an issue Oct 17, 2026 that may be closed by this pull request
@ccoventry

Copy link
Copy Markdown
Owner Author

Live-tested unattended (game_probe, Brain account, DLL local\test-801\), PRE and POST, Demos tab in a folder with one subfolder1/ (0 here, 15 inside) row:

  • Drag the Demo File heading's right edge 100 px to the right: the column widens (PRE 170 → ~270 px, POST likewise), Map/Type/Player/Date move right, the folder row's full (0 here, 15 inside) shows. Pass both.
  • Double-click the edge: the column fits its longest name (narrows back to the row's text). Pass both.
  • Runs local\game-probe\20261016-203154 (PRE, grabs c0, c1-dragged, c2-dblclick) and 20261016-203225 (POST).

Not run: the game's own Load Demo window and the Highlights tab (unchanged by the PR per its body).

@ccoventry

Copy link
Copy Markdown
Owner Author

Updated with dev (brings in #803's list_panel.rs), CI green, test DLL rebuilt from the new head; re-probed overnight 2026-10-17 (game_probe, Brain account).

DLL local\test-801\, Demos tab in POST's dod/ (3 folder rows):

  • PRE and POST: dragging the Demo File heading's right edge 100 px right widened the column (Map/Type/Player/Date moved right, Archived Demos/ (76 demos) shows whole); double-clicking the edge fit it to the longest name. Pass both. Runs local\game-probe\20261017-031931 (PRE), 20261017-031959 (POST).

@ccoventry

Copy link
Copy Markdown
Owner Author

Probe test on today's dev, together with #820 #806 #804 #816 #814 (2026-10-18)

One local build of dev b7603c4 (with #734 kill-feed scale, #838, #840) + #820 + #806 + #804 + #816 + #814 merged (local\test-batch-1018\; #814's conflict with #806 in studio_panel.rs / verify_studio_panel.py was two comment blocks, both kept; verify_studio_panel.py: OFFSETS VERIFIED). game_probe on the Brain account, POST then PRE (ktps7finalsgoldharringtonside2, POST's dod\, PRE through ../../):

Check POST PRE
#806: drag the Demo File heading's edge 100 px right column widens, the others move right same
#820: dodstudio_spec_match_pov 1, seek 424, in-eye on player 6 stabbed or swung line same
#804/#814: Highlights tab after the demo loads 195 of 195 streaks listed, rows shown same
Crash none none

Frames: local\game-probe\batch-post-sheet.png, batch-pre-sheet.png.

@ccoventry
ccoventry merged commit 597afd0 into dev Oct 18, 2026
5 checks passed
@ccoventry
ccoventry deleted the feat/demo-file-column-resize-801 branch October 18, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Demos tab: the Demo File column can be resized

1 participant