mirror of
https://github.com/lukaszraczylo/ghtracker.git
synced 2026-10-14 00:58:36 +00:00
feat(ui): add a progress loading screen and lazy project list
The loading screen shows live scan progress from the server, with a pulsing outline of the dashboard. The server now reports how many repositories the running scan has finished. The project list renders 20 rows first and adds more as the end scrolls into view. Groups on very wide screens fill two balanced columns, the fact figures sit in a row under the health strip, and the headline counts match the rows listed below it.
This commit is contained in:
@@ -134,6 +134,15 @@ describe('tracker store', () => {
|
||||
expect(store.owners).toEqual(['o'])
|
||||
})
|
||||
|
||||
it('counts rows by severity so the headline matches the lists', async () => {
|
||||
mockFetch(() => json(mixedState()))
|
||||
const store = useTrackerStore()
|
||||
await store.load()
|
||||
// three alerts, but the two on the same pull request merge into one row
|
||||
expect(store.rowCounts).toEqual({ crit: 2, warn: 0 })
|
||||
expect(store.facets.severity.all).toBe(store.rowCounts.crit + store.rowCounts.warn)
|
||||
})
|
||||
|
||||
it('searches projects by name and clears every filter at once', async () => {
|
||||
mockFetch(() => json(mixedState()))
|
||||
const store = useTrackerStore()
|
||||
|
||||
@@ -122,6 +122,12 @@ export const useTrackerStore = defineStore('tracker', () => {
|
||||
)
|
||||
})
|
||||
const activeFilters = computed(() => activeFilterCount(filters.value))
|
||||
/** Rows by severity, so the headline matches the lists below it (alerts on one item merge into one row). */
|
||||
const rowCounts = computed(() => {
|
||||
const out = { crit: 0, warn: 0 }
|
||||
for (const b of blocks.value) for (const r of b.rows) out[r.severity] += 1
|
||||
return out
|
||||
})
|
||||
const repoCounts = computed(() => (state.value ? countByRepo(state.value) : new Map()))
|
||||
const facts = computed(() => (state.value ? computeFacts(state.value) : null))
|
||||
|
||||
@@ -189,6 +195,7 @@ export const useTrackerStore = defineStore('tracker', () => {
|
||||
activeFilters,
|
||||
visibleBlocks,
|
||||
repoCounts,
|
||||
rowCounts,
|
||||
facts,
|
||||
toggleRepo,
|
||||
clearFilters,
|
||||
|
||||
Reference in New Issue
Block a user