mirror of
https://github.com/stablyai/orca.git
synced 2026-10-03 08:02:12 +00:00
fix(status-bar): remove pet menu reserved space (#13067)
* fix(status-bar): remove pet menu reserved space * test(status-bar): add pet segment layout validation tests - Unit test guards against pr-[6.5rem] padding reintroduction - E2E test measures trailing overhang instead of total width delta for more accurate layout validation - Extract enableExperimentalPet helper for test clarity --------- Co-authored-by: m4air <m4air@m4airs-Air.localdomain>
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
describe('PetStatusSegment layout', () => {
|
||||
it('does not reserve fixed right padding on the pet menu trigger', () => {
|
||||
const source = readFileSync(join(__dirname, 'PetStatusSegment.tsx'), 'utf8')
|
||||
|
||||
// Why: the old pr-[6.5rem] reserved ~104px of empty space after the label and
|
||||
// shoved neighboring status-bar segments left; unit-guard so CI catches a
|
||||
// reintroduction without needing Electron Playwright.
|
||||
expect(source).not.toMatch(/pr-\[\d+(?:\.\d+)?rem\]/)
|
||||
expect(source).toMatch(/className="group inline-flex items-center cursor-pointer pl-1 py-0\.5"/)
|
||||
})
|
||||
})
|
||||
@@ -116,7 +116,7 @@ function PetStatusSegmentInner(): React.JSX.Element {
|
||||
<DropdownMenuTrigger asChild>
|
||||
<button
|
||||
type="button"
|
||||
className="group inline-flex items-center cursor-pointer pl-1 pr-[6.5rem] py-0.5"
|
||||
className="group inline-flex items-center cursor-pointer pl-1 py-0.5"
|
||||
aria-label={translate(
|
||||
'auto.components.status.bar.PetStatusSegment.aec479308a',
|
||||
'Pet menu'
|
||||
|
||||
Reference in New Issue
Block a user