Confusing sort interface
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 20/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Rust
- Star
- 2.6k
- Fork
- 175
- Merge trung bình
- 14 giờ 16 phút
- Pull request đã merge (30 ngày)
- 43
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của sqlpage/SQLPage
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
sqlpage/SQLPage#1218 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
There is no convenient way to reproduce issuesCó thể đã có người làm @81reap đã nhận 26 ngày trước. Đang mởenhancement
sqlpage/SQLPage#1566 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Mutation Testing Results :: Dead Code + Missing TestsCó thể làm lại được @81reap đã nhận 61 ngày trước và không có pull request nào đang mở. Đang mở
sqlpage/SQLPage#1396 · 5 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chart: 3D chartsĐang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của sqlpage/SQLPage
Issue tương tự
-
CI/CD ignore-for-release
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
eclipse-ankaios/ankaios#844 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
std: `SliceIndex<str>` missing for `std::ops` ranges, so generic `R: SliceIndex<str>` bounds failĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
symposium-dev/symposium#530 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày