mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
fix(web): keep abort next to Send by default (#988)
* refactor(web): pin abort button to end of composer left cluster Abort's position shifted with conditional siblings (terminal/switch/ schedule), making the destructive action's location unpredictable. Move it to the last child of the left button group so it's always immediately left of Send — pure JSX reorder, no markup/props/handler changes. * fix(web): keep abort last in default toolbar Keep the product default predictable without changing saved custom order or the registry used to append missing items.
This commit is contained in:
@@ -5,6 +5,23 @@ import {
|
||||
normalizeComposerToolbarLayout,
|
||||
} from './useComposerToolbarLayout'
|
||||
|
||||
describe('DEFAULT_COMPOSER_TOOLBAR_LAYOUT', () => {
|
||||
it('keeps abort last in the default order', () => {
|
||||
expect(DEFAULT_COMPOSER_TOOLBAR_LAYOUT.left).toEqual([
|
||||
'attachment',
|
||||
'settings',
|
||||
'piModel',
|
||||
'piThinking',
|
||||
'terminal',
|
||||
'switch',
|
||||
'voiceMic',
|
||||
'scratchlist',
|
||||
'schedule',
|
||||
'abort',
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
describe('normalizeComposerToolbarLayout', () => {
|
||||
beforeEach(() => localStorage.clear())
|
||||
|
||||
|
||||
@@ -25,7 +25,10 @@ export type ComposerToolbarLayout = {
|
||||
|
||||
export const DEFAULT_COMPOSER_TOOLBAR_LAYOUT: ComposerToolbarLayout = {
|
||||
mode: 'left',
|
||||
left: [...COMPOSER_TOOLBAR_ITEM_IDS],
|
||||
left: [
|
||||
...COMPOSER_TOOLBAR_ITEM_IDS.filter((item) => item !== 'abort'),
|
||||
'abort',
|
||||
],
|
||||
right: [],
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user