-
Notifications
You must be signed in to change notification settings - Fork 312
docs(grid): [grid] optimize grid demos and e2e #2457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -228,3 +228,9 @@ export default { | |
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
:deep(.tiny-picker) { | ||
width: 300px; | ||
} | ||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
<tiny-grid | ||
:data="tableData" | ||
column-min-width="100" | ||
auto-resize | ||
show-overflow="tooltip" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider standardizing overflow behavior across columns The grid has mixed overflow handling:
This might create inconsistent tooltip behavior across columns. Consider one of these approaches: <tiny-grid
:data="tableData"
column-min-width="100"
show-overflow="tooltip"
:column-anchor="columnAnchor"
:optimization="{ scrollX: { gt: 20 } }"
>
<!-- ... other columns ... -->
- <tiny-grid-column field="introduction" title="公司简介" show-overflow></tiny-grid-column>
+ <tiny-grid-column field="introduction" title="公司简介"></tiny-grid-column> Or if different overflow behavior is intended for the introduction column: - <tiny-grid-column field="introduction" title="公司简介" show-overflow></tiny-grid-column>
+ <tiny-grid-column field="introduction" title="公司简介" show-overflow="ellipsis"></tiny-grid-column> Also applies to: 53-53 |
||
:column-anchor="columnAnchor" | ||
:optimization="{ scrollX: { gt: 20 } }" | ||
height="auto" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
<tiny-button @click="scrollToColumn">滚动到500列</tiny-button> | ||
</div> | ||
<br /> | ||
<tiny-grid ref="tinyGridRef" height="300"> </tiny-grid> | ||
<tiny-grid ref="tinyGridRef" height="300" column-width="100"> </tiny-grid> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consider dynamic column width for better responsiveness While setting a fixed Consider these alternatives: - <tiny-grid ref="tinyGridRef" height="300" column-width="100">
+ <tiny-grid ref="tinyGridRef" height="300" :column-width="getColumnWidth"> Add this method to compute widths based on content or viewport: const getColumnWidth = (column) => {
// For demo purposes, use smaller widths for higher column numbers
const columnIndex = parseInt(column.field.replace('attr', ''))
return columnIndex > 100 ? 60 : 100
} |
||
</div> | ||
</template> | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,9 +1,9 @@ | ||||||
<template> | ||||||
<tiny-grid :data="tableData"> | ||||||
<tiny-grid-column field="name" title="名称" width="150"></tiny-grid-column> | ||||||
<tiny-grid-column field="area" title="所属区域" width="80"></tiny-grid-column> | ||||||
<tiny-grid-column field="area" title="所属区域" width="100"></tiny-grid-column> | ||||||
<tiny-grid-column field="address" title="地址" width="20%"></tiny-grid-column> | ||||||
<tiny-grid-column field="introduction" title="公司简介" show-overflow></tiny-grid-column> | ||||||
<tiny-grid-column field="introduction" title="公司简介"></tiny-grid-column> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consider adding show-overflow="tooltip" for consistency. The introduction column contains long text that could overflow. Based on the changes being made across other grid components, consider adding - <tiny-grid-column field="introduction" title="公司简介"></tiny-grid-column>
+ <tiny-grid-column field="introduction" title="公司简介" show-overflow="tooltip"></tiny-grid-column> 📝 Committable suggestion
Suggested change
|
||||||
</tiny-grid> | ||||||
</template> | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,9 +1,9 @@ | ||||||||||||||||||||||||||||||||||
<template> | ||||||||||||||||||||||||||||||||||
<tiny-grid :data="tableData"> | ||||||||||||||||||||||||||||||||||
<tiny-grid-column field="name" title="名称" width="150"></tiny-grid-column> | ||||||||||||||||||||||||||||||||||
<tiny-grid-column field="area" title="所属区域" width="80"></tiny-grid-column> | ||||||||||||||||||||||||||||||||||
<tiny-grid-column field="area" title="所属区域" width="100"></tiny-grid-column> | ||||||||||||||||||||||||||||||||||
<tiny-grid-column field="address" title="地址" width="20%"></tiny-grid-column> | ||||||||||||||||||||||||||||||||||
<tiny-grid-column field="introduction" title="公司简介" show-overflow></tiny-grid-column> | ||||||||||||||||||||||||||||||||||
<tiny-grid-column field="introduction" title="公司简介"></tiny-grid-column> | ||||||||||||||||||||||||||||||||||
</tiny-grid> | ||||||||||||||||||||||||||||||||||
Comment on lines
1
to
7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add show-overflow="tooltip" to TinyGrid for consistent overflow handling. The introduction column contains long text that will overflow. According to the standardization effort across the codebase, overflow handling should be managed at the grid level using tooltips. Apply this change to align with the new overflow handling standard: - <tiny-grid :data="tableData">
+ <tiny-grid :data="tableData" show-overflow="tooltip"> 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||
</template> | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
E2E test coverage needed for grid tooltip overflow feature
The codebase currently lacks specific test coverage for the grid tooltip overflow functionality. While there are numerous grid-related tests, none specifically verify the
show-overflow="tooltip"
behavior.examples/sites/demos/pc/app/grid/data-source/columns-composition-api.spec.js
to verify:🔗 Analysis chain
LGTM! Consider adding e2e tests for tooltip behavior.
The addition of
show-overflow="tooltip"
is a good improvement for handling long content, particularly for fields like 'introduction' that contain lengthy text.Let's verify if e2e tests exist for this tooltip behavior:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 63
Script:
Length of output: 2986
Script:
Length of output: 15582