feat(route): open PDFs in pen-first editor
The night's pen-first rebuild (PenEditorScreen + PenCanvas + zoom fix + eraser + M3 tool palette + render cache) was unreachable from the running app: home_screen opened the OLD PdfAnnotatorScreen, so the user saw zero change. Wire both PDF-open sites (import + open-existing) to PenEditorScreen, making the entire editor/* stack LIVE on the real PDF path. flutter analyze: 0 issues. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,11 +5,11 @@ import '../models/note.dart';
|
|||||||
import '../providers/document_provider.dart';
|
import '../providers/document_provider.dart';
|
||||||
import '../providers/note_provider.dart';
|
import '../providers/note_provider.dart';
|
||||||
import '../providers/ocr_provider.dart';
|
import '../providers/ocr_provider.dart';
|
||||||
|
import '../editor/canvas/pen_editor_screen.dart';
|
||||||
import '../editor/pdf/spike_launcher.dart';
|
import '../editor/pdf/spike_launcher.dart';
|
||||||
import '../services/pdf_service.dart';
|
import '../services/pdf_service.dart';
|
||||||
import '../services/pptx_service.dart';
|
import '../services/pptx_service.dart';
|
||||||
import 'note_editor_screen.dart';
|
import 'note_editor_screen.dart';
|
||||||
import 'pdf_annotator_screen.dart';
|
|
||||||
import 'ppt_annotator_screen.dart';
|
import 'ppt_annotator_screen.dart';
|
||||||
import 'search_screen.dart';
|
import 'search_screen.dart';
|
||||||
import 'settings_screen.dart';
|
import 'settings_screen.dart';
|
||||||
@@ -204,7 +204,7 @@ class HomeScreen extends ConsumerWidget {
|
|||||||
if (filePath != null && context.mounted) {
|
if (filePath != null && context.mounted) {
|
||||||
Navigator.of(context).push(
|
Navigator.of(context).push(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (_) => PdfAnnotatorScreen(filePath: filePath),
|
builder: (_) => PenEditorScreen(pdfPath: filePath),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -532,7 +532,7 @@ class _DocumentTileState extends ConsumerState<_DocumentTile> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// [L2] Route by docType: pdf → PdfAnnotatorScreen, ppt/pptx → PptAnnotatorScreen
|
// [L2] Route by docType: pdf → PenEditorScreen (pen-first), ppt/pptx → PptAnnotatorScreen
|
||||||
Future<void> _openDocument(BuildContext context) async {
|
Future<void> _openDocument(BuildContext context) async {
|
||||||
final document = widget.document;
|
final document = widget.document;
|
||||||
final isPdf = document.docType == 'pdf';
|
final isPdf = document.docType == 'pdf';
|
||||||
@@ -540,7 +540,7 @@ class _DocumentTileState extends ConsumerState<_DocumentTile> {
|
|||||||
if (isPdf) {
|
if (isPdf) {
|
||||||
Navigator.of(context).push(
|
Navigator.of(context).push(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (_) => PdfAnnotatorScreen(filePath: document.filePath),
|
builder: (_) => PenEditorScreen(pdfPath: document.filePath),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user