-
-
Notifications
You must be signed in to change notification settings - Fork 34
feat: implement webtoon-style viewer for tall images #584
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
base: master
Are you sure you want to change the base?
Conversation
- Add fitWidthForTallImages parameter to BooruImage widget - Always use BoxFit.fitWidth when fitWidthForTallImages flag is enabled - Remove aspect ratio constraints for tall images to allow proper fit-width - Detect very tall images (aspect ratio > 2.0) in post details - Use SingleChildScrollView for tall images instead of InteractiveViewer - Add proper status bar padding for full-screen tall image viewing - Preserve tap-to-toggle overlay functionality for tall images - Allow natural vertical scrolling instead of pan-to-info gesture - Update OriginalImagePage and PostDetailsImage to use new fit mode This change allows tall images to fit the screen width and be scrollable vertically, providing a webtoon-style viewing experience for long images.
|
Did you vibe code all this? Looks like you ignored all the linter warnings |
|
A lot of it is vibe coded. Never worked in Flutter before so I didn't have vs code setup to even show linter errors and the only warnings I saw were when building and they were just the outdated deps 🤷 If your issue is with warnings I can fix those later today. I really made this feature for myself because large images are impossible to view currently (without downloading and opening in an external image viewer). If your issue is with the underlying implementation I probably won't be able to fix that. I don't know enough about Flutter to do that |
I have been thinking about adding a dedicated mode in the settings for this kind of usage. The next release will introduce a settings to change between a gallery browsing mode and a tiktok browsing mode. Maybe adding a comic mode would be better |
I think this can be fixed if I were to check for the state of the screen (Idk how to word this) where if the icons are stuff are showing then if the user swipes up open the info panel and if not then scroll
I agree. I was trying to think of a good way but there are so many ways to do it I couldn't decide. I think a good way could be if the image is taller than wide then use the scroll view however a complete overhaul of the image viewer could resolve this. As it is now, even a normal image gets squished when the info panel opens up but I don't think it should. IMO the image viewer should be like a background thing with the image fit width by default. The info panel should be an overlay on the image. I am not familiar enough with the codebase to suggest any better changes Also, this is not meant to replace any method of scrolling left/right is it simply to fix and issue where long images are near impossible to be viewed right now. Yes, you can zoom in however then you must scroll up/down very precisely as the black space on the sides is kind of like a large image. |
- Remove _buildPostContent method and inline content as requested in PR review - Fix PostDetailsImage generic type parameter to properly handle T extends Post - Fix state class to maintain generic type information
- Add swipe-up gesture detection for tall images when overlay UI is showing - Disable scrolling when UI is visible to allow swipe gesture to work - Enable normal scrolling when UI is hidden for viewing tall images
This is by design since the viewer is used for mixed media (videos and image), the current design allow user to continue watching the video while browsing the information.
I agree, that’s why I’m planning to add a dedicated comic/webtoon mode, separate from gallery or TikTok views. It’ll fit images to screen width, be scrollable, and disable the info panel gesture. This can be set globally or per profile, so if a site focuses on comics or you just want to read that way, you can switch to a dedicated profile. |
|
Related #524 |
- Resolved import conflict in post_details_item.dart - Regenerated translation files to include new keys from upstream - Merged changes for backup/restore, post grid, and settings features
Implements intelligent tall media detection and specialized scrolling behavior for very tall images/comics. Adds settings-driven classification system to determine when content should use scrollable viewer versus standard interactive viewer. (Trying Codex instead of Claude this time :P)
|
@khoadng Some more AI changes 😆 Tested on virtual device on a couple of images and it does work for both horizontal and vertical scroll modes |
|
Add some quick feedback, will check the rest later |
|
Sorry the video is small GH has 10mb upload restrictions demo.mp4 |
…ction - Reduce TallMediaSettings from 10 complex parameters to single enabled toggle - Convert TallMediaClassifier class to classifyTallMedia function - Move threshold values to static constants for consistent behavior - Add feature disable capability via enabled setting - Update all usage sites and tests for new function-based API
|
Looking good! Can you make it so that swiping still works at the edge, allowing users to switch pages in tiktok mode and pulling up the info in gallery mode? |
| bool get hasScrollableExtent => scrollExtent > 0; | ||
| } | ||
|
|
||
| TallMediaDisposition classifyTallMedia({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- this should be a factory method in TallMediaDisposition, rename it to fromViewport. Move all calculation to this method
- settings.enabled check, it should be handle from the UI
| @override | ||
| List<Object> get props => [enabled]; | ||
|
|
||
| static const double aspectRatioThreshold = 2.15; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move these to TallMediaConfigs, pass the config as a option parameter to the above mentioned fromViewport method.
| config: authConfig, | ||
| imageUrlBuilder: imageUrlBuilder, | ||
| imageCacheManager: imageCacheManager, | ||
| // This is used to make sure we have a thumbnail to show instead of a black placeholder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep the comment
| // Project imports: | ||
| import '../../../../settings/settings.dart'; | ||
|
|
||
| class TallMediaDisposition { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the class name, it sounds strange. Maybe MediaViewportConfiguration
| placeholderUrl: placeholderImageUrl, | ||
| aspectRatio: post.aspectRatio, | ||
| forceCover: post.aspectRatio != null, | ||
| forceCover: false, // Never force cover when we want fit width |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be conditional based on fitWidthForTallImages
| imageHeight: post.height, | ||
| imageWidth: post.width, | ||
| forceFill: true, | ||
| forceFill: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above?
| import 'post_details_page_view.dart'; | ||
|
|
||
| enum SwipeLockReason { | ||
| legacy, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is legacy?
| imageHeight: widget.contentSize?.height, | ||
| imageWidth: widget.contentSize?.width, | ||
| forceFill: true, | ||
| forceFill: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be conditional based on fitWidthForTallImages


This change allows tall images to fit the screen width and be scrollable vertically, providing a webtoon-style viewing experience for long images.
Fix #524