This repository has been archived on 2026-06-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
FabledApp/lib/data/models/knowledge_item.dart
T
bvandeusen 58d4cfab4d feat: tablet landscape improvements
Shell: move Projects/News/Calendar into ShellRoute so the NavigationRail
persists across all screens. Show all 6 nav destinations on tablet
instead of 3+More overflow. Phone bottom nav unchanged.

Chat: master-detail layout on tablet — conversations list (320px) with
inline chat panel. Tapping a conversation updates state instead of
pushing a new route.

Knowledge: responsive grid (2 cols portrait, 3 cols landscape) with
card layout showing icon, title, body preview, and tags. Fix snippet
data — read json['snippet'] which the API actually sends. Bump snippet
length from 120 to 200 chars. Tasks now show description as snippet.

News: responsive grid with the same breakpoints. Larger snippet
(5 lines) in grid mode via snippetMaxLines parameter.

Briefing: centered reading column (maxWidth 700) on wide screens,
matching the web UI layout.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 01:31:52 -04:00

70 lines
2.1 KiB
Dart

import 'task.dart';
class KnowledgeItem {
final int id;
final String noteType; // 'note' | 'person' | 'place' | 'list' | 'task'
final String title;
final String body;
final List<String> tags;
final int? projectId;
final int? milestoneId;
final int? parentId;
// Task-only fields (null for non-tasks)
final String? status; // 'todo' | 'in_progress' | 'done' | 'cancelled'
final String? priority; // 'low' | 'normal' | 'high'
final String? dueDate;
final DateTime createdAt;
final DateTime updatedAt;
const KnowledgeItem({
required this.id,
required this.noteType,
required this.title,
required this.body,
required this.tags,
this.projectId,
this.milestoneId,
this.parentId,
this.status,
this.priority,
this.dueDate,
required this.createdAt,
required this.updatedAt,
});
factory KnowledgeItem.fromTask(Task task) => KnowledgeItem(
id: task.id,
noteType: 'task',
title: task.title,
body: task.description ?? '',
tags: const [],
projectId: task.projectId,
milestoneId: task.milestoneId,
parentId: task.parentId,
status: task.status.value,
priority: task.priority.value,
dueDate: task.dueDate?.toIso8601String(),
createdAt: task.createdAt,
updatedAt: task.updatedAt,
);
factory KnowledgeItem.fromJson(Map<String, dynamic> json) => KnowledgeItem(
id: json['id'] as int,
noteType: json['note_type'] as String? ?? 'note',
title: json['title'] as String? ?? '',
body: (json['snippet'] ?? json['body']) as String? ?? '',
tags: (json['tags'] as List<dynamic>?)
?.map((e) => e as String)
.toList() ??
[],
projectId: json['project_id'] as int?,
milestoneId: json['milestone_id'] as int?,
parentId: json['parent_id'] as int?,
status: json['status'] as String?,
priority: json['priority'] as String?,
dueDate: json['due_date'] as String?,
createdAt: DateTime.parse(json['created_at'] as String),
updatedAt: DateTime.parse(json['updated_at'] as String),
);
}