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

Adding Show Post Source button #901

Merged
merged 8 commits into from
Jun 30, 2023
Merged

Adding Show Post Source button #901

merged 8 commits into from
Jun 30, 2023

Conversation

ZJouba
Copy link
Contributor

@ZJouba ZJouba commented Jun 28, 2023

Add "View Post Source" button to Post Options Dialog to show raw text

show_source.mp4

Addressing: #506

Translations with ChatGPT

Copy link
Collaborator

@MV-GH MV-GH left a comment

Choose a reason for hiding this comment

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

Looks good, and works but for the translations next time if you don't know the language don't add them. As you have no guarantee that ChatGPT doesn't generate nonsense.

One thing I would like to have changed though is when you want to see the original comment back the text still displays View post source Maybe change this to something like View original text (or something better)

@ZJouba
Copy link
Contributor Author

ZJouba commented Jun 29, 2023

@MV-GH I would like to change the button text but how do I do that without passing the viewSource boolean around, it seems messy. Best way that I can figure is to actually create a boolean on the postView.post saying "isSource" or something.
What would you suggest?

@twizmwazin
Copy link
Contributor

Can you reuse the viewSource variable?

@@ -335,4 +335,5 @@
<string name="create_edit_post_close">Close</string>
<string name="lang_language">Language</string>
<string name="blur_nsfw">Blur NSFW images</string>
<string name="post_listing_view_source">View Post Source</string>
Copy link
Member

Choose a reason for hiding this comment

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

Agree with @twizmwazin , either re-use the comment_node_view_source string, or just make this one View Source

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think he meant can't I reuse the viewSource variable to change the button text, but @twizmwazin passing in that variable, all the way from PostListing, just to change the button text feels bad

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dessalines Isn't it better that it has it's own resource string? Somewhere along the line someone might change comment_node_view_source not thinking that it will also change for the Post Listing...

@ZJouba
Copy link
Contributor Author

ZJouba commented Jun 30, 2023

@MV-GH I've updated to use the bool for changing the button from View Source to View Original

Copy link
Collaborator

@MV-GH MV-GH left a comment

Choose a reason for hiding this comment

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

Tested it and works well, thx for work! Passing the bool down was the best way. For blurNSFW i had to pass it down like 10 composables

@MV-GH MV-GH merged commit 26a7287 into LemmyNet:main Jun 30, 2023
@ZJouba ZJouba deleted the issue/506 branch June 30, 2023 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants