Merge pull request #2690 from krille-chan/krille/build-website-in-release-job
chore: Adjust styles and animations
This commit is contained in:
commit
76fdabecaa
6 changed files with 673 additions and 766 deletions
22
.github/workflows/release.yaml
vendored
22
.github/workflows/release.yaml
vendored
|
|
@ -46,13 +46,25 @@ jobs:
|
|||
asset_path: fluffychat-web.tar.gz
|
||||
asset_name: fluffychat-web.tar.gz
|
||||
asset_content_type: application/gzip
|
||||
- name: Build Website
|
||||
- name: Clone fluffychat website
|
||||
run: |
|
||||
mkdir public
|
||||
git@github.com:krille-chan/fluffychat-website.git
|
||||
cp CHANGELOG.md fluffychat-website/
|
||||
cp PRIVACY.md fluffychat-website/
|
||||
- name: Build website
|
||||
working-directory: fluffychat-website
|
||||
run: |
|
||||
npm install tailwindcss @tailwindcss/cli
|
||||
npx tailwindcss -i ./src/styles.css -o ./src/assets/tailwind.css --minify
|
||||
npx @11ty/eleventy
|
||||
mv public ../
|
||||
- name: Copy FluffyChat web into it
|
||||
run: |
|
||||
mkdir public/web
|
||||
mkdir public/nightly
|
||||
cp -r build/web/* public/
|
||||
cp -r build/web/* public/web/
|
||||
cp -r build/web/* public/nightly/
|
||||
echo "app.fluffy.chat" >> public/CNAME
|
||||
echo "fluffychat.im" >> public/CNAME
|
||||
- name: Deploy to GitHub Pages
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
|
|
@ -60,7 +72,7 @@ jobs:
|
|||
personal_token: ${{ secrets.PAGES_DEPLOY_TOKEN }}
|
||||
publish_dir: ./public
|
||||
publish_branch: gh-pages
|
||||
cname: app.fluffy.chat
|
||||
cname: fluffychat.im
|
||||
|
||||
build_apk:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
|
|
@ -462,21 +462,18 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
scrollUpBannerEventId = eventId;
|
||||
});
|
||||
|
||||
bool firstUpdateReceived = false;
|
||||
|
||||
void updateView() {
|
||||
if (!mounted) return;
|
||||
setReadMarker();
|
||||
setState(() {});
|
||||
setState(() {
|
||||
firstUpdateReceived = true;
|
||||
});
|
||||
}
|
||||
|
||||
Future<void>? loadTimelineFuture;
|
||||
|
||||
int? animateInEventIndex;
|
||||
|
||||
void onInsert(int i) {
|
||||
// setState will be called by updateView() anyway
|
||||
if (timeline?.allowNewEvent == true) animateInEventIndex = i;
|
||||
}
|
||||
|
||||
Future<void> _getTimeline({String? eventContextId}) async {
|
||||
await Matrix.of(context).client.roomsLoading;
|
||||
await Matrix.of(context).client.accountDataLoading;
|
||||
|
|
@ -489,15 +486,11 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
timeline = await room.getTimeline(
|
||||
onUpdate: updateView,
|
||||
eventContextId: eventContextId,
|
||||
onInsert: onInsert,
|
||||
);
|
||||
} catch (e, s) {
|
||||
Logs().w('Unable to load timeline on event ID $eventContextId', e, s);
|
||||
if (!mounted) return;
|
||||
timeline = await room.getTimeline(
|
||||
onUpdate: updateView,
|
||||
onInsert: onInsert,
|
||||
);
|
||||
timeline = await room.getTimeline(onUpdate: updateView);
|
||||
if (!mounted) return;
|
||||
if (e is TimeoutException || e is IOException) {
|
||||
_showScrollUpMaterialBanner(eventContextId!);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ class ChatEventList extends StatelessWidget {
|
|||
final events = timeline.events.filterByVisibleInGui(
|
||||
threadId: controller.activeThreadId,
|
||||
);
|
||||
final animateInEventIndex = controller.animateInEventIndex;
|
||||
|
||||
// create a map of eventId --> index to greatly improve performance of
|
||||
// ListView's findChildIndexCallback
|
||||
|
|
@ -120,10 +119,7 @@ class ChatEventList extends StatelessWidget {
|
|||
|
||||
// The message at this index:
|
||||
final event = events[i];
|
||||
final animateIn =
|
||||
animateInEventIndex != null &&
|
||||
timeline.events.length > animateInEventIndex &&
|
||||
event == timeline.events[animateInEventIndex];
|
||||
final animateIn = i == 0 && controller.firstUpdateReceived;
|
||||
|
||||
final nextEvent = i + 1 < events.length ? events[i + 1] : null;
|
||||
final previousEvent = i > 0 ? events[i - 1] : null;
|
||||
|
|
@ -139,16 +135,13 @@ class ChatEventList extends StatelessWidget {
|
|||
!controller.expandedEventIds.contains(event.eventId);
|
||||
|
||||
return AutoScrollTag(
|
||||
key: ValueKey(event.eventId),
|
||||
key: ValueKey(event.transactionId ?? event.eventId),
|
||||
index: i,
|
||||
controller: controller.scrollController,
|
||||
child: Message(
|
||||
event,
|
||||
bigEmojis: controller.bigEmojis,
|
||||
animateIn: animateIn,
|
||||
resetAnimateIn: () {
|
||||
controller.animateInEventIndex = null;
|
||||
},
|
||||
onSwipe: () => controller.replyAction(replyTo: event),
|
||||
onInfoTab: controller.showEventInfo,
|
||||
onMention: () => controller.sendController.text +=
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
|||
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/config/setting_keys.dart';
|
||||
import 'package:fluffychat/utils/account_config.dart';
|
||||
import 'package:fluffychat/utils/file_selector.dart';
|
||||
|
|
@ -111,32 +110,6 @@ class SettingsStyleController extends State<SettingsStyle> {
|
|||
ThemeMode get currentTheme => ThemeController.of(context).themeMode;
|
||||
Color? get currentColor => ThemeController.of(context).primaryColor;
|
||||
|
||||
static final List<Color?> customColors = [
|
||||
null,
|
||||
AppConfig.chatColor,
|
||||
Colors.indigo,
|
||||
Colors.blue,
|
||||
Colors.blueAccent,
|
||||
Colors.teal,
|
||||
Colors.tealAccent,
|
||||
Colors.green,
|
||||
Colors.greenAccent,
|
||||
Colors.yellow,
|
||||
Colors.yellowAccent,
|
||||
Colors.orange,
|
||||
Colors.orangeAccent,
|
||||
Colors.red,
|
||||
Colors.redAccent,
|
||||
Colors.pink,
|
||||
Colors.pinkAccent,
|
||||
Colors.purple,
|
||||
Colors.purpleAccent,
|
||||
Colors.blueGrey,
|
||||
Colors.grey,
|
||||
Colors.white,
|
||||
Colors.black,
|
||||
];
|
||||
|
||||
void switchTheme(ThemeMode? newTheme) {
|
||||
if (newTheme == null) return;
|
||||
switch (newTheme) {
|
||||
|
|
|
|||
|
|
@ -82,14 +82,13 @@ class SettingsStyleView extends StatelessWidget {
|
|||
Theme.of(context).brightness == Brightness.light
|
||||
? light?.primary
|
||||
: dark?.primary;
|
||||
final colors = List<Color?>.from(
|
||||
SettingsStyleController.customColors,
|
||||
);
|
||||
final colors = [null, AppConfig.chatColor, ...Colors.primaries];
|
||||
if (systemColor == null) {
|
||||
colors.remove(null);
|
||||
}
|
||||
return GridView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
|
||||
maxCrossAxisExtent: 64,
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue