fix(board): stop truncating workflows longer than 12 columns (#11605)

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
Eugenio Jesus Jose Valeiras
2026-07-30 23:58:42 -07:00
committed by GitHub
co-authored by OrcaWin
parent 94cf2f1422
commit ef9e6ab9a8
9 changed files with 657 additions and 40 deletions
+23
View File
@@ -10,6 +10,29 @@ import {
} from './workspace-statuses'
describe('workspace status visuals', () => {
it.each([13, 20, 21, 64])('keeps all %i authored columns in order', (count) => {
const authored = Array.from({ length: count }, (_, index) => ({
id: `state-${index + 1}`,
label: `State ${index + 1}`
}))
const statuses = normalizeWorkspaceStatuses(authored)
expect(statuses).toHaveLength(count)
expect(statuses.map((status) => status.id)).toEqual(authored.map((status) => status.id))
})
it('normalizes every valid status without truncating the workflow', () => {
const authored = Array.from({ length: 500 }, (_, index) => ({
id: `state-${index}`,
label: `State ${index}`
}))
expect(normalizeWorkspaceStatuses(authored).map((status) => status.id)).toEqual(
authored.map((status) => status.id)
)
})
it('keeps the default workflow order', () => {
expect(cloneDefaultWorkspaceStatuses().map((status) => status.id)).toEqual([
'todo',
+1 -2
View File
@@ -9,7 +9,6 @@ export { DEFAULT_WORKSPACE_STATUSES } from './workspace-status-defaults'
const WORKSPACE_STATUS_GROUP_PREFIX = 'workspace-status:'
const MAX_STATUS_LABEL_LENGTH = 32
const MAX_WORKSPACE_STATUSES = 12
type WorkspaceStatusNormalizationOptions = {
migrateDefaultWorkflowStatuses?: boolean
migrateLegacyDefaultStatusVisuals?: boolean
@@ -169,7 +168,7 @@ function normalizeWorkspaceStatusesInternal(
const statuses: WorkspaceStatusDefinition[] = []
const usedIds = new Set<string>()
for (const rawStatus of value.slice(0, MAX_WORKSPACE_STATUSES)) {
for (const rawStatus of value) {
if (!rawStatus || typeof rawStatus !== 'object' || Array.isArray(rawStatus)) {
continue
}