Merge pull request #8529 from deepseek-harness/turtle/shrink-delete-task-dialog-d75d0c08f86f

fix(ui-schedule): clamp the task instruction in the delete confirmation
This commit is contained in:
Turtle authored and GitHub committed 2026-11-16 12:40:25 +08:00
commit f08cd7c4b1
2 files changed
+19 -2

No files matched your search

@@ -1365,8 +1365,18 @@
--dsh-button-outline-color: var(--dsw-alias-state-error-primary);
}
/* The instruction only identifies the task here, so a long one stays a
three-line excerpt instead of growing the dialog. */
.confirmPrompt {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
line-clamp: 3;
margin: 0;
overflow: hidden;
color: var(--dsw-alias-label-secondary);
font-size: 13px;
line-height: 22px;
white-space: pre-wrap;
overflow-wrap: anywhere;
}
@@ -2127,7 +2127,7 @@ describe('Task manager deletion', () => {
const dialog = openDelete()
const cancel = within(dialog).getByRole('button', { name: en['delete.cancel'] })
const confirm = within(dialog).getByRole('button', { name: en['delete.confirm'] })
const content = dialog.querySelector(`.${css.confirmContent}`)!
const content = dialog.querySelector<HTMLElement>(`.${css.confirmContent}`)!
expect(dialog.classList.contains(css.confirmDialog!)).toBe(true)
expect(content.textContent).toContain(at.prompt)
expect(content.contains(cancel)).toBe(false)
@@ -2140,9 +2140,16 @@ describe('Task manager deletion', () => {
// installed. The dialog's cap must follow the padding of the Modal layer
// that holds it, and the scrolling content must sit inside that cap instead
// of pinning a number that a wrong layer padding could not contradict.
installStyles({ confirmDialog: css.confirmDialog, confirmContent: css.confirmContent })
installStyles({ confirmDialog: css.confirmDialog, confirmContent: css.confirmContent, confirmPrompt: css.confirmPrompt })
expect(getComputedStyle(dialog).maxHeight).toBe(`calc(100dvh - ${MODAL_LAYER_PADDING * 2}px)`)
expect(getComputedStyle(content).overflowY).toBe('auto')
// The instruction is a three-line excerpt, so a long one cannot stretch the dialog.
const prompt = within(content).getByText(/^Review release/)
const clamp = getComputedStyle(prompt)
expect(clamp.display).toBe('-webkit-box')
expect(clamp.getPropertyValue('-webkit-box-orient')).toBe('vertical')
expect(clamp.overflow).toBe('hidden')
expect(clamp.getPropertyValue('-webkit-line-clamp')).toBe('3')
const footer = dialog.lastElementChild as HTMLElement
expect(getComputedStyle(footer).flexShrink).toBe('0')
fireEvent.click(confirm)