-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
[Feature] Add support for collapsible statuses when they exceed 500 characters #825
Conversation
Android Studio 3.1.4 Stable doesn't render layout previews in this project for whatever reason. Switching to the latest 3.3 Canary release fixes the issue without affecting Gradle scripts but requires the new Android Gradle plugin to match the new Android Studio release. This commit will be reverted once development on the feature is done.
… store version This will allow developers, testers, etc to work on Tusky will not having to worry about overwriting, uninstalling, fiddling with a preinstalled application which would mean having to login again every time the development cycle starts/finishes and manually reinstalling the app.
The button uses subtle styling to not be distracting like the CW button on the timeline The button is toggleable, full width to match the status textbox hitbox width and also is shorter to not be too intrusive between the status text and images, or the post below
Provide stubs in all implementing classes and mark as TODO the stubs that require a proper implementation for the feature to work.
Code has not been added elsewhere to simplify testing. Once the code will be considered stable it will be also included in other status action listener implementers.
This is currently limited to a simple toggle, it would be nice to implement a more advanced UI to offer the user more control over the feature.
Just like the other commit, this will be reverted once the feature is working. I simply don't want to deal with what changes in my installation of Android Studio 3.1.4 Stable which breaks the layout preview rendering.
I forgot that data isn't available from the API and can't really be built from scratch using existing data due to preferences. A new, extra boolean should fix the issue.
Commit a0a41ca and 0ee004d will be reverted to the original settings once this is approved, for as long as I'll have to work on it, I won't change those due to issue I had with Android Studio 3.1.4 not rendering previews for certain layouts. Commit 8f6c327 may be reverted although it has proven to be very useful to me over the years and is suggested by the Android Developers website so I would discourage from doing so, while I would much rather encourage implementing it properly as a custom |
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.
Hi! Thanks for this nice change.
If you could apply some cleanup, it will be even better.
I would also ask you to revert unrelated changes, just don't commit them or put them in your local stash. Even if they're useful, they should be in a separate PR.
app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/keylesspalace/tusky/util/ViewDataUtils.java
Outdated
Show resolved
Hide resolved
There's one minor thing I noticed: when post is barely more than 500 symbols, the button just reveals some more symbols on the same line, making it useless. |
I left some changes unresolved, awaiting further suggestions to avoid having to change the code again later. |
I'd personally like this configurable-- for example, cybre.space has 512 chars max and I'd rather not have posts with 512 characters get collapsed. Maybe 600 might be a good default to cover that case specifically. |
I was really hoping to not see that requested until after the merge, and I would like to get this to work at least in a very basic way to ship it and start getting bug reports before implementing extra code that will only turn out to make debugging person-specific and end up in some sort of bug micromanagement hell. My ideal design for how this should work at its best possible state is:
And for the settings:
And then it would be "peak implementation" if we could:
Now there are issues: |
Ah, makes sense! I appreciate the thought you put into the design already. :) Allowing runaway characters seems to fit the use case very well. In that case, config can come later. :) |
I also wanted to say I won't be able to fix anything during the weekend because I'll be out of town/region/lost in a forest. I'll try to finish implementing the proposed changes ASAP, which means probably next thursday. |
No rush |
…ature_collapse_status
Sorry for that. I wanted to comment that I still need to fix things because that merge obviously didn't go as cleanly as GitHub mentioned and then Chrome decided to scroll the page after loading idk what. tl;dr: Misclick D: this is frustrating. |
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.
Besides some style issues I have nothing to add.
Sorry, I completely forgot about this.
I think this should be non-configurable, and afaik @connyduck agrees.
I did not run it yet, I will try to check it tomorrow but looks good code-wise, good job!
app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/keylesspalace/tusky/util/SmartLengthInputFilter.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/keylesspalace/tusky/util/SmartLengthInputFilter.java
Outdated
Show resolved
Hide resolved
If you change idea on the configurability please feel free to revert b5d13e but even if you don't plan to, I'd argue that asking the community about their preference regarding having or not a toggle in the settings fragment would be a much better way to understand if it's worth removing or if it's going to cripple user experience. EDIT: @charlag since there was some discussion regarding changes you requested at the beginning and since they were a lot I ended up closing a few before commiting code and others we agreed on without needing to change code and probably something in there borked GitHub. I believe all changes you requested are actually fixed, although if you want to double check or reiterate something feel free to do that. P.S.: I was kinda hoping for more community feedback since there seemed to be quite a lot of points, especially in the design, where me, you and conny aren't fully agreeing on, so idk if you want to trap card and "we can change it later" or if you want try and see what the community thinks before merging and shipping alphas because I don't really mind which decision you want to go for, I'm just worried that even if we all were to agree from the beginning on such a big change having 3 people's opinion and several thousands "blank cards" seems a bit risky imo, especially considering all the heat about "content warning"s, "longposting" and all the new Drama™ which makes features like this delicate changes. |
That's the thing about both configurability and design: everyone has different opinions. We can ask, of course, but my guess is 90% of the people would agree with this being on. I see no reason to scroll through random 10k character post on mobile. |
I've tested a bit and I think button either needs background or bold text or both but I'd like to hear others |
The button should be bold by default since buttons on Android are bold by default and I am not adding any style to the text whatsoever. |
We discussed it with connyduck, we agree that the button should look like CW button. They promised to give more feedback tomorrow. |
Good work, looking forward to this feature. I would argue for some configurability, even if it's just setting the cut off length globally. But I'm not religious about it, and it's definitely something that can be added later, after some user feedback. Thanks for all the work y'all put into Tusky. |
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.
I think its ready to merge now! Good job @HellPie
Thanks @connyduck, spent quite some time on it, but it didn't turn out too hard to implement fortunately. Not quite sure how to handle the Codacy complaint about complexity since they suggest splitting in more methods and that adds a lot of overhead for a method that must always work as fast as possible, also it wouldn't really fix the complaint from a practical point of view. I fixed the import issue, that was quite critical imo since it's vital that if someone edits the code they won't pick up the wrong import statement since there are double APIs in place rn (bless fragmentation). Also still waiting on @charlag to confirm all past changes are actually resolved, since they are still marked as requested on GitHub because I marked them manually rather than letting GitHub handle it through automation. |
oh please ignore the codacy thing, I enabled it by mistake |
ok, that import still bothered me tho so I'll keep that commit @connyduck |
I think its failing because its out of memory 🙄. Its fine as long as bitrise passes. |
I'll call it a day then, right on time before I had to leave, too, ty for the review btw |
I can look tomorrow but I'm pretty sure it's okay if connyduck approved it.
16 Sep 2018, 21:34 by notifications@github.com:
…
Thanks > @connyduck <https://github.com/connyduck>> , spent quite some time on it, but it didn't turn out too hard to implement fortunately.
Not quite sure how to handle the Codacy complaint about complexity since they suggest splitting in more methods and that adds a lot of overhead for a method that must always work as fast as possible, also it wouldn't really fix the complaint from a practical point of view.
I fixed the import issue, that was quite critical imo since it's vital that if someone edits the code they won't pick up the wrong import statement since there are double APIs in place rn (bless fragmentation).
Also still waiting on > @charlag <https://github.com/charlag>> to confirm all past changes are actually resolved, since they are still marked as requested on GitHub because I marked them manually rather than letting GitHub handle it through automation.
—
You are receiving this because you were mentioned.
Reply to this email directly, > view it on GitHub <#825 (comment)>> , or > mute the thread <https://github.com/notifications/unsubscribe-auth/AC9KBmfie7lHn0zHsystKoR_na90gP67ks5ubqfagaJpZM4WU7wG>> .
|
Description
Supports showing a button to collapse/expand long posts. Fixes #748.
Features
Concerns
The way it was implemented has proven to be potentially expensive if more and more features will be added overtime to the timeline. This is mostly the fault of the current design within Tusky, which reloads layouts rather than just content.
A possible solution would be to redesign the core data models to store a full and a compressed version of the content but that would require extensive rewrite of several parts of the codebase which would not need to know about it, again, due to how Tusky's codebase is designed.
It has not proven to be an issue on my Nexus 6 (Lineage OS 15.1), OnePlus 3 (Lineage OS 15.1) and Moto G (1st gen, LineageOS 14.1) yet so I did not want to enforce the feature so deep into the internals of the application.
Screenshots
Video of the feature is available on Imgur, due to restrictions with file types allowed on GitHub.