Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark the current successor tab with [data-successor] attribute #1882

Open
wants to merge 1 commit into
base: v5
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions src/services/tabs.fg.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export function mutateNativeTabToSideberyTab(nativeTab: NativeTab): Tab {
color: null,
isGroup: tab.isGroup,
preview: false,
isSuccessor: false
}
}

Expand Down Expand Up @@ -123,6 +124,7 @@ export function createReactiveProps(tab: Tab): ReactiveTabProps {
color: null,
isGroup: tab.isGroup,
preview: false,
isSuccessor: false
}

if (reactFn) return reactFn(rProps)
Expand Down Expand Up @@ -2704,6 +2706,15 @@ function updateSuccession(exclude?: ID[]) {
Logs.err('Tabs.updateSuccession: Cannot update succession:', err)
})
activeTab.successorTabId = target.id

// Mark the current successor tab
target.reactive.isSuccessor = true
const prevPrevActive = Tabs.byId[Tabs.successorId]
if (prevPrevActive) {
prevPrevActive.reactive.isSuccessor = false
}
Tabs.successorId = target.id

return target
}
}
Expand Down
1 change: 1 addition & 0 deletions src/services/tabs.fg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export const Tabs = {
removingTabs: [] as ID[],
ignoreTabsEvents: false,
activeId: NOID,
successorId: NOID,
blockedScrollPosition: false,
activateSelectedOnMouseLeave: false,
sorting: false,
Expand Down
1 change: 1 addition & 0 deletions src/sidebar/components/tab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
:data-unread="tab.reactive.unread"
:data-edit="tab.reactive.customTitleEdit"
:data-preview="tab.reactive.preview"
:data-successor="tab.reactive.isSuccessor"
:title="tab.reactive.tooltip"
:draggable="!tab.reactive.customTitleEdit"
@dragstart="onDragStart"
Expand Down
1 change: 1 addition & 0 deletions src/types/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export interface ReactiveTabProps {
customColor: string | null
isGroup: boolean
preview: boolean
isSuccessor: boolean
}

export interface InlineTabData {
Expand Down