Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing Socialised Stories Updates #2537

Open
wants to merge 40 commits into
base: main
Choose a base branch
from

Conversation

kumarpalsinh25
Copy link
Contributor

@kumarpalsinh25 kumarpalsinh25 commented Jan 30, 2025

Fixes, #2502

Note to reviewers :

  • This PR gets slightly bigger but there were no other option to reduce down this work in smaller pieces so let me try to explain as much as I can this PR Description and Code comments.
  • Many of changes are related to Naming changes.

Introducing new type of Acter Update which is called Stories

Acter Updates


  • Technically Boost and Story are mostly same expect below key difference.
    STORIES : "Everyone can see and It will disappears in 14 days",
    BOOST : "Important News. Which also sends a push notification to space members",
Screenshot 2025-02-21 at 11 06 34 AM

Summary of changes

1) Removed space selection from post editor screen:

As Boost/Stories action items are independent from space selection, I have remove space selection option from editor window.

Space.selection.removal.from.editor.mov

2) Introducing all new PostTo screen:

As now you there are two type of Updates which is Stories and Boost, so upon setting update different slides from post editor you will be navigating to new PostTo screen where you need to do,

  • Space selection
  • Post Type selection which is Stories or Boost (This options are enabled based on the selected space permissions)
Post.To.mov

3) Changes in View Updates:

  • Updates filter tab added at the top to filters it based on the type.
  • For Boost Update : you will will space avatar in bottom right and Space Name and Post time in bottom left side
  • For Story Update : you will will user avatar (who posted story) in bottom right and User Name and Space name in bottom left side.
Update.view.mov
Update.Grid.View.mov

4) Overview of key code changes:

  • Created different abstract classes to combine news and story related stuff in one.

Copy link
Contributor

Hey there 👋,
and thanks for the contribution. But it seems like you forgot to

  • 📰 Add a markdown file in .changes/ explaining what changed

Copy link

codecov bot commented Jan 30, 2025

Codecov Report

Attention: Patch coverage is 21.98697% with 479 lines in your changes missing coverage. Please review.

Project coverage is 33.16%. Comparing base (029d699) to head (179dc7a).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
...res/news/pages/add_news/add_news_post_to_page.dart 0.00% 92 Missing ⚠️
app/lib/features/news/model/type/update_entry.dart 1.88% 52 Missing ⚠️
app/lib/features/news/actions/submit_story.dart 0.00% 32 Missing ⚠️
...pp/lib/features/news/actions/make_image_slide.dart 0.00% 31 Missing ⚠️
...res/news/providers/news_post_editor_providers.dart 6.06% 31 Missing ⚠️
...pp/lib/features/news/actions/make_video_slide.dart 0.00% 27 Missing ⚠️
app/lib/features/news/actions/make_text_slide.dart 0.00% 26 Missing ⚠️
app/lib/features/news/model/type/update_slide.dart 0.00% 26 Missing ⚠️
...pp/lib/features/news/providers/news_providers.dart 28.57% 25 Missing ⚠️
...features/news/widgets/news_item/news_side_bar.dart 58.62% 24 Missing ⚠️
... and 18 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2537      +/-   ##
==========================================
- Coverage   33.20%   33.16%   -0.05%     
==========================================
  Files         743      753      +10     
  Lines       48274    48660     +386     
==========================================
+ Hits        16029    16136     +107     
- Misses      32245    32524     +279     
Flag Coverage Δ
integration-test 43.34% <0.00%> (-0.05%) ⬇️
unittest 23.96% <22.02%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

kumarpalsinh25 and others added 27 commits February 3, 2025 12:44
# Conflicts:
#	app/lib/l10n/app_en.arb
# Conflicts:
#	app/lib/features/news/providers/news_post_editor_providers.dart
# Conflicts:
#	app/lib/features/news/providers/news_post_editor_providers.dart
#	app/lib/features/news/widgets/news_grid_view.dart
#	app/lib/features/news/widgets/news_item/news_item.dart
#	app/lib/features/news/widgets/news_item_slide/image_slide.dart
#	app/lib/features/news/widgets/news_item_slide/news_slide_item.dart
#	app/lib/features/news/widgets/news_item_slide/video_slide.dart
#	app/lib/l10n/app_en.arb
#	app/test/features/update/image_slide_widget_test.dart
#	app/test/features/update/video_slide_widget_test.dart
@@ -33,16 +33,15 @@ extension ActerNews on ConvenientTest {
}

Future<void> toggleBackgroundColor() async {
final slideBackgroundColorKey =
find.byKey(NewsUpdateKeys.slideBackgroundColor);
final slideBackgroundColorKey = find.byKey(UpdateKeys.slideBackgroundColor);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only name changes from NewsUpdateKeys to UpdateKeys

@@ -72,39 +71,39 @@ extension ActerNews on ConvenientTest {
final imageFile = await convertAssetImageToXFile(
filepath ?? 'assets/images/update_onboard.png',
);
final slide = NewsSlideItem(
type: NewsSlideType.image,
final slide = UpdateSlideItem(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only name changes from NewsSlideItem to UpdateSlideItem

@@ -28,6 +28,7 @@ enum Routes {
update('/updates/:updateId([^/]+)'),
updateList('/updateList'),
actionAddUpdate('/actions/addUpdate'),
actionAddUpdatePostTo('/actions/addUpdate/PostTo'),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added new PostTo screen as show-case in PR Description

@@ -57,11 +58,11 @@ extension TaskCommentsManagerProviderExtension on Task {
TaskCommentsManagerProvider(this);
}

class NewsEntryCommentsManagerProvider implements CommentsManagerProvider {
final NewsEntry inner;
class UpdateEntryCommentsManagerProvider implements CommentsManagerProvider {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming changes only.

import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:mime/mime.dart';

Future<NewsSlideDraft> makeImageSlideForNews(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No logical changes. Just copied logic from previous implementation and used it based on the post type.

@@ -0,0 +1,65 @@
import 'package:acter_flutter_sdk/acter_flutter_sdk_ffi.dart';

abstract class UpdateSlide {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generalised abstract class creation.


enum PostTypeSelection { story, boost, none }

class AddNewsPostToPage extends ConsumerStatefulWidget {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All new PostTo page for space selection and post type selection.

NewsSlideItem? selectedNewsSlide = state.currentNewsSlide;
selectedNewsSlide?.backgroundColor = getRandomElement(newsPostColors);
state = state.copyWith(currentNewsSlide: selectedNewsSlide);
UpdateSlideItem? selectedUpdateSlide = state.currentUpdateSlide;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming changes only.

import 'package:riverpod/riverpod.dart';

//EVENT FILTERS
enum UpdateFilters {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added filters for updates

import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

class NewsFilterButtons extends ConsumerWidget {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates Filter Buttons UI.

Screenshot 2025-02-21 at 11 51 30 AM

@kumarpalsinh25 kumarpalsinh25 marked this pull request as ready for review February 21, 2025 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

3 participants