Repository navigation
fix: constrain nested scrolling in authorization and retrieval views #8300
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 |
|---|---|---|
|
|
@@ -181,7 +181,7 @@ onMounted(() => loadChatUserGroups()) | |
| </script> | ||
|
|
||
| <template> | ||
| <div v-loading="loading" :inert="loading" class="-mx-6 -mb-6 flex min-h-0 flex-1"> | ||
| <div v-loading="loading" :inert="loading" class="mk-scrollbar-fill-height -mx-6 -mb-6 flex min-h-0 flex-1"> | ||
| <aside class="flex-column w-sidebar-expanded shrink-0 border-r"> | ||
| <div class="shrink-0 p-4"> | ||
| <h4>{{ t('authorization.byGroup') }}</h4> | ||
|
Contributor
Author
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. ReviewOnly one line changed: an extra <div v-loading="loading" :inert="loading" class="mk-scrollbar-fill-height -mx-6 -mb-6 flex min-h-0 flex-1">Potential issues / risks
Suggestions
Overall, the change is small and likely safe, but its correctness depends entirely on the definition of |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,7 +99,7 @@ function testKnowledge(query: Required<Pick<KnowledgeHitTestPayload, 'query_text | |
| </script> | ||
|
|
||
| <template> | ||
| <div class="mk-knowledge-hit-test -ml-6 -mr-6 -mb-6 grid min-h-0 flex-1 grid-cols-2 overflow-hidden"> | ||
| <div class="mk-scrollbar-fill-height -ml-6 -mr-6 -mb-6 grid min-h-0 flex-1 grid-cols-2 overflow-hidden"> | ||
| <!-- 左侧 --> | ||
| <el-scrollbar class="min-h-0 min-w-0" view-class="px-6 pb-6"> | ||
| <header class="flex-align-center gap-2 py-4"> | ||
|
|
@@ -256,10 +256,3 @@ function testKnowledge(query: Required<Pick<KnowledgeHitTestPayload, 'query_text | |
| @closed="selectedParagraph = undefined" | ||
| /> | ||
| </template> | ||
|
|
||
| <style scoped lang="scss"> | ||
| // 仅约束召回测试的外层内容高度,由左右两栏各自负责滚动。 | ||
| :global(.el-scrollbar__view:has(> .mk-knowledge-hit-test)) { | ||
| height: 100%; | ||
| } | ||
| </style> | ||
|
Contributor
Author
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. No syntax errors in this diff. The main risks are CSS/contract-related:
Overall: the change can be a good cleanup if |
||
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.
Assuming this is SCSS/Less (because
//comments are used), the added rule is syntactically valid. Main review points://comments are not valid in plain CSS//is invalid. Since surrounding code already uses//, this is probably fine, but confirm the file is compiled by SCSS/Less.:has()browser compatibility:has()is modern but not supported by older browsers/WebViews. If the project supports older embedded browsers or legacy Safari/Chrome, provide a fallback or add a modifier class directly to.el-scrollbar__viewinstead.Global selector may cause side effects
.el-scrollbar__view:has(> .mk-scrollbar-fill-height)applies to all Element Plus scrollbars globally. Consider scoping it to a page/container:Direct-child restriction
.mk-scrollbar-fill-heightis a direct child of.el-scrollbar__view. If it can be nested deeper, the rule will not apply.height: 100%may not work or may clipheight: 100%requires the parent chain to have a definite height. If the goal is “fill at least the available height while allowing content to grow,” consider:instead of
height: 100%.Box model consideration
.el-scrollbar__viewhas padding or borders,height: 100%can overflow. Add:Prefer a direct modifier class if possible
:has()can be avoided by adding a class such asmk-scrollbar-fill-heightdirectly to.el-scrollbar__viewvia the component API or JS.Suggested safer/scoped version:
No syntax irregularity in the diff itself, but the main risks are browser support, global side effects, and layout assumptions around
height: 100%.