Repository navigation
fix: limit AI answer height in workflow execution details #8235
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 |
|---|---|---|
|
|
@@ -64,20 +64,20 @@ defineProps<{ | |
| </div> | ||
|
|
||
| <!-- 思考过程 --> | ||
| <div class="mk-gray-card-sm"> | ||
| <!-- <div class="mk-gray-card-sm"> | ||
| <h6 class="mb-2">{{ t('workflow.thinking.process') }}</h6> | ||
| <div class="whitespace-pre-wrap"> | ||
| {{ data.reasoning_content || '-' }} | ||
| </div> | ||
| </div> | ||
| </div> --> | ||
|
|
||
| <!-- AI 回答 --> | ||
| <div class="mk-gray-card-sm"> | ||
| <h6 class="mb-2">{{ t('workflow.answer.aiLabel') }}</h6> | ||
| <div> | ||
| <el-scrollbar max-height="500" class="-mr-3" view-class="pr-3"> | ||
| <MdPreview v-if="data.answer" :model-value="data.answer" noImgZoomIn /> | ||
| <template v-else>-</template> | ||
| </div> | ||
| </el-scrollbar> | ||
| </div> | ||
| </DetailContainer> | ||
| </template> | ||
|
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. Here's my review of the diff: Issues / Observations
Optimization suggestions
SummaryThe change itself (wrapping the answer in a scrollbar) is reasonable, but don't leave commented-out code, bind |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,20 +74,20 @@ defineProps<{ | |
| </div> | ||
| </div> | ||
|
|
||
| <div class="mk-gray-card-sm"> | ||
| <!-- <div class="mk-gray-card-sm"> | ||
| <h6 class="mb-2">{{ t('workflow.thinking.process') }}</h6> | ||
| <div class="space-y-2"> | ||
| <MdPreview v-if="data.reasoning_content" :model-value="data.reasoning_content" noImgZoomIn /> | ||
| <template v-else>-</template> | ||
| </div> | ||
| </div> | ||
| </div> --> | ||
|
|
||
| <div class="mk-gray-card-sm"> | ||
| <h6 class="mb-2">{{ t('workflow.answer.aiLabel') }}</h6> | ||
| <div class="space-y-2"> | ||
| <el-scrollbar max-height="500" class="-mr-3" view-class="pr-3"> | ||
| <MdPreview v-if="data.answer" :model-value="data.answer" noImgZoomIn /> | ||
| <template v-else>-</template> | ||
| </div> | ||
| </el-scrollbar> | ||
| </div> | ||
| </DetailContainer> | ||
| </template> | ||
|
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. Review Findings1. Commented-out code left in templateThe "thinking process" block is commented out rather than removed. If this is temporary, fine — but it should not be committed as dead code. Either:
Leaving large commented template blocks hurts maintainability and review clarity. 2. Inconsistent scroll behaviorOnly the answer card now uses 3. Layout dependency on negative margin (
|
||
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.
Here is my review of the diff:
Potential Issues
Commented-out "thinking process" block left in code
div, it's cleaner to delete it (or gate it withv-if="false"/ a feature flag). Dead commented markup is a maintenance smell and may confuse reviewers.<!-- Disabled: reasoning_content temporarily hidden -->).el-scrollbarrequires Element Plus import/registrationElScrollbaris globally registered or explicitly imported. If this component is tree-shaken, an unresolved<el-scrollbar>will fail silently or warn at runtime.max-height="500"unit ambiguitymax-heightaccepts a number (interpreted as px) or a string with units. A bare500works but is less explicit. Prefermax-height="500px"for clarity and to avoid confusion across versions.Magic offset classes (
-mr-3,pr-3)v-elsefallback withel-scrollbardata.answeris empty, the scrollbar wrapper still renders around-. That's fine functionally, but the max-height/scroll styling applies even to the trivial placeholder. Minor: consider only wrapping withel-scrollbarinside thev-ifbranch, e.g.:view-class="pr-3"— verifyview-classis a supported prop in your installed Element Plus version (it was added around 2.2.x). If on an older version, this prop is ignored and the padding won't apply.No exponential/markdown injection concerns changed here, but confirm
MdPreviewsanitizes HTML when renderingdata.answer(user/AI-generated content), since it's now inside a scroll viewport — no functional change, just reaffirming security.Optimization Suggestions
v-if="showReasoning && data.reasoning_content") so it can be toggled.max-height="500px".-mr-3+pr-3) into a named CSS class (e.g..scroll-gutter) for reuse and clarity.always(always show scrollbar) to prevent layout shift when content grows past the max height:<el-scrollbar max-height="500px" always>.keyor transition only if content toggles frequently; otherwise not needed.Summary
No blocking bugs, but the primary concerns are: dead commented code, explicit units for
max-height, version compatibility ofview-class, and fragile negative-margin scroll gutter styling. Addressing these improves maintainability and cross-version safety.