Skip to content
Merged
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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to Team Tracker are documented here, written for people usin

See [CLAUDE.md](CLAUDE.md#changelog) for how and when to update this file.

## [3.6.3] - 2026-11-07

### Added
- Alt+C shows or hides the calendar on Daily notes, and also opens the calendar on a date field.

### Changed
- Long team names in the sidebar shrink and wrap onto a third line before they are cut off with an ellipsis, so even longer names show in full.
- When the sidebar is too narrow for "Team Tracker", the header button shows "TT" instead of a cut-off name.
- F1 on General notes or a person's notes opens the Editor tab of Help; the day-navigation keys now live only on a Daily notes tab.

## [3.6.2] - 2026-11-07

### Changed
Expand Down
12 changes: 12 additions & 0 deletions e2e/font-size-layout.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ for (const size of ['XS', 'XL'] as const) {
})
}

test('a long team name shrinks before it ellipsizes, and the app-name button becomes "TT" when the name does not fit', async ({ page }) => {
await openDoc(page, buildDoc('XL', { kind: 'general' }))
const name = page.locator('.tt-team-list .tt-team-name').first()
const label = page.locator('.tt-app-name-label')
// The fixture's team name needs more than two lines at full size.
expect(await name.evaluate((e) => e.style.fontSize)).not.toBe('')
await expect(label).toHaveText('TT')
// Collapsed, the button's column hugs its label, so the full name fits again.
await page.locator('.tt-sidebar-toggle').click()
await expect(label).toHaveText('Team Tracker')
})

// pt-BR: the save pill's longest label is the widest header text, which is what squeezed the search box to an icon.
test('header search keeps a usable width with the sidebar collapsed and a long team name (XL)', async ({ page }) => {
await openDoc(page, buildDoc('XL', { kind: 'general' }, { sidebarCollapsed: true, locale: 'pt-BR' }))
Expand Down
4 changes: 2 additions & 2 deletions e2e/help.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test.describe('help', () => {
const activeTab = page.locator('.tt-prefs-tab-btn.active')

await page.locator('.tt-btn-help').click()
await expect(activeTab).toContainText('Notes')
await expect(activeTab).toContainText('Editor')
await page.keyboard.press('Escape')
await expect(page.getByRole('dialog')).toHaveCount(0)

Expand All @@ -41,7 +41,7 @@ test.describe('help', () => {

await page.keyboard.press('F1')
await expect(dialog).toBeVisible()
await expect(page.locator('.tt-prefs-tab-btn.active')).toContainText('Notes')
await expect(page.locator('.tt-prefs-tab-btn.active')).toContainText('Editor')
await page.keyboard.press('F1')
await expect(dialog).toHaveCount(0)

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "team-tracker",
"version": "3.6.2",
"version": "3.6.3",
"homepage": "https://fmpallini.github.io/team-tracker/",
"repository": "fmpallini/team-tracker",
"private": true,
Expand Down
8 changes: 4 additions & 4 deletions src/core/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ sidebar_teams_heading: 'Times',
editor_help_title: 'Ajuda do editor',
help_tab_global: 'Global',
help_tab_editor: 'Editor',
help_tab_notes: 'Notas',
help_tab_people: 'Pessoas',
help_tab_pane: 'painel',
help_tab_pane_title: 'Módulo do painel em foco',
Expand Down Expand Up @@ -402,6 +401,7 @@ sidebar_teams_heading: 'Times',
help_global_pane_module: 'Trocar módulo do painel em foco',
help_global_daily_nav: 'Dia anterior / próximo / hoje (notas diárias)',
help_global_daily_nav_content: 'Pular para o dia anterior / próximo que tem uma nota',
help_global_calendar_toggle: 'Mostrar/ocultar o calendário (notas diárias)',
help_global_fullscreen: 'Tela cheia',
help_global_row_nav: 'Navegar entre linhas e cartões (riscos, marcos, tarefas)',
help_global_move_item: 'Mover o item focado (time, tarefa, risco, pessoa) — os detalhes estão na aba de cada módulo',
Expand Down Expand Up @@ -462,7 +462,7 @@ sidebar_teams_heading: 'Times',
template_picker_empty: 'Nenhum template disponível',
calendar_prev_month_title: 'Mês anterior',
calendar_next_month_title: 'Próximo mês',
calendar_toggle_title: 'Mostrar/ocultar calendário',
calendar_toggle_title: 'Mostrar/ocultar calendário (Alt+C)',
calendar_weekday_0: 'Dom',
calendar_weekday_1: 'Seg',
calendar_weekday_2: 'Ter',
Expand Down Expand Up @@ -1025,7 +1025,6 @@ sidebar_teams_heading: 'Teams',
editor_help_title: 'Editor help',
help_tab_global: 'Global',
help_tab_editor: 'Editor',
help_tab_notes: 'Notes',
help_tab_people: 'People',
help_tab_pane: 'pane',
help_tab_pane_title: 'The focused pane\'s module',
Expand Down Expand Up @@ -1100,6 +1099,7 @@ sidebar_teams_heading: 'Teams',
help_global_pane_module: 'Switch the focused pane\'s module',
help_global_daily_nav: 'Previous / next / today (daily notes)',
help_global_daily_nav_content: 'Jump to the previous / next day that has a note',
help_global_calendar_toggle: 'Show/hide the calendar (daily notes)',
help_global_fullscreen: 'Fullscreen',
help_global_row_nav: 'Navigate between rows and cards (risks, milestones, tasks)',
help_global_move_item: 'Move the focused item (team, task, risk, person) — details are on each module\'s tab',
Expand Down Expand Up @@ -1156,7 +1156,7 @@ sidebar_teams_heading: 'Teams',
template_picker_empty: 'No templates available',
calendar_prev_month_title: 'Previous month',
calendar_next_month_title: 'Next month',
calendar_toggle_title: 'Show/hide calendar',
calendar_toggle_title: 'Show/hide calendar (Alt+C)',
calendar_weekday_0: 'Sun',
calendar_weekday_1: 'Mon',
calendar_weekday_2: 'Tue',
Expand Down
5 changes: 4 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { t, todayIso } from './core/i18n'
import { currentLoc } from './core/nav'
import { addDaysIso } from './core/date'
import { findTeam, nearestDatedNote } from './core/document'
import { renderDailyNotes, setDailyCalendarSpaceConstrained } from './modules/daily-notes'
import { renderDailyNotes, setDailyCalendarSpaceConstrained, toggleDailyCalendar } from './modules/daily-notes'
import { renderGeneralNotes } from './modules/general-notes'
import { renderPeopleTree } from './modules/people-tree'
import { renderPersonNotes } from './modules/person-notes'
Expand Down Expand Up @@ -657,6 +657,9 @@ async function onDocumentOpened(opened: OpenedDocument): Promise<boolean> {
pm.openInPane(idx, { teamId: loc.teamId, ref: { kind: 'daily', date } }, { flashTitle })
return
}
case 'toggleCalendar':
toggleDailyCalendar(store)
return
case 'selectPane':
if (navPastModelessCard()) pm.switchPane(action.index)
return
Expand Down
17 changes: 12 additions & 5 deletions src/modules/daily-notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ function applyCalendarCollapsed(entry: CalendarColEntry): void {
entry.toggleBtn.hidden = calendarSpaceConstrained
}

/**
* Shows/hides the calendar column of every mounted daily pane (nav.calendarCollapsed
* is per document, so they all follow). A no-op while the window is too narrow for
* the column: nothing is visible to toggle, and the pref must not flip unseen.
*/
export function toggleDailyCalendar(store: Store): void {
if (calendarSpaceConstrained) return
store.updateNav((d) => { d.nav.calendarCollapsed = !d.nav.calendarCollapsed })
for (const entry of mountedCalendarCols) if (entry.store === store) applyCalendarCollapsed(entry)
}

export function setDailyCalendarSpaceConstrained(constrained: boolean): void {
calendarSpaceConstrained = constrained
for (const entry of mountedCalendarCols) applyCalendarCollapsed(entry)
Expand Down Expand Up @@ -194,11 +205,7 @@ export const renderDailyNotes = withDisposal((container: HTMLElement, loc: Loc,
class: 'tt-daily-calendar-toggle',
title: t(lc, 'calendar_toggle_title'),
icon: 'calendar',
onclick: () => {
const collapsed = !ctx.store.doc.nav.calendarCollapsed
ctx.store.updateNav((d) => { d.nav.calendarCollapsed = collapsed })
applyCalendarCollapsed(calendarColEntry)
},
onclick: () => toggleDailyCalendar(ctx.store),
})
// Registered for the lifetime of this mount so setDailyCalendarSpaceConstrained()
// can fold/unfold it as the window crosses the narrow threshold; unregistered
Expand Down
4 changes: 4 additions & 0 deletions src/ui/app-hotkeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export type AppHotkeyAction =
* stable `e.code` on every layout.
*/
| { type: 'dayNav'; to: 'prev' | 'next' | 'today' | 'prevWithContent' | 'nextWithContent' }
/** Alt+C → show/hide the daily-notes calendar (only while the focused pane shows a daily note). */
| { type: 'toggleCalendar' }
/** Alt+Left / Alt+Right → focus pane 0 / pane 1. */
| { type: 'selectPane'; index: 0 | 1 }
/** Alt+Up → toggle single/dual pane. */
Expand Down Expand Up @@ -162,6 +164,8 @@ export function resolveAppHotkey(e: KeyboardEvent, ctx: AppHotkeyContext): AppHo
return { type: 'dayNav', to: dayPrevContent ? 'prevWithContent' : 'nextWithContent' }
}

if (matchKey(e, 'c')) return ctx.focusedPaneShowsDailyNote ? { type: 'toggleCalendar' } : null

if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {
return { type: 'selectPane', index: e.key === 'ArrowLeft' ? 0 : 1 }
}
Expand Down
7 changes: 4 additions & 3 deletions src/ui/date-picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { createCalendar, type CalendarMarks } from './calendar'
import { placePopover } from '../core/popover-place'
import { isReadOnlyLocked } from './readonly-lock'
import { el, bindOutsideDismiss, blurOnEnter } from './dom'
import { isPlainKey } from './hotkeys'
import { isPlainKey, matchKey } from './hotkeys'

const NO_MARKS: CalendarMarks = { hasNote: () => false, milestones: () => [], actionItems: () => [], backlinks: () => 0 }

Expand Down Expand Up @@ -212,10 +212,11 @@ export function createDatePicker(opts: DatePickerOptions): DatePickerHandle {

// Keys on the field. Up/Down step a day and t is today, from what the field
// holds (today when empty); Alt+Down opens the calendar and goes into it, as
// on a native date field. That chord is also the pane swap, so it stops here.
// on a native date field, and Alt+C does the same (the key that shows or hides
// the daily-notes calendar). Alt+Down is also the pane swap, so both stop here.
function onFieldKeydown(e: KeyboardEvent): void {
if (isReadOnlyLocked()) return
if (e.key === 'ArrowDown' && e.altKey && !e.ctrlKey && !e.metaKey && !e.shiftKey) {
if (e.altKey && !e.ctrlKey && !e.metaKey && !e.shiftKey && (e.key === 'ArrowDown' || matchKey(e, 'c'))) {
e.preventDefault()
e.stopPropagation()
if (!popover) openPopover()
Expand Down
39 changes: 39 additions & 0 deletions src/ui/fit-text.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// src/ui/fit-text.ts — shrink-to-fit for line-clamped text. CSS can clamp a
// name to N lines with an ellipsis but cannot pick a smaller font first, so the
// clamped element is measured here: while its content is taller than its box,
// step the font down, and leave the ellipsis for what still overflows at the
// floor. Idempotent (every call starts again from the stylesheet's size), so a
// ResizeObserver can call it freely.

/** Font-size multipliers tried in order after the stylesheet's own size; the smallest also gets a third line before the ellipsis. */
const STEPS: readonly { scale: number; lines?: number }[] = [{ scale: 0.92 }, { scale: 0.85 }, { scale: 0.78, lines: 3 }]
/** The stylesheet sets both spellings of the clamp, so an override must too. */
const CLAMP_PROPS = ['-webkit-line-clamp', 'line-clamp']
/** Never go below this many px, whatever the user's text-size preference. */
const MIN_PX = 10

function overflows(node: HTMLElement): boolean {
return node.scrollHeight > node.clientHeight + 1
}

/** Fits every `selector` match under `root`. A hidden or detached node measures 0 and keeps its normal size. */
export function fitText(root: ParentNode, selector: string): void {
for (const node of root.querySelectorAll<HTMLElement>(selector)) {
node.style.fontSize = ''
for (const prop of CLAMP_PROPS) node.style.removeProperty(prop)
if (!overflows(node)) continue
const base = parseFloat(getComputedStyle(node).fontSize)
for (const { scale, lines } of STEPS) {
if (base * scale < MIN_PX) break
node.style.fontSize = `${scale}em`
if (lines) for (const prop of CLAMP_PROPS) node.style.setProperty(prop, String(lines))
if (!overflows(node)) break
}
}
}

/** Sets `full` as the node's text, or `short` when the full text is clipped horizontally (it must be `min-width: 0; overflow: hidden`). */
export function abbreviateWhenClipped(node: HTMLElement, full: string, short: string): void {
node.textContent = full
if (node.scrollWidth > node.clientWidth + 1) node.textContent = short
}
9 changes: 5 additions & 4 deletions src/ui/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type HelpTab = 'global' | 'editor' | 'notes' | 'people' | 'tasks' | 'mile

/** Which tab documents a pane showing `kind`. */
const PANE_TAB: Record<ModuleRef['kind'], HelpTab> = {
daily: 'notes', general: 'notes', person: 'notes',
daily: 'notes', general: 'editor', person: 'editor',
stakeholders: 'people', members: 'people',
actions: 'tasks', milestones: 'milestones', risks: 'risks',
}
Expand Down Expand Up @@ -113,7 +113,7 @@ const listRows = (lc: Locale): Rows => [
['Delete', 'help_global_row_delete'],
]

const dateRows: Rows = [['↑ / ↓, t, Alt+↓', 'help_global_date_keys']]
const dateRows: Rows = [['↑ / ↓, t, Alt+C / Alt+↓', 'help_global_date_keys']]

// --- App window ------------------------------------------------------------

Expand Down Expand Up @@ -259,18 +259,19 @@ const TABS: readonly TabDef[] = [
textSection(ctx, 'help_refs_heading', 'help_refs_text'),
textSection(ctx, 'help_templates_heading', 'help_templates_text'),
textSection(ctx, 'help_images_heading', 'help_images_text'),
rowsSection(ctx, 'help_sec_leave', [['Esc', 'help_notes_leave']]),
rowsSection(ctx, 'help_sec_history', historyRows),
],
},
{
id: 'notes',
label: 'help_tab_notes',
label: 'module_daily',
build: (ctx) => [
rowsSection(ctx, 'help_sec_days', [
['Alt+[ / Alt+] / Alt+T', 'help_global_daily_nav'],
['Alt+, / Alt+.', 'help_global_daily_nav_content'],
['Alt+C', 'help_global_calendar_toggle'],
]),
rowsSection(ctx, 'help_sec_leave', [['Esc', 'help_notes_leave']]),
el(
'div',
{ class: 'tt-help-section' },
Expand Down
20 changes: 18 additions & 2 deletions src/ui/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { iconButton, setIconButtonTitle } from './icons'
import { formatHHMM, formatAge } from '../core/date'
import type { FileHealth } from '../core/file-snapshot'
import { syncThemeColor } from '../core/theme-color'
import { abbreviateWhenClipped } from './fit-text'

/** What the save pill reports. The file's own health, plus two conditions that outrank it. */
export type PillHealth = FileHealth['kind'] | 'store-error' | 'readonly'
Expand Down Expand Up @@ -171,11 +172,24 @@ export function createShell(locale: Locale): Shell {
'<svg viewBox="0 0 16 16" width="10" height="10" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3.5 6L8 10.5L12.5 6"/></svg>'
const appNameBtn = el(
'button',
{ class: 'tt-app-name', type: 'button', title: t(locale, 'app_name_button_title'), onclick: () => appNameHandler?.() },
// The label can shrink to "TT" (below), so the button keeps the full name for assistive tech.
{ class: 'tt-app-name', type: 'button', title: t(locale, 'app_name_button_title'), 'aria-label': t(locale, 'app_name'), onclick: () => appNameHandler?.() },
appNameLabel,
appNameChevron
)
headerLeft.appendChild(appNameBtn)
// Where the slot is too narrow for the name (sidebar open at a large text
// size) the label becomes "TT", the app icon's own monogram, instead of an
// ellipsized "Team T…". `fittedWidth` is the button's width right after the
// last fit: the swap itself can resize the button (collapsed sidebar: its
// column hugs the label), and that resize must not trigger a fit that undoes it.
let fittedWidth = -1
function fitAppName(): void {
abbreviateWhenClipped(appNameLabel, t(currentLocale, 'app_name'), 'TT')
fittedWidth = appNameBtn.offsetWidth
}
const appNameObserver = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(() => { if (appNameBtn.offsetWidth !== fittedWidth) fitAppName() })
appNameObserver?.observe(appNameBtn)

// An inline SVG (currentColor stroke) rather than a clock emoji: emoji
// glyph metrics vary by platform font and never sit flush with the pill's
Expand Down Expand Up @@ -339,13 +353,14 @@ export function createShell(locale: Locale): Shell {
document.documentElement.dataset.size = prefs.fontSize
if (localeChanged) {
appNameBtn.title = t(currentLocale, 'app_name_button_title')
appNameLabel.textContent = t(currentLocale, 'app_name')
appNameBtn.setAttribute('aria-label', t(currentLocale, 'app_name'))
setIconButtonTitle(fullscreenBtn, t(currentLocale, 'fullscreen'))
setIconButtonTitle(closeFileBtn, t(currentLocale, 'close_file_title'))
setIconButtonTitle(settingsBtn, t(currentLocale, 'settings'))
setIconButtonTitle(helpBtn, t(currentLocale, 'help_global_title'))
}
if (localeChanged) renderSaveIndicator()
fitAppName() // the text size changes the label's width without changing the button's
}

function setTitle(fileName: string | null): void {
Expand Down Expand Up @@ -399,6 +414,7 @@ export function createShell(locale: Locale): Shell {

function dispose(): void {
mq.removeEventListener('change', onSystemThemeChange)
appNameObserver?.disconnect()
if (ageTimer !== null) clearInterval(ageTimer)
ageTimer = null
}
Expand Down
9 changes: 9 additions & 0 deletions src/ui/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { attachEmojiPicker } from './emoji-picker'
import { paintSelection, clampMove, selectableRowProps } from './select-list'
import { openDuePanel } from './due-panel'
import { revealLoc } from './reveal-loc'
import { fitText } from './fit-text'

export interface SidebarActions {
selectTeam(id: string): void
Expand Down Expand Up @@ -311,6 +312,7 @@ export function mountSidebar(shell: Shell, store: Store, pm: PaneManager, action
})
switcherEl = el('div', { class: 'tt-team-switcher-dropdown' }, switcherListEl)
document.body.appendChild(switcherEl)
fitText(switcherListEl, '.tt-team-name')
const rect = headerTeamIndicator.getBoundingClientRect()
switcherEl.style.left = `${rect.left}px`
switcherEl.style.top = `${rect.bottom + 4}px`
Expand All @@ -335,6 +337,11 @@ export function mountSidebar(shell: Shell, store: Store, pm: PaneManager, action

const contentEl = el('div', { class: 'tt-sidebar-content' })
const listEl = el('div', { class: 'tt-team-list' })
// Names shrink before they ellipsize (fit-text.ts). A row built while the
// sidebar was collapsed or not yet attached measured 0, so the list's own
// size change — expanding, first layout, a text-size preference — refits it.
const fitObserver = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(() => fitText(listEl, '.tt-team-name'))
fitObserver?.observe(listEl)
const addBtn = el(
'button',
{
Expand Down Expand Up @@ -712,6 +719,7 @@ export function mountSidebar(shell: Shell, store: Store, pm: PaneManager, action

listEl.appendChild(item)
})
fitText(listEl, '.tt-team-name')
}

function buildTeamForm(initial?: { name: string; emoji: string }): {
Expand Down Expand Up @@ -881,6 +889,7 @@ export function mountSidebar(shell: Shell, store: Store, pm: PaneManager, action
closeTeamSwitcher()
unsubscribeContent()
unsubscribeMutate()
fitObserver?.disconnect()
document.removeEventListener(ADD_TEAM_REQUEST_EVENT, onAddTeamRequest)
stopDayWatch()
},
Expand Down
Loading
Loading