Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/webviews/apps/plus/home/components/active-work.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
gl-breadcrumbs {
--gl-tooltip-text-transform: none;
}

.heading-branch-breadcrumb {
text-transform: none;
}
Expand All @@ -104,9 +103,6 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
@consume({ context: activeOverviewStateContext })
private _activeOverviewState!: ActiveOverviewState;

@state()
private repoCollapsed = true;

get isPro() {
return isSubscriptionTrialOrPaidFromState(this._homeState.subscription.state);
}
Expand Down Expand Up @@ -160,13 +156,13 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
return html`
<gl-section ?loading=${isFetching}>
<gl-breadcrumbs slot="heading">
<gl-breadcrumb-item collapsibleState="none" class="heading-repo-breadcrumb"
<gl-breadcrumb-item collapsibleState="collapsed" icon="repo" .ignoreFocusWithin=${true}
><gl-repo-button-group
.repository=${repo}
.icon=${false}
?disabled=${!hasMultipleRepositories}
?hasMultipleRepositories=${hasMultipleRepositories}
.source=${{ source: 'graph' } as const}
?expandable=${true}
@gl-click=${this.onRepositorySelectorClicked}
><span slot="tooltip">
Switch to Another Repository...
Expand Down
17 changes: 14 additions & 3 deletions src/webviews/apps/shared/components/breadcrumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ export class GlBreadcrumbItem extends LitElement {
transition: max-width 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

:host([collapsed]) .breadcrumb-item:not(:hover).ignore-focus-within .breadcrumb-label,
:host([collapsed]) .breadcrumb-item:not(:hover).ignore-focus-within slot[name='children'],
:host([collapsed]) .breadcrumb-item:not(:hover):not(:focus-within) .breadcrumb-label,
:host([collapsed]) .breadcrumb-item:not(:hover):not(:focus-within) slot[name='children'] {
max-width: 0;
Expand Down Expand Up @@ -170,6 +172,9 @@ export class GlBreadcrumbItem extends LitElement {
@property()
icon?: string;

@property()
ignoreFocusWithin?: boolean;

@property()
iconTooltip?: string;

Expand All @@ -186,9 +191,15 @@ export class GlBreadcrumbItem extends LitElement {
}

override render() {
const { collapsed, collapsible } = this;

return html`<div class=${classMap({ 'breadcrumb-item': true, collapsible: collapsible })}>
const { collapsed, collapsible, ignoreFocusWithin } = this;

return html`<div
class=${classMap({
'breadcrumb-item': true,
collapsible: collapsible,
'ignore-focus-within': ignoreFocusWithin ?? false,
})}
>
<span class="breadcrumb-content">
${this.renderIcon(collapsible, collapsed)}
<slot class="breadcrumb-label"></slot>
Expand Down
22 changes: 3 additions & 19 deletions src/webviews/apps/shared/components/repo-button-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,19 @@ export class GlRepoButtonGroup extends GlElement {
refButtonBaseStyles,
truncatedButtonStyles,
css`
:host([icons='1']:not([expandable])) {
:host([icons='1']) {
min-width: 7rem;
}

:host([icons='2']:not([expandable])) {
:host([icons='2']) {
min-width: 9.4rem;
}

:host([icons='2'][expandable]) {
min-width: 5.6rem;
}

.indicator-dot {
--gl-indicator-color: green;
--gl-indicator-size: 0.4rem;
margin-left: -0.2rem;
}

/* :host([expandable]) .truncated-button {
transition: max-width 0.3s cubic-bezier(0.25, 1, 0.5, 1);
} */

:host([expandable]:not(:hover, :focus-within)) .truncated-button {
min-width: 0;
max-width: 0;
}
`,
pickerIconStyles,
];
Expand All @@ -86,9 +73,6 @@ export class GlRepoButtonGroup extends GlElement {
@property({ type: Object })
source?: Source;

@property({ type: Boolean, reflect: true })
expandable = false;

@property({ type: Number, reflect: true })
get icons() {
if (this.repository?.provider === undefined) return undefined;
Expand Down Expand Up @@ -154,7 +138,7 @@ export class GlRepoButtonGroup extends GlElement {
const { provider } = repo;
const connectedIntegration = provider.integration?.connected;

return html`<gl-popover placement="bottom" trigger="hover click focus">
return html`<gl-popover placement="bottom">
<gl-button
slot="anchor"
part="provider-icon"
Expand Down