Skip to content

Kingdom/Park table consistency (DataTables) + misc bugfixes#489

Open
baltinerdist wants to merge 19 commits into
amtgard:masterfrom
baltinerdist:feature/07-07-misc-fixes
Open

Kingdom/Park table consistency (DataTables) + misc bugfixes#489
baltinerdist wants to merge 19 commits into
amtgard:masterfrom
baltinerdist:feature/07-07-misc-fixes

Conversation

@baltinerdist

Copy link
Copy Markdown
Contributor

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)

  • Shared ORK DataTables toolbar + CSV helper — new reusable infrastructure so every list gets the same search box, page-size selector, and CSV export instead of per-page one-offs.
  • Kingdom Parks + principality tables moved onto the standard DataTables toolbar; dropped the old kn-sortable handling that conflicted with DataTables' own sorting.
  • Kingdom & Park Recs tables gained a show-X page-size control and a search box.
  • Deleted-recs tables (Kingdom + Park) brought onto the same standard toolbar.
  • Kingdom Players list headers are now click-sortable via delegated kn-sortable handling.
  • Player Profile tables migrated to the shared DataTables toolbar, plus suspension "Indefinitely" display fixes.
  • Fixes along the way: resolved the Parks DataTable "Cannot reinitialise" error (don't match the scrollX clone tables), pointed the Kingdom/Park ork-datatables.css link at the relocated style/ path, and a final polish pass (Players sort no longer forces pagination, dropped an inert data-dt-type).

Bugfixes

  • Custom Title recs no longer falsely blocked as duplicates — the duplicate check was over-eager and rejected legitimate custom-title recommendations.
  • Event heraldry logo click now enlarges (lightbox) instead of opening the edit modal.
  • Leave-household widget tap targets were unusable on mobile — tap areas fixed.
  • Release Utilization sign-in section no longer full-scans attendance — performance fix that avoids scanning the full attendance table.

Enhancements

  • Schedule list view now marks cross-midnight end times with the weekday, so an end time that rolls past midnight reads unambiguously.

Docs

  • Added the image-pipeline high-res master + rendition-set design spec, and the Kingdom/Park table-consistency design + implementation plan documents.

baltinerdist and others added 19 commits July 7, 2026 10:52
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
…-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
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.

1 participant