move the pin toggle to the pane leading slot
The pin/unpin toggle is a mode control, not navigation — grouping it with back/forward/jump implied they work alike. Pull it out of ReaderActionBar into a standalone ReaderPinButton placed before the title (ClidePaneChrome.leading), leaving the right-hand navigator to back/forward/jump-to-pin/edit. Applies to all three readers. (T-198) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+5
-4
@@ -40,10 +40,11 @@ heading, and (b) bumping `pubspec.yaml` `version:` in the same commit.
|
|||||||
`.clideignore` pair — the single ignore knob clide owns. (T-52)
|
`.clideignore` pair — the single ignore knob clide owns. (T-52)
|
||||||
- `files.walk` command — a recursive, ignore-pruned, capped flat file listing
|
- `files.walk` command — a recursive, ignore-pruned, capped flat file listing
|
||||||
of the workspace, backing quick-open and search. (T-51, T-52)
|
of the workspace, backing quick-open and search. (T-51, T-52)
|
||||||
- Sidebar readers (markdown, decision, and ticket) gain a chrome action bar: a
|
- Sidebar readers (markdown, decision, and ticket) gain chrome: a pin/unpin
|
||||||
pin/unpin toggle on the left, then a navigator (back, forward, jump-to-pin) and
|
toggle in the leading slot before the title (a mode control, kept separate
|
||||||
an edit pencil on the right (no pencil for tickets — they're not files). The
|
from navigation), and a right-hand navigator — back, forward, jump-to-pin —
|
||||||
ticket reader joins the shared retained nav and drops its per-click tab churn.
|
plus an edit pencil (no pencil for tickets — they're not files). The ticket
|
||||||
|
reader joins the shared retained nav and drops its per-click tab churn.
|
||||||
(T-189, T-190, T-191, T-198, T-199)
|
(T-189, T-190, T-191, T-198, T-199)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -110,6 +110,10 @@ class _DecisionDetailViewState extends State<DecisionDetailView> {
|
|||||||
return ClidePaneChrome(
|
return ClidePaneChrome(
|
||||||
title: id,
|
title: id,
|
||||||
subtitle: title,
|
subtitle: title,
|
||||||
|
leading: ReaderPinButton(
|
||||||
|
pinned: _nav?.hasPinned ?? false,
|
||||||
|
onTap: _decision != null ? _onPin : null,
|
||||||
|
),
|
||||||
trailing: [
|
trailing: [
|
||||||
ReaderActionBar(
|
ReaderActionBar(
|
||||||
canGoBack: _nav?.canGoBack ?? false,
|
canGoBack: _nav?.canGoBack ?? false,
|
||||||
@@ -117,7 +121,6 @@ class _DecisionDetailViewState extends State<DecisionDetailView> {
|
|||||||
hasPinned: _nav?.hasPinned ?? false,
|
hasPinned: _nav?.hasPinned ?? false,
|
||||||
onBack: (_nav?.canGoBack ?? false) ? _onBack : null,
|
onBack: (_nav?.canGoBack ?? false) ? _onBack : null,
|
||||||
onForward: (_nav?.canGoForward ?? false) ? _onForward : null,
|
onForward: (_nav?.canGoForward ?? false) ? _onForward : null,
|
||||||
onPin: _decision != null ? _onPin : null,
|
|
||||||
onJumpToPin: (_nav?.hasPinned ?? false) ? _onJumpToPin : null,
|
onJumpToPin: (_nav?.hasPinned ?? false) ? _onJumpToPin : null,
|
||||||
onEdit: filePath != null ? _onEdit : null,
|
onEdit: filePath != null ? _onEdit : null,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -103,6 +103,10 @@ class _MarkdownViewerState extends State<MarkdownViewer> {
|
|||||||
return ClidePaneChrome(
|
return ClidePaneChrome(
|
||||||
title: _path ?? 'viewer',
|
title: _path ?? 'viewer',
|
||||||
subtitle: '${_content!.split('\n').length} lines',
|
subtitle: '${_content!.split('\n').length} lines',
|
||||||
|
leading: ReaderPinButton(
|
||||||
|
pinned: _nav?.hasPinned ?? false,
|
||||||
|
onTap: _path != null ? _onPin : null,
|
||||||
|
),
|
||||||
trailing: [
|
trailing: [
|
||||||
ReaderActionBar(
|
ReaderActionBar(
|
||||||
canGoBack: _nav?.canGoBack ?? false,
|
canGoBack: _nav?.canGoBack ?? false,
|
||||||
@@ -110,7 +114,6 @@ class _MarkdownViewerState extends State<MarkdownViewer> {
|
|||||||
hasPinned: _nav?.hasPinned ?? false,
|
hasPinned: _nav?.hasPinned ?? false,
|
||||||
onBack: (_nav?.canGoBack ?? false) ? _onBack : null,
|
onBack: (_nav?.canGoBack ?? false) ? _onBack : null,
|
||||||
onForward: (_nav?.canGoForward ?? false) ? _onForward : null,
|
onForward: (_nav?.canGoForward ?? false) ? _onForward : null,
|
||||||
onPin: _path != null ? _onPin : null,
|
|
||||||
onJumpToPin: (_nav?.hasPinned ?? false) ? _onJumpToPin : null,
|
onJumpToPin: (_nav?.hasPinned ?? false) ? _onJumpToPin : null,
|
||||||
onEdit: _path != null ? _onEdit : null,
|
onEdit: _path != null ? _onEdit : null,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -14,13 +14,12 @@ import 'package:flutter/widgets.dart';
|
|||||||
// Action bar widget
|
// Action bar widget
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
/// A row of reader-chrome action buttons. Layout (T-196 UX): a pin/unpin
|
/// The reader's **navigator** — back, forward, jump-to-pin (only while
|
||||||
/// **toggle on the left**, then the **navigator** on the right — back,
|
/// pinned), and the edit pencil. Plugs into [ClidePaneChrome.trailing].
|
||||||
/// forward, jump-to-pin (only while pinned) — and the edit pencil last.
|
/// The pin/unpin toggle is deliberately NOT here: it's a mode control,
|
||||||
/// The left toggles pinned state; the right navigates.
|
/// not navigation, so it lives in the pane's leading slot as a
|
||||||
///
|
/// standalone [ReaderPinButton] (T-198). All callbacks are optional —
|
||||||
/// Designed to plug into [ClidePaneChrome.trailing]. All callbacks are
|
/// pass null to hide/disable the corresponding button.
|
||||||
/// optional — pass null to hide/disable the corresponding button.
|
|
||||||
class ReaderActionBar extends StatelessWidget {
|
class ReaderActionBar extends StatelessWidget {
|
||||||
const ReaderActionBar({
|
const ReaderActionBar({
|
||||||
super.key,
|
super.key,
|
||||||
@@ -29,7 +28,6 @@ class ReaderActionBar extends StatelessWidget {
|
|||||||
required this.hasPinned,
|
required this.hasPinned,
|
||||||
required this.onBack,
|
required this.onBack,
|
||||||
required this.onForward,
|
required this.onForward,
|
||||||
required this.onPin,
|
|
||||||
required this.onJumpToPin,
|
required this.onJumpToPin,
|
||||||
required this.onEdit,
|
required this.onEdit,
|
||||||
});
|
});
|
||||||
@@ -40,10 +38,6 @@ class ReaderActionBar extends StatelessWidget {
|
|||||||
final VoidCallback? onBack;
|
final VoidCallback? onBack;
|
||||||
final VoidCallback? onForward;
|
final VoidCallback? onForward;
|
||||||
|
|
||||||
/// Called when the pin toggle is tapped — pins the current entry when
|
|
||||||
/// nothing is pinned, else clears the pin.
|
|
||||||
final VoidCallback? onPin;
|
|
||||||
|
|
||||||
/// Called when the jump-to-pin button (in the navigator) is tapped.
|
/// Called when the jump-to-pin button (in the navigator) is tapped.
|
||||||
final VoidCallback? onJumpToPin;
|
final VoidCallback? onJumpToPin;
|
||||||
|
|
||||||
@@ -56,17 +50,6 @@ class ReaderActionBar extends StatelessWidget {
|
|||||||
return Row(
|
return Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
// Left — toggle the pinned state.
|
|
||||||
_ActionButton(
|
|
||||||
painter: PhosphorIcons.pushPin,
|
|
||||||
tooltip: hasPinned ? 'Unpin' : 'Pin',
|
|
||||||
enabled: onPin != null,
|
|
||||||
active: hasPinned,
|
|
||||||
onTap: onPin,
|
|
||||||
tokens: tokens,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 8),
|
|
||||||
// Right — the navigator.
|
|
||||||
_ActionButton(
|
_ActionButton(
|
||||||
painter: PhosphorIcons.caretLeft,
|
painter: PhosphorIcons.caretLeft,
|
||||||
tooltip: 'Back',
|
tooltip: 'Back',
|
||||||
@@ -107,6 +90,29 @@ class ReaderActionBar extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The pin/unpin toggle — a single button that sits in the pane's
|
||||||
|
/// leading slot (before the title), separate from the navigator so the
|
||||||
|
/// two kinds of control don't read as one group (T-198). [pinned]
|
||||||
|
/// drives the accent + the Pin/Unpin label; [onTap] toggles.
|
||||||
|
class ReaderPinButton extends StatelessWidget {
|
||||||
|
const ReaderPinButton({super.key, required this.pinned, required this.onTap});
|
||||||
|
|
||||||
|
final bool pinned;
|
||||||
|
final VoidCallback? onTap;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return _ActionButton(
|
||||||
|
painter: PhosphorIcons.pushPin,
|
||||||
|
tooltip: pinned ? 'Unpin' : 'Pin',
|
||||||
|
enabled: onTap != null,
|
||||||
|
active: pinned,
|
||||||
|
onTap: onTap,
|
||||||
|
tokens: ClideTheme.of(context).surface,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Private button widget
|
// Private button widget
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -73,6 +73,10 @@ class _TicketDetailViewState extends State<TicketDetailView> {
|
|||||||
return ClidePaneChrome(
|
return ClidePaneChrome(
|
||||||
title: d.id,
|
title: d.id,
|
||||||
subtitle: d.title,
|
subtitle: d.title,
|
||||||
|
leading: ReaderPinButton(
|
||||||
|
pinned: _nav?.hasPinned ?? false,
|
||||||
|
onTap: _onPin,
|
||||||
|
),
|
||||||
trailing: [
|
trailing: [
|
||||||
ReaderActionBar(
|
ReaderActionBar(
|
||||||
canGoBack: _nav?.canGoBack ?? false,
|
canGoBack: _nav?.canGoBack ?? false,
|
||||||
@@ -80,7 +84,6 @@ class _TicketDetailViewState extends State<TicketDetailView> {
|
|||||||
hasPinned: _nav?.hasPinned ?? false,
|
hasPinned: _nav?.hasPinned ?? false,
|
||||||
onBack: (_nav?.canGoBack ?? false) ? _onBack : null,
|
onBack: (_nav?.canGoBack ?? false) ? _onBack : null,
|
||||||
onForward: (_nav?.canGoForward ?? false) ? _onForward : null,
|
onForward: (_nav?.canGoForward ?? false) ? _onForward : null,
|
||||||
onPin: _onPin,
|
|
||||||
onJumpToPin: (_nav?.hasPinned ?? false) ? _onJumpToPin : null,
|
onJumpToPin: (_nav?.hasPinned ?? false) ? _onJumpToPin : null,
|
||||||
onEdit: null, // tickets are pql records, not files
|
onEdit: null, // tickets are pql records, not files
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user