Kingdom/Park table consistency (DataTables) + misc bugfixes#489
Open
baltinerdist wants to merge 19 commits into
Open
Kingdom/Park table consistency (DataTables) + misc bugfixes#489baltinerdist wants to merge 19 commits into
baltinerdist wants to merge 19 commits into
Conversation
Spec for bringing Kingdom/Park data tables to a consistent feature set (sort, show-X, pagination, search, export CSV) via DataTables. Migrates the clean tables (Parks, Recs, Deleted-recs); defers Events & Players (intricate custom toggles/filters); includes the minimal Kingdom Players sort fix. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GPGquTd7DATLPmfPXcfedu
…ement Adds the task-by-task implementation plan and refines the spec to use a shared custom CSV helper (generalized from recsExportCsv) instead of the DataTables Buttons plugin — no new CDN deps, one CSV codepath. Documents the deleted-recs restore/count API-desync fixes. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GPGquTd7DATLPmfPXcfedu
…"Indefinitely" fixes - All Player Profile data tables now run on the shared pnInitDataTable helper (column sort + Show-N + pagination + search + CSV), verified in light and dark mode, with correct numeric/date sorting (including the Notes legacy date-range fix) and the ladder-tile -> search redirect preserved. - Suspension "Indefinitely" no longer repeats: the reason suffix is suppressed when it merely restates the status, kept when it carries real detail. - Notes table: add/edit/delete now re-fetch via window.pnReloadNotes() so the DataTables cache no longer desyncs (fixes a deleted note reappearing on the next sort/search), mirroring the existing pnReloadRecs pattern. - Removed the orphaned custom table system (pnSortDesc / pnPaginate / pnPageRange / pnSetPageSize / pnAwardSearch + delegated sort handler) and the dead pagination / page-size / award-search CSS it left behind. - Reports player award recommendations table moved onto DataTables as well. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013QnFEdubTCug1jYk5SuTRr
…ing edit modal Clicking an event's heraldry logo on the revised event detail page opened the change-logo upload modal (the whole frame was the edit trigger) rather than enlarging the image. It now mirrors player heraldry/photos: - The logo image carries .heraldry-img and opens the shared #ork-lightbox on click for both viewers and managers (no new lightbox code — reuses the global orkui.js handler). Placeholder logos stay non-clickable. - For managers, edit moved off the whole-frame click onto a small corner camera button (.ev-heraldry-edit-btn), a clone of the player profile .pn-img-edit-btn (bottom-right, reveal on hover, always visible on touch). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013QnFEdubTCug1jYk5SuTRr
…located file) A concurrent change moved ork-datatables.css from css/ to style/ but left the Kingdom/Park <link> tags on the old css/ path (404). Repair the two references to the style/ location. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GPGquTd7DATLPmfPXcfedu
…es toolbar Migrates the Kingdom Parks list table and per-principality park tables from the bespoke knSortAsc/knPaginate helpers onto the shared orkInitDataTable toolbar (search, length, pagination, Export CSV). The manager-only edit-gear column is excluded from sort/search/CSV via a no-export th + columnDefs guard. Re-measures columns via orkAdjustDataTables when the list view is revealed and when the Parks tab is activated, since DataTables mis-measures columns initialized while hidden.
…bles They kept the legacy kn-sortable class, so the class-based kn-sortable header click handler double-bound against DataTables' own sort on every header click. Remove the class from the converted tables (Events keeps it — still on the bespoke sorter). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GPGquTd7DATLPmfPXcfedu
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GPGquTd7DATLPmfPXcfedu
…-sortable)
Player-list tables are injected async on first Players-tab click, after the
load-time .kn-sortable header binding ran, so headers never wired up.
Converted the binding to a single delegated $(document).on('click', ...)
handler (same sort logic) and added kn-sortable to the built player table's
class.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GPGquTd7DATLPmfPXcfedu
…e tables With scrollX, DataTables creates clone header/body tables that copy the source table's classes. The parks init ran two selector passes: the first initialised #kn-parks-table (spawning clones), the second re-evaluated .kn-parks-dt — now matching those clones — and tried to re-init one, throwing a native "Cannot reinitialise table id=kn-parks-table" alert. Capture the whole .kn-parks-dt set in one pass before any init (no clones exist yet), and guard orkInitDataTable to ignore any table inside a .dataTables_scroll wrapper as defense-in-depth. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GPGquTd7DATLPmfPXcfedu
…inert data-dt-type - kn-sortable delegated handler: skip knPaginate for .kn-year-table (the year-grouped Players list shows all members per year; sorting now just reorders instead of collapsing to 25/page + a pager on first click). Events and other kn-sortable tables keep their pager. - Remove inert data-dt-type attributes from the deleted-recs headers (DataTables never read them; sorting is driven by per-cell data-order). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GPGquTd7DATLPmfPXcfedu
The leave-unit control on the player profile (× link + Yes/No inline confirm) rendered as desktop-hover micro-targets (× ~7x13px, Yes ~21x13px, No ~16x13px) — far below a usable touch size, so leaving a household was effectively impossible on mobile. A prior touch patch only made the × visible, not tappable. Grow these three controls to 40x40px hit areas and space Yes/No apart, scoped to @media (hover: none),(pointer: coarse) so desktop is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01ShyA7SCTysgREoQPBoxs1Q
The award-recommendation dedup check keyed on the shared kingdomaward_id, so a second "Custom Title" recommendation from the same officer for the same player was wrongly rejected with "You already recommended that award and level." — even when the intended title text differs. A custom's real name is free-text entered at grant time and is never stored on the recommendation row, so the check cannot distinguish two different customs. Exempt the "Custom Title" sentinel (is_title = 1 AND name = 'Custom Title') from the dedup check, matching the existing custom-award exemption. Real predefined titles and ladder awards are still deduped. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013QnFEdubTCug1jYk5SuTRr
…ndance The three entry-method metrics in the "Day-of Sign-In & Self-Registration" section counted over all of ork_attendance (3.5M rows) with an unindexed entry_method column — three full table scans (Using temporary; filesort) that made the report very slow. Scope them to the last 30 days so they use the `date` index (range scan, ~1.4k rows). Also more meaningful: sign-in links and self-reg shipped with 3.5.3, so an all-time entry-method mix is ~100% legacy 'manual'; a recent window shows the current sign-in mix. KPI/chart labels updated to reflect the 30-day window. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01ShyA7SCTysgREoQPBoxs1Q
…eekday Activities that end on a later day than they start now show the end weekday in the End column (e.g. "12:00pm (Fri)"), so a 1pm activity finishing at noon the next day no longer reads as ending before it began. Same-day activities are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GPGquTd7DATLPmfPXcfedu
Design for storing high-quality image masters and deriving size-optimized WebP renditions for player photos and player/park/ kingdom heraldry, replacing the current upload-time downscale that destroys quality. Two-phase rollout; static serving preserved. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01ShyA7SCTysgREoQPBoxs1Q
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A batch of Kingdom/Park table consistency work plus a set of independent bugfixes and enhancements. The headline effort standardizes the assorted hand-rolled tables across Kingdom, Park, and Player profiles onto a single shared DataTables toolbar (search box, show-X page size, CSV export, sortable headers) with consistent dark-mode styling. The remainder are targeted fixes to specific surfaces.
Kingdom / Park / Player table consistency (DataTables standardization)
kn-sortablehandling that conflicted with DataTables' own sorting.kn-sortablehandling.ork-datatables.csslink at the relocatedstyle/path, and a final polish pass (Players sort no longer forces pagination, dropped an inertdata-dt-type).Bugfixes
Enhancements
Docs