Change the width of the minimap

pull/10375/head
Thibaud Colas 2023-04-18 01:41:47 +01:00
rodzic cd867ec952
commit 8f797266d2
3 zmienionych plików z 5 dodań i 12 usunięć

Wyświetl plik

@ -1,9 +1,8 @@
// If unset, default to the "mobile" height of the slim header.
$minimap-top-offset: var(--offset-top, calc(theme('spacing.slim-header') * 2));
$minimap-width: 300px;
$minimap-width: 260px;
$minimap-collapsed-width-mobile: 20px;
$minimap-collapsed-width: 30px;
$minimap-overflow: theme('spacing.2');
$minimap-z-index: calc(theme('zIndex.header') - 20);
@import './CollapseAll';
@ -24,10 +23,7 @@ $minimap-z-index: calc(theme('zIndex.header') - 20);
@include media-breakpoint-up(sm) {
transform: translateX(
calc(
var(--w-direction-factor) *
(100% - $minimap-collapsed-width - $minimap-overflow)
)
calc(var(--w-direction-factor) * (100% - $minimap-collapsed-width))
);
}
@ -101,7 +97,6 @@ $minimap-z-index: calc(theme('zIndex.header') - 20);
min-height: 70px;
:where(.w-minimap--expanded) & {
margin-inline-start: $minimap-overflow;
border-inline-start: 1px solid theme('colors.grey.100');
}
}
@ -109,7 +104,6 @@ $minimap-z-index: calc(theme('zIndex.header') - 20);
.w-minimap__list {
margin: 0;
padding: 0;
padding-inline-start: $minimap-overflow;
overflow-y: auto;
overflow-x: hidden;
list-style-type: none;
@ -123,7 +117,6 @@ $minimap-z-index: calc(theme('zIndex.header') - 20);
flex-grow: 1;
:where(.w-minimap--expanded) & {
margin-inline-start: $minimap-overflow;
border-inline-start: 1px solid theme('colors.grey.100');
}
}

Wyświetl plik

@ -7,7 +7,7 @@ const mockItem = {
toggle: document.createElement('button'),
panel: document.createElement('div'),
href: '',
label: 'text with more than 26 characters',
label: 'text with more than 22 characters',
icon: '',
required: true,
errorCount: 1,
@ -49,7 +49,7 @@ describe('MinimapItem', () => {
it('truncates long label texts', () => {
const wrapper = shallow(<MinimapItem {...mockProps} />);
expect(wrapper.text()).toBe('1<Icon />text with more than 26 cha…*');
expect(wrapper.text()).toBe('1<Icon />text with more than 22…*');
});
it('does not truncate short label texts', () => {

Wyświetl plik

@ -40,7 +40,7 @@ const MinimapItem: React.FunctionComponent<MinimapItemProps> = ({
'%(num)s errors',
errorCount,
).replace('%(num)s', `${errorCount}`);
const text = label.length > 26 ? `${label.substring(0, 26)}` : label;
const text = label.length > 22 ? `${label.substring(0, 22)}` : label;
return (
<a
href={href}