fix(CommentsView): 移除固定高度并添加滚动条以改善用户体验
refactor(listComments): 简化评论排序逻辑 移除CommentsView中的固定高度限制并添加overflow-y属性,使内容可滚动 修改listComments的SQL查询,去除priority排序以简化逻辑
This commit is contained in:
@@ -921,13 +921,13 @@ onMounted(() => {
|
|||||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
|
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 600px;
|
max-width: 600px;
|
||||||
height: 100vh;
|
|
||||||
padding: 20px 20px 24px;
|
padding: 20px 20px 24px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
transform: translateX(0);
|
transform: translateX(0);
|
||||||
animation: drawer-in 0.2s ease-out;
|
animation: drawer-in 0.2s ease-out;
|
||||||
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-title {
|
.modal-title {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export const listComments = async (c: Context<{ Bindings: Bindings }>) => {
|
|||||||
.first<{ count: number }>();
|
.first<{ count: number }>();
|
||||||
|
|
||||||
const { results } = await c.env.CWD_DB.prepare(
|
const { results } = await c.env.CWD_DB.prepare(
|
||||||
`SELECT * FROM Comment ${whereSql} ORDER BY priority DESC, created DESC LIMIT ? OFFSET ?`
|
`SELECT * FROM Comment ${whereSql} ORDER BY created DESC LIMIT ? OFFSET ?`
|
||||||
)
|
)
|
||||||
.bind(...params, limit, offset)
|
.bind(...params, limit, offset)
|
||||||
.all();
|
.all();
|
||||||
|
|||||||
Reference in New Issue
Block a user