Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat: sort managed app quality categories

[._.]/ Adam Eivyd41b909a9427
diff --git a/client/src/components/apps/AppQuality.jsx b/client/src/components/apps/AppQuality.jsx
index 157366b2cc..16bd0812cf 100644
--- a/client/src/components/apps/AppQuality.jsx
+++ b/client/src/components/apps/AppQuality.jsx
@@ -1,7 +1,7 @@
import AppQualityRunner from './AppQualityRunner';
import AppQualityHistory from './AppQualityHistory';
import AppQualityScheduleForm from './AppQualityScheduleForm';
-import { Fragment, useState } from 'react';
+import { Fragment, useId, useState } from 'react';
import { Link, useSearchParams } from 'react-router';
import { formatDateShort } from '../../utils/formatters';
import { publishAppQualitySnapshot } from '../../services/apiApps';
@@ -24,6 +24,8 @@ const PUBLISH_SKIPPED = {
export default function AppQuality({ app, detail = false }) {
const [params] = useSearchParams();
const [publishing, setPublishing] = useState(false);
+ const [categorySort, setCategorySort] = useState('score');
+ const categorySortId = useId();
// User-initiated, so every outcome toasts (the wrapper is silent).
const publishSnapshot = async () => {
setPublishing(true);
@@ -46,7 +48,21 @@ export default function AppQuality({ app, detail = false }) {
};
const score = quality?.score;
const sortedCategories = quality?.categories
- ? [...quality.categories].sort((a, b) => (a.score ?? Infinity) - (b.score ?? Infinity))
+ ? [...quality.categories].sort((a, b) => {
+ if (categorySort === 'oldest-run') {
+ const aRun = Date.parse(a.assessedAt);
+ const bRun = Date.parse(b.assessedAt);
+ const aHasRun = Number.isFinite(aRun);
+ const bHasRun = Number.isFinite(bRun);
+ if (aHasRun !== bHasRun) return aHasRun ? 1 : -1;
+ if (aHasRun && aRun !== bRun) return aRun - bRun;
+ } else {
+ const aScore = a.score ?? Infinity;
+ const bScore = b.score ?? Infinity;
+ if (aScore !== bScore) return aScore < bScore ? -1 : 1;
+ }
+ return a.label.localeCompare(b.label) || a.id.localeCompare(b.id);
+ })
: [];
const hasAssessments = quality?.categories?.some(category => category.assessedAt);
const unscoredLabel = hasAssessments ? 'Quality: no qualifying score' : 'Quality: not assessed';
@@ -122,7 +138,21 @@ export default function AppQuality({ app, detail = false }) {
</div>
{!!quality?.categories?.length && (
<section aria-label="Category breakdown" className="min-w-0">
- <h4 className="text-sm font-medium mb-2">Category breakdown</h4>
+ <div className="mb-2 flex flex-wrap items-center justify-between gap-2">
+ <h4 className="text-sm font-medium">Category breakdown</h4>
+ <label htmlFor={categorySortId} className="flex items-center gap-2 text-xs text-gray-400">
+ Sort by
+ <select
+ id={categorySortId}
+ value={categorySort}
+ onChange={event => setCategorySort(event.target.value)}
+ className="rounded border border-port-border bg-port-bg px-2 py-1 text-port-text"
+ >
+ <option value="score">Worst score</option>
+ <option value="oldest-run">Oldest last run</option>
+ </select>
+ </label>
+ </div>
<table className="w-full text-sm text-left">
<thead className="text-gray-400 sticky top-0 bg-port-card">
<tr>
diff --git a/client/src/components/apps/AppQuality.test.jsx b/client/src/components/apps/AppQuality.test.jsx
index 855aaa37f3..afb62f7cf7 100644
--- a/client/src/components/apps/AppQuality.test.jsx
+++ b/client/src/components/apps/AppQuality.test.jsx
@@ -77,17 +77,23 @@ it('makes the category actions and header navigation look like distinct clickabl
expect(screen.getByRole('rowheader', { name: /Security/ })).toHaveClass('px-3', 'py-2.5');
});
-it('orders the category breakdown from lowest score to highest, with unscored categories last', async () => {
+it('sorts the category breakdown by worst score or oldest last run', async () => {
const app = { id: 'example', quality: { categories: [
- { id: 'ux', label: 'UX', score: 80, coverage: 'broad' },
- { id: 'security', label: 'Security', score: 20, coverage: 'broad' },
+ { id: 'ux', label: 'UX', score: 80, coverage: 'broad', assessedAt: '2026-09-12T00:00:00Z' },
+ { id: 'security', label: 'Security', score: 20, coverage: 'broad', assessedAt: '2026-09-13T00:00:00Z' },
{ id: 'perf', label: 'Perf', score: null, coverage: 'unavailable' },
- { id: 'tests', label: 'Tests', score: 60, coverage: 'broad' },
+ { id: 'tests', label: 'Tests', score: 60, coverage: 'broad', assessedAt: '2026-09-10T00:00:00Z' },
] } };
render(<MemoryRouter><AppQuality app={app} detail /></MemoryRouter>);
await screen.findByText(/No scored assessments/);
- const rowLabels = screen.getAllByRole('row').slice(1).map(row => within(row).queryByRole('rowheader')?.textContent);
+ const sortBy = screen.getByRole('combobox', { name: 'Sort by' });
+ expect(sortBy).toHaveValue('score');
+ let rowLabels = screen.getAllByRole('row').slice(1).map(row => within(row).queryByRole('rowheader')?.textContent);
expect(rowLabels.filter(Boolean)).toEqual(['SecurityRunner settings', 'TestsRunner settings', 'UXRunner settings', 'PerfRunner settings']);
+
+ fireEvent.change(sortBy, { target: { value: 'oldest-run' } });
+ rowLabels = screen.getAllByRole('row').slice(1).map(row => within(row).queryByRole('rowheader')?.textContent);
+ expect(rowLabels.filter(Boolean)).toEqual(['PerfRunner settings', 'TestsRunner settings', 'UXRunner settings', 'SecurityRunner settings']);
});
it('opens the shared runner beside unavailable category evidence while preserving URL filters', async () => {