sync: Major UI updates from private repo (Jan 16-24)
Features synced: - UI Panels Refactor: flexible pane system with ChatPane, NodePane, DimensionsPane, WorkflowsPane, ViewsPane, MapPane - Source Content Reader: content type detection + 4 formatters (transcript, book, markdown, raw) - Source Content Search: Cmd+F search in Source Reader - Feed Layout Overhaul: LeftToolbar, SplitHandle, CollapsedRail - Map Panel: promoted to first-class pane - Edge policy simplification: auto-inference + direction correction New files: - src/components/panes/* (pane system) - src/components/layout/CollapsedRail.tsx - src/components/layout/LeftToolbar.tsx - src/components/layout/SplitHandle.tsx - src/components/focus/source/* (Source Reader + formatters) - src/components/views/ViewsOverlay.tsx Updated: - ThreePanelLayout.tsx (complete refactor) - FocusPanel.tsx (Source tab integration) - API routes (dimensions GET, edges auto-inference) - Database services (nodes, edges, dimensions) Dependencies added: - react-markdown - remark-gfm Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
cea1df7f1f
commit
05523b7cb2
@@ -5,6 +5,45 @@ import { DimensionService } from '@/services/database/dimensionService';
|
||||
|
||||
export const runtime = 'nodejs';
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const sqlite = getSQLiteClient();
|
||||
|
||||
// Get all dimensions with their counts
|
||||
const result = sqlite.query(`
|
||||
WITH dimension_counts AS (
|
||||
SELECT nd.dimension, COUNT(*) AS count
|
||||
FROM node_dimensions nd
|
||||
GROUP BY nd.dimension
|
||||
)
|
||||
SELECT
|
||||
d.name AS dimension,
|
||||
d.description,
|
||||
d.is_priority AS isPriority,
|
||||
COALESCE(dc.count, 0) AS count
|
||||
FROM dimensions d
|
||||
LEFT JOIN dimension_counts dc ON dc.dimension = d.name
|
||||
ORDER BY d.is_priority DESC, d.name ASC
|
||||
`);
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
data: result.rows.map((row: any) => ({
|
||||
dimension: row.dimension,
|
||||
description: row.description,
|
||||
isPriority: Boolean(row.isPriority),
|
||||
count: Number(row.count)
|
||||
}))
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error fetching dimensions:', error);
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
error: 'Failed to fetch dimensions'
|
||||
}, { status: 500 });
|
||||
}
|
||||
}
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
|
||||
@@ -27,10 +27,10 @@ export async function POST(request: NextRequest) {
|
||||
const body = await request.json();
|
||||
|
||||
// Validate required fields
|
||||
if (!body.from_node_id || !body.to_node_id || typeof body.explanation !== 'string') {
|
||||
if (!body.from_node_id || !body.to_node_id) {
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
error: 'Missing required fields: from_node_id, to_node_id, and explanation are required'
|
||||
error: 'Missing required fields: from_node_id and to_node_id are required'
|
||||
}, { status: 400 });
|
||||
}
|
||||
|
||||
@@ -57,15 +57,9 @@ export async function POST(request: NextRequest) {
|
||||
|
||||
const fromId = parseInt(body.from_node_id);
|
||||
const toId = parseInt(body.to_node_id);
|
||||
// Explanation can be empty - service will auto-generate
|
||||
const explanation = String(body.explanation || '').trim();
|
||||
|
||||
if (!explanation) {
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
error: 'explanation is required and cannot be empty'
|
||||
}, { status: 400 });
|
||||
}
|
||||
|
||||
const skipInference = Boolean(body.skip_inference);
|
||||
const createdVia = (() => {
|
||||
const raw = typeof body.created_via === 'string' ? body.created_via : '';
|
||||
|
||||
Reference in New Issue
Block a user