Confusing sort interface
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 20/100
調査の方向性
Start with the table component’s sorting behavior and discussion #778, which is cited as related context. The issue gives a SQL example with pagination but names no source files or tests; trace how sort column and direction are handled and how they could reach the backend query. Done means sorting applies to the full result set across pages; an open pull request (#1445) already exists.
索引モデルが issue の本文から書いたものです。
説明
Introduction
Any table which has more rows than the page size can deliver wrong results if sorted by the column headers in the table component. This is significant if you have a table lots of rows that is paginated by the pagination component.
To Reproduce
The issue is very simple, just select a table with more tuples then your pagination (say a pagination of 100 for a total records of 500), sort it by the table header and then advance to the following page.
SELECT 'table' AS component, true AS sort,
'/atti/edit.sql?id_soc={id}' AS edit_url,
'/atti/delete.sql?id_soc={id}' AS delete_url;
SELECT
t.id_atto::text AS _sqlpage_id,
COALESCE(t.notaio::text, '—') AS "Notaio",
COALESCE(t.filza::text, '—') AS "Filza",
COALESCE(t.documento_n::text, '—') AS "Documento n.",
to_char(t.data_stipula, 'DD/MM/YYYY') AS "Data Stipula",
COALESCE(t.tipo_atto::text, '—') AS "Tipo Atto",
COALESCE(t.regesto::text, '—') AS "Regesto"
FROM atti AS t
ORDER BY t.id_atto
LIMIT 100 OFFSET COALESCE(CAST(NULLIF($offset, '') AS INTEGER), 0);
SELECT 'pagination' AS component;
SELECT
(g.i / 100 + 1) AS contents,
sqlpage.link(sqlpage.path(), jsonb_strip_nulls(jsonb_build_object('offset', g.i, 'notaio', NULLIF($notaio, ''), 'filza', NULLIF($filza, ''), 'documento_n', NULLIF($documento_n, ''), 'sort', COALESCE(NULLIF($sort, ''), 'id_atto'), 'dir', NULLIF($dir, '')))) AS link,
(g.i = COALESCE(CAST(NULLIF($offset, '') AS INTEGER), 0)) AS active
FROM generate_series(0, GREATEST((SELECT count(*) FROM atti AS t WHERE (NULLIF($notaio, '') IS NULL OR t.notaio::text ILIKE '%' || $notaio || '%') AND (NULLIF($filza, '') IS NULL OR t.filza::text ILIKE '%' || $filza || '%') AND (NULLIF($documento_n, '') IS NULL OR t.documento_n::text ILIKE '%' || $documento_n || '%')) - 1, 0), 100) AS g(i);
Actual behavior
The order is valid only for the current page (and selection!). If I understand well, there is no way to forward it towards the database.
There is an open discussion "Table filtering, sorting, pagination." by jeneizs-74 here:
https://github.com/sqlpage/SQLPage/discussions/778
It has no answer since Jan 15, 2025.
This may lead to errors and Is anyway confusing for the user who may think sorting shows the proper records, while he will get only the result of sorting the page records.
Expected behavior
I think sorting should happen on the entire table. At least there should be some way of getting sorting column(s) and direction so to force a new select on the backend.
- 主要言語
- Rust
- スター
- 2.6k
- フォーク
- 175
- 平均マージ
- 14時間 16分
- マージ済み PR(30日)
- 43
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sqlpage/SQLPage のほかの issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
sqlpage/SQLPage#1218 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
There is no convenient way to reproduce issues対応中かも @81reap が 26 日前に担当しました。 オープンenhancement
sqlpage/SQLPage#1566 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Mutation Testing Results :: Dead Code + Missing Tests再び着手できるかも @81reap が 61 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
sqlpage/SQLPage#1396 · コメント 5 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
chart: 3D chartsオープンenhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
sqlpage/SQLPage の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
symposium-dev/symposium#530 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
topgrade-rs/topgrade#2540 ·
メンテナーはふだん 1 日以内に返信
-
Invalid JSON options for ngram and edge_ngram silently use defaults対応中かも @Tilendlesa が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
noemaforge/vimanam#153 ·
メンテナーはふだん 1 日以内に返信