feat(frontend): add mobile composer tools menu and base branch select

This commit is contained in:
Chris Scott committed 2026-10-04 00:05:53 -04:00
1 parent fac23b1f1a
commit 4a2e695ec2
21 files changed
+819 -158

No files matched your search

+54
View File
@@ -5,6 +5,7 @@ import {
sanitizeForTTS,
randomId,
formatShortRelativeTime,
getOriginOnlyBranchNames,
} from './utils'
describe('sanitizeForTTS', () => {
@@ -89,6 +90,59 @@ describe('sanitizeForTTS', () => {
})
})
describe('getOriginOnlyBranchNames', () => {
it('returns short names for origin remote branches without a local branch', () => {
expect(
getOriginOnlyBranchNames([
{ name: 'main', type: 'local' },
{ name: 'remotes/origin/release', type: 'remote' },
]),
).toEqual(['release'])
})
it('excludes remote branches shadowed by a local branch', () => {
expect(
getOriginOnlyBranchNames([
{ name: 'release', type: 'local' },
{ name: 'remotes/origin/release', type: 'remote' },
]),
).toEqual([])
})
it('excludes non-origin remotes', () => {
expect(
getOriginOnlyBranchNames([
{ name: 'remotes/upstream/release', type: 'remote' },
{ name: 'remotes/origin/release', type: 'remote' },
]),
).toEqual(['release'])
})
it('excludes HEAD', () => {
expect(
getOriginOnlyBranchNames([
{ name: 'remotes/origin/HEAD', type: 'remote' },
{ name: 'remotes/origin/main', type: 'remote' },
]),
).toEqual(['main'])
})
it('excludes empty short names', () => {
expect(getOriginOnlyBranchNames([{ name: 'remotes/origin/', type: 'remote' }])).toEqual([])
})
it('dedupes while preserving input order', () => {
expect(
getOriginOnlyBranchNames([
{ name: 'remotes/origin/zeta', type: 'remote' },
{ name: 'remotes/origin/alpha', type: 'remote' },
{ name: 'remotes/origin/zeta', type: 'remote' },
{ name: 'remotes/origin/beta', type: 'remote' },
]),
).toEqual(['zeta', 'alpha', 'beta'])
})
})
describe('randomId', () => {
const originalRandomUUID = globalThis.crypto?.randomUUID