Load/render workspace alignment (#182)
* docs: plan load render workspace alignment * fix: normalize workspace status hydration * fix: avoid duplicate backlog hydration load * refactor: use sprint store active story * refactor: migrate solo to workspace store * chore: stabilize verification ignores
This commit is contained in:
parent
98ee05d458
commit
3b5cee823c
28 changed files with 1845 additions and 577 deletions
39
stores/solo-workspace/selectors.ts
Normal file
39
stores/solo-workspace/selectors.ts
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import type { SoloWorkspaceStore } from './store'
|
||||
import type { SoloColumnStatus, SoloTask, SoloUnassignedStory } from './types'
|
||||
|
||||
const EMPTY_TASKS: SoloTask[] = []
|
||||
const EMPTY_STORIES: SoloUnassignedStory[] = []
|
||||
|
||||
export function selectSoloTasksForColumn(
|
||||
status: SoloColumnStatus,
|
||||
): (s: SoloWorkspaceStore) => SoloTask[] {
|
||||
return (s) => {
|
||||
const ids = s.relations.taskIdsByColumn[status]
|
||||
if (!ids || ids.length === 0) return EMPTY_TASKS
|
||||
const out: SoloTask[] = []
|
||||
for (const id of ids) {
|
||||
const task = s.entities.tasksById[id]
|
||||
if (task) out.push(task)
|
||||
}
|
||||
return out.length === 0 ? EMPTY_TASKS : out
|
||||
}
|
||||
}
|
||||
|
||||
export function selectSoloUnassignedStories(s: SoloWorkspaceStore): SoloUnassignedStory[] {
|
||||
if (s.relations.unassignedStoryIds.length === 0) return EMPTY_STORIES
|
||||
const out: SoloUnassignedStory[] = []
|
||||
for (const id of s.relations.unassignedStoryIds) {
|
||||
const story = s.entities.unassignedStoriesById[id]
|
||||
if (story) out.push(story)
|
||||
}
|
||||
return out.length === 0 ? EMPTY_STORIES : out
|
||||
}
|
||||
|
||||
export function selectSoloTaskById(
|
||||
taskId: string | null,
|
||||
): (s: SoloWorkspaceStore) => SoloTask | null {
|
||||
return (s) => {
|
||||
if (!taskId) return null
|
||||
return s.entities.tasksById[taskId] ?? null
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue