mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Add API Docs link to the wide navigation rail
Add an "API Docs" navigation entry that opens /api/docs in a new tab. It is shown only in the wide-mode navigation rail (not the compact bottom bar) and sits just before About. Generalises the navigation destination model so an entry can be an in-app route or an external link, and can be restricted to wide layouts. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
cf7dd96415
commit
f0d939f685
@@ -86,5 +86,38 @@ void main() {
|
||||
expect(find.byTooltip('Collapse menu'), findsNothing);
|
||||
expect(find.byTooltip('Expand menu'), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('shows API Docs in the rail, just before About', (
|
||||
tester,
|
||||
) async {
|
||||
await pumpShell(tester, size: const Size(1200, 900));
|
||||
|
||||
final labels = rail(
|
||||
tester,
|
||||
).destinations.map((d) => (d.label as Text).data).toList();
|
||||
|
||||
expect(labels, contains('API Docs'));
|
||||
expect(labels.indexOf('API Docs'), labels.indexOf('About') - 1);
|
||||
});
|
||||
});
|
||||
|
||||
group('compact navigation bar', () {
|
||||
setUp(() async {
|
||||
await setUpBackendForTest();
|
||||
});
|
||||
|
||||
testWidgets('omits the wide-only API Docs entry', (tester) async {
|
||||
// Narrow width (< 600): the compact bottom NavigationBar is used.
|
||||
await pumpShell(tester, size: const Size(400, 800));
|
||||
|
||||
final bar = tester.widget<NavigationBar>(find.byType(NavigationBar));
|
||||
final labels = bar.destinations
|
||||
.cast<NavigationDestination>()
|
||||
.map((d) => d.label)
|
||||
.toList();
|
||||
|
||||
expect(labels, contains('About'));
|
||||
expect(labels, isNot(contains('API Docs')));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user