Skip to content

Stabilize table layouts#124

Merged
superg merged 5 commits into
mainfrom
whatever-industries
Jun 27, 2026
Merged

Stabilize table layouts#124
superg merged 5 commits into
mainfrom
whatever-industries

Conversation

@whatever-industries

@whatever-industries whatever-industries commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Stabilize /discs table column sizing so fixed columns do not shift after load.
  • Add queue region flags and tighten queue/home table layout behavior.
  • Broaden disc search matching for modified Latin characters such as Egypt matching Égypte.

Validation

  • docker compose up -d --build app
  • Full test suite passed during Docker build: 322 passed, 0 failed, 7 ignored.
  • Verified the running app is serving the updated stylesheet.

Summary by CodeRabbit

  • New Features

    • Added a Region column in queue results, showing region flags for each submission.
    • Improved disc searching to better match accented Latin text and related variants.
  • Bug Fixes

    • Refined queue data handling so region information displays reliably.
    • Improved disc and queue table spacing, sizing, and pagination alignment for a cleaner layout.
  • Style

    • Updated table headers and responsive scaling behavior for more consistent display across screen sizes.

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a Region column to the queue submissions table by computing a JSONB lateral join of effective region flags in the SQL query, deserializing them into SubmissionListRow, and rendering flag images in the template. Separately introduces Latin-character folding (TRANSLATE(LOWER(COALESCE(...)))) for disc text search clauses. Also refines disc and queue table CSS column sizing, pagination alignment, and home page responsive table scaling.

Changes

Region Flags in Queue

Layer / File(s) Summary
FlagInfo and SubmissionListRow model changes
src/db/models.rs
FlagInfo gains Deserialize derive; SubmissionListRow gains region_flags: Vec<FlagInfo> field.
Lateral SQL join for region_flags
src/services/queue_service.rs
list_submissions query gains a LEFT JOIN LATERAL computing a JSONB array of {code,name} region objects from submission changes and disc state, projected into the SELECT.
FromRow deserialization and test wiring
src/routes/queue.rs
SubmissionListRow FromRow impl deserializes region_flags JSON column with unwrap_or_default fallback; test helper sets field to empty vec.
Queue template and CSS for Region column
templates/queue.html, static/css/app.css
Queue table header adds Region th, rows render flag images from entry.region_flags, empty-state colspan bumped to 9; #queue-results CSS constrains width and pagination.

Latin-fold Disc Search

Layer / File(s) Summary
LatinFoldSqlMap implementation
src/routes/discs.rs
OnceLock-backed LatinFoldSqlMap lazily builds from/to char lists; latin_fold_sql generates TRANSLATE(LOWER(COALESCE(...))) SQL expressions.
Search clause updates
src/routes/discs.rs
quick_search_clause, edition_search_clause, and comments_search_clause updated to use latin_fold_sql for column expressions and bind parameters.
Tests for latin-fold SQL shape
src/routes/discs.rs
Quick-search text-clause test updated for new SQL shape; new unit tests validate replacement/deletion behavior including combining marks.

Disc Table and Home Page UI Polish

Layer / File(s) Summary
Disc table column CSS and header classes
static/css/app.css, templates/discs.html
Language/version/edition/serial/status columns gain explicit widths and padding; truncate enforces ellipsis; discs.html <th> elements gain class names.
Pagination alignment and misc CSS
static/css/app.css
Disc results pagination switched to left-aligned; queue filter form grid layout added; letter-picker top padding and disc-title-row margin-top added.
Home table responsive scaling
templates/main.html
scaleHomeTables uses matchMedia breakpoint to conditionally set max-content width and registers a change listener to retrigger on breakpoint crossing.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • superg/vgindex#88: Both PRs modify templates/queue.html and static/css/app.css for queue table structure and layout changes.

Poem

A rabbit hops through flags and folds,
Regions revealed in table rows of old,
Latin letters smoothed by TRANSLATE's hand,
Columns now sized just as planned—
The queue shines bright, the search stands tall! 🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and captures a major part of the PR: table layout stabilization across disc, queue, and home pages.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch whatever-industries

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@whatever-industries whatever-industries marked this pull request as ready for review June 27, 2026 16:03

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/routes/discs.rs`:
- Around line 186-193: The folded search in the disc query now uses
latin_fold_sql in the search predicates, so the existing trigram indexes on
LOWER(...) no longer match these LIKE clauses. Update the index definitions for
the disc search fields to use the same folded expression shape produced by
latin_fold_sql (for example in the migration or schema where the
title/title_foreign/serial/edition/comments indexes are created) so PostgreSQL
can use them for the folded search in the discs route.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8d403a96-7656-498a-b8ab-7b169f3b5213

📥 Commits

Reviewing files that changed from the base of the PR and between 287778a and 0b71e9d.

📒 Files selected for processing (8)
  • src/db/models.rs
  • src/routes/discs.rs
  • src/routes/queue.rs
  • src/services/queue_service.rs
  • static/css/app.css
  • templates/discs.html
  • templates/main.html
  • templates/queue.html

Comment thread src/routes/discs.rs Outdated
@superg superg merged commit e6c7ccd into main Jun 27, 2026
3 checks passed
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.

2 participants