Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,6 @@ pili_release.json

dist

test.dart
test.dart
# Local recovery bundles
.backup/
101 changes: 101 additions & 0 deletions docs/custom-branch-workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Custom branch workflow

This repository now keeps the original `work` branch protected and records the custom work in topic-oriented refs so the changes can be replayed after an upstream PiliPlus update.

## Upstream baseline status

The intended upstream remote is:

```bash
git remote add upstream https://github.com/bggRGjQaUbCoE/PiliPlus.git
git fetch --tags upstream
```

In this execution environment, direct Git and curl access to GitHub are blocked by the configured proxy with `CONNECT tunnel failed, response 403`. Because the newest upstream objects cannot be fetched here, the branch split is anchored to the newest official-looking ancestor already present in this shallow checkout:

- `base/local-official-snapshot` -> `3741fe5 upgrade dep`

After running the same workflow in an environment that can fetch GitHub, replace that local snapshot with the real latest upstream baseline:

```bash
git fetch --tags upstream
git branch -f base/upstream-main upstream/main
```

## Branch map

| Branch | Purpose | Current anchor |
| --- | --- | --- |
| `base/local-official-snapshot` | Last available official ancestor in this checkout | `3741fe5` |
| `custom/login-defaults` | Login defaults and automatic/default account selection | `3205f38` |
| `custom/dynamic-tabs` | Dynamic tab ordering and navigation polish | `abcfbe3` |
| `custom/video-tv-controls` | Android TV/video focus, back/menu, and playback controls | `2be4aa0` |
| `custom/dynamic-ui-fixes` | Dynamic page UI and adapter fixes | `db5b2bf` |
| `custom/settings-compat` | Settings model/default compatibility | `57da9a7` |
| `custom/tv-debug-menu` | TV debug menu, generated routes, and D-pad debug page | `01fc8d9` |
| `custom/ci-build-reporting` | CI analyzer/build-error reporting workflow changes | `72d31de` |
| `custom/player-settings-buttons` | Player setting menu buttons, episode selection, danmaku/subtitle buttons | `c710801` |
| `custom/account-switching` | Account switching page | `2120d6b` |
| `custom/history-playback-progress` | History playback progress/start-position fixes | `d6a9719` |
| `custom/player-subtitle-options` | Subtitle option bug fix and UI updates | `97612bb` |
| `adapted/latest-official` | Current integrated adaptation branch; replace/rebase after real upstream fetch | `97612bb` |

These topic refs intentionally preserve the current recoverable commit graph. Some branches are a short stack rather than fully independent patches because later work depends on earlier TV/player/account infrastructure.

## Recommended update workflow after a new upstream release

1. Update the official baseline:

```bash
git fetch --tags upstream
git branch -f base/upstream-main upstream/main
```

2. Create a new integration branch from upstream:

```bash
git switch -c adapted/<upstream-version> base/upstream-main
```

3. Replay topics in dependency order. Prefer cherry-picking only the commits unique to each topic; use `git log base/local-official-snapshot..custom/<topic>` to inspect each range first.

Suggested order (based on actual dependency chain):

```text
custom/dynamic-tabs
custom/login-defaults
custom/video-tv-controls
custom/dynamic-ui-fixes
custom/settings-compat
custom/ci-build-reporting
custom/tv-debug-menu
custom/player-settings-buttons
custom/account-switching
custom/history-playback-progress
custom/player-subtitle-options
```

*Note: In the current `adapted/latest-official` branch, these topics form a linear stack. When replaying, you can cherry-pick the merge commits from the integrated branch or the unique commits from each topic ref.*

4. Resolve conflicts one topic at a time. After replaying, verify the build:

5. Run validation (Note: may require fixing upstream dependencies in `pubspec.yaml` first):

```bash
# Fix Flutter version mismatch if needed
sed -i 's/flutter: 3.38.4/flutter: ">=3.38.4"/' pubspec.yaml

flutter pub get
flutter analyze
```

## When full GitHub access is available

For a cleaner long-term structure, convert any stacked topic that still contains unrelated earlier commits into a patch-only branch:

```bash
git switch -c split/<topic> base/upstream-main
git cherry-pick <commit-or-range-for-that-topic>
```

Keep `work` as a protected historical branch, and do new development on `adapted/<version>` plus `custom/*` topic branches.
3 changes: 3 additions & 0 deletions lib/common/widgets/radio_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ class RadioWidgetState<T> extends State<RadioWidget<T>> with RadioClient<T> {
@override
bool get tristate => widget.tristate;

@override
bool get enabled => true;

@override
void dispose() {
registry = null;
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/common/publish/common_publish_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ abstract class CommonPublishPageState<T extends CommonPublishPage>
widget.autofocus &&
(panelType.value == PanelType.keyboard ||
panelType.value == PanelType.none)) {
controller.restoreChatPanel();

WidgetsBinding.instance.addPostFrameCallback((_) {
if (focusNode.hasFocus) {
focusNode.unfocus();
Expand All @@ -90,7 +90,7 @@ abstract class CommonPublishPageState<T extends CommonPublishPage>
});
}
} else if (state == AppLifecycleState.paused) {
controller.keepChatPanel();

if (focusNode.hasFocus) {
focusNode.unfocus();
}
Expand Down
9 changes: 5 additions & 4 deletions lib/pages/common/publish/common_rich_text_pub_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import 'package:image_cropper/image_cropper.dart';
import 'package:image_picker/image_picker.dart';
import 'package:PiliPlus/utils/context_ext.dart';

abstract class CommonRichTextPubPage
extends CommonPublishPage<List<RichTextItem>> {
Expand Down Expand Up @@ -96,7 +97,7 @@ abstract class CommonRichTextPubPageState<T extends CommonRichTextPubPage>
children: [
GestureDetector(
onTap: () async {
controller.keepChatPanel();

await PageUtils.imageView(
imgList: pathList
.map(
Expand All @@ -108,7 +109,7 @@ abstract class CommonRichTextPubPageState<T extends CommonRichTextPubPage>
.toList(),
initialPage: index,
);
controller.restoreChatPanel();

},
onLongPress: onClear,
onSecondaryTap: Utils.isMobile ? null : onClear,
Expand Down Expand Up @@ -269,7 +270,7 @@ abstract class CommonRichTextPubPageState<T extends CommonRichTextPubPage>

late double _mentionOffset = 0;
Future<void> onMention([bool fromClick = false]) async {
controller.keepChatPanel();

final res = await DynMentionPanel.onDynMention(
context,
offset: _mentionOffset,
Expand All @@ -286,7 +287,7 @@ abstract class CommonRichTextPubPageState<T extends CommonRichTextPubPage>
res.clear();
}
}
controller.restoreChatPanel();

}

void _onInsertUser(MentionItem e, bool fromClick) {
Expand Down
16 changes: 8 additions & 8 deletions lib/pages/dynamics_create/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ class _CreateDynPanelState extends CommonRichTextPubPageState<CreateDynPanel> {
onPressed: _isPrivate.value
? null
: () async {
controller.keepChatPanel();

DateTime nowDate = DateTime.now();
final selectedDate = await showDatePicker(
context: context,
Expand Down Expand Up @@ -510,7 +510,7 @@ class _CreateDynPanelState extends CommonRichTextPubPageState<CreateDynPanel> {
);
}
}
controller.restoreChatPanel();

},
child: const Text('定时发布'),
)
Expand Down Expand Up @@ -613,7 +613,7 @@ class _CreateDynPanelState extends CommonRichTextPubPageState<CreateDynPanel> {

Widget get voteBtn => ToolbarIconButton(
onPressed: () async {
controller.keepChatPanel();

RichTextItem? voteItem = editController.items.firstWhereOrNull(
(e) => e.type == RichTextType.vote,
);
Expand Down Expand Up @@ -658,7 +658,7 @@ class _CreateDynPanelState extends CommonRichTextPubPageState<CreateDynPanel> {
);
}
}
controller.restoreChatPanel();

},
icon: const Icon(Icons.bar_chart_rounded, size: 24),
tooltip: '投票',
Expand Down Expand Up @@ -750,7 +750,7 @@ class _CreateDynPanelState extends CommonRichTextPubPageState<CreateDynPanel> {

double _topicOffset = 0;
Future<void> _onSelectTopic() async {
controller.keepChatPanel();

TopicItem? res = await SelectTopicPanel.onSelectTopic(
context,
offset: _topicOffset,
Expand All @@ -759,7 +759,7 @@ class _CreateDynPanelState extends CommonRichTextPubPageState<CreateDynPanel> {
if (res != null) {
topic.value = Pair(first: res.id, second: res.name);
}
controller.restoreChatPanel();

}

@override
Expand Down Expand Up @@ -817,7 +817,7 @@ class _CreateDynPanelState extends CommonRichTextPubPageState<CreateDynPanel> {
}

Future<void> _onReserve() async {
controller.keepChatPanel();

ReserveInfoData? reserveInfo = await Navigator.of(context).push(
GetPageRoute(
page: () => CreateReservePage(sid: _reserveCard.value?.id),
Expand All @@ -826,6 +826,6 @@ class _CreateDynPanelState extends CommonRichTextPubPageState<CreateDynPanel> {
if (reserveInfo != null) {
_reserveCard.value = reserveInfo;
}
controller.restoreChatPanel();

}
}
3 changes: 2 additions & 1 deletion lib/pages/live_room/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart' hide ContextExtensionss;
import 'package:screen_brightness_platform_interface/screen_brightness_platform_interface.dart';
import 'package:PiliPlus/utils/context_ext.dart';

class LiveRoomPage extends StatefulWidget {
const LiveRoomPage({super.key});
Expand Down Expand Up @@ -184,7 +185,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
@override
Widget build(BuildContext context) {
Widget child;
if (Platform.isAndroid && Floating().isPipMode) {
if (Platform.isAndroid && Floating().pipStatus == PiPStatus.enabled) {
child = videoPlayerPanel(
isFullScreen,
width: maxWidth,
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/video/reply_new/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class _ReplyPageState extends CommonRichTextPubPageState<ReplyPage> {
children: [
item(
onTap: () async {
controller.keepChatPanel();

({String title, String url})? res = await Get.to(
ReplySearchPage(type: widget.replyType, oid: widget.oid),
);
Expand All @@ -330,7 +330,7 @@ class _ReplyPageState extends CommonRichTextPubPageState<ReplyPage> {
rawText: '${res.url} ',
);
}
controller.restoreChatPanel();

},
icon: Icon(Icons.post_add, size: 28, color: color),
title: '插入内容',
Expand Down
5 changes: 3 additions & 2 deletions lib/pages/video/send_danmaku/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart' show LengthLimitingTextInputFormatter;
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import 'package:PiliPlus/utils/context_ext.dart';

class SendDanmakuPanel extends CommonTextPubPage {
// video
Expand Down Expand Up @@ -438,7 +439,7 @@ class _SendDanmakuPanelState extends CommonTextPubPageState<SendDanmakuPanel> {
}

Future<void> _showColorPicker() async {
controller.keepChatPanel();

await showDialog(
context: context,
builder: (context) => AlertDialog(
Expand All @@ -455,7 +456,7 @@ class _SendDanmakuPanelState extends CommonTextPubPageState<SendDanmakuPanel> {
),
),
);
controller.restoreChatPanel();

}

@override
Expand Down
3 changes: 2 additions & 1 deletion lib/plugin/pl_player/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import 'package:media_kit_video/media_kit_video.dart';
import 'package:path/path.dart' as path;
import 'package:wakelock_plus/wakelock_plus.dart';
import 'package:window_manager/window_manager.dart';
import 'package:PiliPlus/utils/context_ext.dart';

class PlPlayerController {
Player? _videoPlayerController;
Expand Down Expand Up @@ -222,7 +223,7 @@ class PlPlayerController {

late final bool autoPiP = Pref.autoPiP;
bool get isPipMode =>
(Platform.isAndroid && Floating().isPipMode) ||
(Platform.isAndroid && Floating().pipStatus == PiPStatus.enabled) ||
(Utils.isDesktop && isDesktopPip);
late bool isDesktopPip = false;
late Rect _lastWindowBounds;
Expand Down
Loading
Loading