chore: refactoring and tests, splitting up files (#12495)

This commit is contained in:
Adam
2026-02-06 10:02:31 -06:00
committed by GitHub
parent a4bc883595
commit 2c58dd6203
117 changed files with 9457 additions and 5827 deletions
@@ -0,0 +1,16 @@
export const terminalTabLabel = (input: {
title?: string
titleNumber?: number
t: (key: string, vars?: Record<string, string | number | boolean>) => string
}) => {
const title = input.title ?? ""
const number = input.titleNumber ?? 0
const match = title.match(/^Terminal (\d+)$/)
const parsed = match ? Number(match[1]) : undefined
const isDefaultTitle = Number.isFinite(number) && number > 0 && Number.isFinite(parsed) && parsed === number
if (title && !isDefaultTitle) return title
if (number > 0) return input.t("terminal.title.numbered", { number })
if (title) return title
return input.t("terminal.title")
}