Skip to content

Commit a9ce9b8

Browse files
authored
fix/chrome-detect-workspace-and-ui-truncate (#10000)
* fix(chrome): detect workspace mode correctly for branch status * fix(ui): prevent header branch name overflow by truncating and hiding
1 parent 6f9be93 commit a9ce9b8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

apps/desktop/src/components/ChromeHeader.svelte

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@
5858
return 'gitbutler/workspace';
5959
});
6060
61-
const isNotInWorkspace = $derived(currentBranchName !== 'gitbutler/workspace');
61+
const isNotInWorkspace = $derived(
62+
currentMode?.type !== 'OpenWorkspace' && currentMode?.type !== 'Edit'
63+
);
6264
const [setBaseBranchTarget, targetBranchSwitch] = baseBranchService.setTarget;
6365
6466
async function switchToWorkspace() {
@@ -209,7 +211,7 @@
209211
<div class="chrome-current-branch">
210212
<div class="chrome-current-branch__content">
211213
<Icon name="branch-remote" color="var(--clr-text-2)" />
212-
<span class="text-12 text-semibold clr-text-1">{currentBranchName}</span>
214+
<span class="text-12 text-semibold clr-text-1 truncate">{currentBranchName}</span>
213215
{#if isNotInWorkspace}
214216
<span class="text-12 text-semibold clr-text-2"> read-only </span>
215217
{/if}
@@ -353,6 +355,7 @@
353355
.chrome-selector-wrapper {
354356
display: flex;
355357
position: relative;
358+
overflow: hidden;
356359
}
357360
358361
:global(.chrome-header .project-selector-btn) {
@@ -365,12 +368,14 @@
365368
align-items: center;
366369
padding-right: 2px;
367370
gap: 6px;
371+
text-wrap: nowrap;
368372
}
369373
370374
.chrome-current-branch {
371375
display: flex;
372376
align-items: center;
373377
padding: 0 10px 0 6px;
378+
overflow: hidden;
374379
border: 1px solid var(--clr-border-2);
375380
border-left: none;
376381
border-top-right-radius: 100px;
@@ -381,7 +386,9 @@
381386
.chrome-current-branch__content {
382387
display: flex;
383388
align-items: center;
389+
overflow: hidden;
384390
gap: 4px;
391+
text-wrap: nowrap;
385392
opacity: 0.7;
386393
}
387394
@@ -393,6 +400,7 @@
393400
.chrome-center {
394401
display: flex;
395402
flex-shrink: 1;
403+
overflow: hidden;
396404
gap: 8px;
397405
}
398406

0 commit comments

Comments
 (0)