GithubHelp home page GithubHelp logo

xyphyn / photon Goto Github PK

View Code? Open in Web Editor NEW
309.0 5.0 35.0 2.65 MB

A replacement for lemmy-ui with more features, a better design, and more customizability.

Home Page: https://phtn.app

License: GNU Affero General Public License v3.0

JavaScript 0.65% Nix 0.02% HTML 0.69% Svelte 80.27% TypeScript 17.90% CSS 0.40% Dockerfile 0.06%

photon's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

photon's Issues

Missing LICENSE

I see you have no LICENSE file for this project. The default is copyright.

I would suggest releasing the code under the AGPL-3.0-or-later license (like Lemmy) so that others are encouraged to contribute changes back to your project.

Admins do not have access to moderation actions

Describe the bug
As an instance administrator, I get moderation reports. However, when I click on the reported posts, I do not have the moderation actions such as to remove the post or ban the user.

To Reproduce (if applicable)
Steps to reproduce the behavior:

  1. As an admin, go to the reports page.
  2. Click on any reported post.
  3. Notice that you do not have any moderation actions present.

Expected behavior
Using the normal Lemmy-UI, I can remove posts or ban a user as an instance administrator.

Versions

  • Browser: Firefox
  • Photon version: 0.6.1

Feature request: Allow for resizable sidebars

Using v0.4.22.

As is, the two sidebars (community listing on the left, and community info on the right) both appear to be static widths. I personally find the communities sidebar on the left to be too wide, pushing the main content off to the right side too much.

I'd easily be able to fix this myself if I could adjust the widths of each sidebar with a little slider, much like Slack or VS Code (to give two examples).

Possible scroll weird behavior

OS: Android 12
Browser: Firefox 116 and Brave 1.56.20
Reproducible steps

  1. Click on about button
  2. scroll down in the menu

Expected behavior

The scroll only has effect on the menu, not in the behind timeline

Record_2023-08-08-13-06-47.mp4

Bind to localhost only?

It seems that the container is binding to 0.0.0.0 which means its exposed to the public ip address of the server.

Any way to send in a environment variable to make it bind to localhost only?

Container image

Hello, I'd love to throw this up as an alternative frontend option on https://lemdro.id, but I don't have the time right now to package it up myself. A Docker container or something like it could be easily deployed by me, thanks!

Shown option to delete a post when the author is from my instance, despite not being the author myself

See below screenshots. I don't know if this is just because I am an admin or if this happens normally, I will test it with a normal account when I have time today. If this is simply because I am an admin, feel free to close this issue. Additionally, I figure I should tell you that I'll be deploying a custom tool soon to auto-update lemdro.id when you release new versions :)

Thanks again for your work!

Screenshot_20230731-182041
Screenshot_20230731-182045

[Feature Request] Show Post instance

Similar to the show a user's instance toggle, I think it would be handy to have the post's instance shown as well.

This is where I mean (sorry for the useless arrow).
image

V/r,

Mike

Keyboard shortcuts in editor

Accessing photon through flatpak firefox on wayland.

Text editor hotkeys get sent to FF rather than the site-- for example, crtl + i should italicize, crtl + k should insert link markdown.

Expanding comments won't work on Lemmy 0.18.3

Since updating lemmy to 0.8.13, I am experiencing errors loading comments again.

For instance, using photon.xylight.dev through the default lemm.ee instance to access

https://photon.xylight.dev/post/lemm.ee/2185825

When clicking on 5 more to expand the comments, I get a "Failure to fetch comments" toast. Looking at the networking output, it appears that the JSON is being delivered properly.

Screenshot from 2023-07-28 15-49-40

I augmented the current Photon to simply log a console message of the error and attempting to do the same thing, it appears that result of buildCommentTree(...).find(...) is undefined and that is why it is failing.

Screenshot from 2023-07-28 15-54-48

What is puzzling is that if I switch to an instance running 0.18.2 such as lemmy.world, loading comments works fine.

I also tested this with lemdro.id and was able to observe the same behavior:

Screenshot from 2023-07-28 15-56-35

What is puzzling is that if I switch to an instance still running 0.18.2 such as lemmy.world (at the time of this issue), loading comments works fine.

Put vote arrows on the top left corner of posts like new Reddit.

On new Reddit, the vote buttons are in the top left corner. If the buttons were there for Photon as well, it would make the learning curve for Reddit users much smaller. When scrolling through new Reddit, I put my cursor where the arrow is and scroll down, keeping it in the same general area so I can quickly vote.

Screenshot 2023-08-08 at 4 05 45โ€ฏAM

[Feature Request] Make it possible to easily switch account

It would be awesome if we had a way of easily switching between Lemmy accounts. I, for instance, have my main admin account on lemmy.world, but I do not use that for general browsing, and it is kinda a hassle to log out and in just to switch to my alt-account. So something like this would be great!

Single-instance mode

If instance admins decide they want to only to use Photon instead of Lemmy-UI, an easy way to configure Photon to support sign-ups and not have users confuse with instance selection at login would be beneficial. (Perhaps Photon could access features not available through the regular API as well?)

Open images in fullsize without going to the post

Describe the solution you'd like
When I click on a image, open the image in the same page in it's full size rather than going to the post.

Additional context
For example, when you click on an image in mastodon.social it opens the image but doesn't go to the post.

Container crashing

Hey, decided to host this at beta.lemmy.zip, but I'm seeing quite a few errors from people using it via a desktop (mobile browsing seems to be OK as far as I can tell).

The error that crashes the container is:

FetchError: invalid json response body at https://lemmy.zip/api/v3/post/list?limit=20&page=1&sort=Active&type_=Local reason: Unexpected token '<', "<html>
<h"... is not valid JSON
    at /app/node_modules/node-fetch/lib/index.js:273:32
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  type: 'invalid-json'
}
/app/node_modules/node-fetch/lib/index.js:273
				return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
				                           ^
FetchError: invalid json response body at https://lemmy.zip/api/v3/site? reason: Unexpected token '<', "<html>
<h"... is not valid JSON
    at /app/node_modules/node-fetch/lib/index.js:273:32
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  type: 'invalid-json'
}

There are no other log files and I can't pinpoint exactly what causes the issue, but it appears to happen on page load after getting a "500" error.

Manual toggle for dark theme

No idea why this hasn't been reported yet, but I'd love to see a dark mode in Photon. I think its UI is beautiful, but I can't really consider using it daily without thinking "I wish this had a dark mode."

See next comment. The point still stands, however. I'd love to be able to use dark mode without having to explicitly tell the page that the system uses dark mode.

Feature request: Add setting to control default feed type and sort type

As is, Photon defaults to the Local feed type with Active sorting when navigating to the homepage.

Personally, I almost always use the Subscribed feed type. It would be nice if I could set that as the default.

As a workaround, I've bookmarked the URL with my preferred feed parameters:

https://photon.xylight.dev/?type=Subscribed&sort=Active

However, these parameters get erased when clicking on the app logo, so it's not a full solution.

Infinite scrolling

Rather than having to click "Next" to go to the next page, an automatically reloading infinite scrolling would be a more intuitive solution for a social feed.

PS: This is by far the best Lemmy front end! Thanks for your amazing work!

[Feature Request] Save expanded state for sidebar

If you refresh Photon or open a Post in a new tab, the sidebar is always expanded even if it was previously collapsed.

It would be nice if the expanded state was saved, perhaps in local storage so that it is remembered upon refresh or if a post is opened in a new tab or window.

Expanding comments fails

When clicking on nested comments that say "1 more" or "6 more", there is a spinner for loading, but the comments do not appear.

This can be reproduced here:

https://nu.lemdro.id/post/lemmy.world/2042527

On Firefox, the failure is silent. However, on Chrome, the failure triggers a red alert at the bottom that says the fetch failed.

In the Chrome, dev console, I see the following:

Screenshot from 2023-07-25 12-46-45

Following the stacktrace takes me to this:

Screenshot from 2023-07-25 12-48-13

Issue uploading image

Attempting to upload a png returns an error:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

Screenshot:
Screenshot from 2023-08-08 23-05-44

The png I tried to upload:
outer_wall

p.s.-- sorry for spamming the issues. Wanted to say I love the feel of this client and it's my favorite one so far :)

Post creation text editor field possible improvements

The size of the post editing field seems fine for a few sentences, but when typing a longer post, it quickly becomes insufficient. Additionally, the resizing handle is quite low contrast and some users might not be able to see it.

Possible solutions:

  • Increase default size of text editor field
  • Have size of text editor field expand as the user types up to a maximum size

Default size:
image
What seems like a more comfortable size for a larger post:
image

Markdown toolbar

Adding a markdown toolbar will help very much with post and comment formatting.

Have create post button autofill the community you are accessing

On the default client, there is a "create post" button for whatever community you are accessing, which is missing on photon, but the top right button replaces that nicely. However, it should probably autofill whatever community you were on when you clicked it for a more seamless experience.

Linking Post Description and Images to Postdetails View

Is your feature request related to a problem? Please describe.
Currently, Only the title of the post leads to Postdetails view ( ie the UI with post and its comments).
It would be nice if clicking the post description or Image ( if imagepost) would also lead to the UI.

Describe the solution you'd like
Clicking on the description would also lead to showing the postview page.

Describe alternatives you've considered
Not relevent

Additional context
Nothing

Should the navbar avatar URL use a query string?

While writing my contribution in #44 I noticed that the Avatar component (for posts, comments, etc.) appends the query string ?format=webp&thumbnail={width * 2} to the avatar URL, which requests a WebP format and a smaller size. The navbar avatar does not do this. My personal avatar happens to be quite large (1024x1388), much larger than the navbar avatar needs. Should we append a query string here too?

Example URLs:

Sorting by Read Doesn't Pull Posts from New Pages

Describe the bug
When you sort by read, it seems Photon just pulls a page then hides the posts already seen. This means if you've seen all the posts on the first page but none on the second, when you reload the first page it will show nothing until you go to the second page.

To Reproduce (if applicable)
Steps to reproduce the behavior:

  1. Go to Settings and turn on "Hide read posts"
  2. Go back to the main page and make sure all the posts on a page are marked as read
  3. Reload
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
First page after all posts have been read and then reloaded
image
Second page after first blank page
image

Versions

  • Browser: Firefox
  • Photon version: 0.5.5

[Feature Request] Display how old a notification is.

On the normal lemmy ui, they show how old a notification is. This would be nice to have on photon aswell, as it makes it easier to go trough your messages and replies. Especially if you are an admin or mod ๐Ÿ˜Š

This is how it looks like on the normal UI for referance.

Screenshot_20230801-233050_Vivaldi Browser.jpg

Unread indicator no longer works

With 2da415b we no longer call setInterval to periodically update the number of unreads and reports the user has. Because of this, we no longer get a notification dot on the avatar icon or the inbox in the dropdown menu.

I've tried to restore this functionality with the following code in src/lib/lemmy.ts:

setInterval(async () => {
  const auth = get(profile)

  if (!auth?.jwt || !auth?.user) return

  const response = await getClient().getUnreadCount({
    auth: auth.jwt
  })

  auth.user.unreads =
    response.mentions +
    response.private_messages +
    response.replies

  if (amModOfAny(auth.user)) {
    const reports = await getClient().getReportCount({
      auth: auth.jwt
    })

    auth.user.reports =
      reports.comment_reports +
      reports.post_reports +
      (reports.private_message_reports ?? 0)
  }
}, 30 * 1000)

This appears to work for restoring the red notification dot to the inbox in the dropdown menu, but not for the avatar itself.

I can make a PR with this initial attempt, but I'm not sure how to get the notification dot to show up the avatar... looking at the DOM via the web inspection tools, it seems to never actually add the corresponding div for the avatar, but does so for the inbox menu.

Taglines do not support markdown

Thanks for implementing #20 so quickly! I discovered that markdown doesn't seem to be parsed in taglines at the moment
Screenshot_20230726-143749

No rush, thanks for your work!

Add support for instance taglines

I'll try not to make too many issues for you, but it would be great to display the instance tagline like the official UI does. I'm using it to present small snippets of information such as:
image

It cycles through the taglines I've setup:
image

I assume there is an API for these, but definitely not a priority!

Surface moderator actions to admins, regardless of mod status

Instance admins have full access to moderation tools on all communities hosted on their local instance regardless of mod status. It would be great to show the moderation button in this case as well!

Thanks again for your hard work! Can attach a screenshot if needed.

Put dropdown menu action buttons on the card in card view if they can fit.

This is what photon looks like on my computer. There are a bunch of options hidden in a hamburger menu which is very inefficient compared to other Lemmy UIs and new Reddit. What Photon could do, is put the action buttons on the card next to the comments button if they can fit. If its wide enough for only one button and not the other two on a certain width, then show the one.

Add "read" button for individual messages in inbox

Is your feature request related to a problem? Please describe.
Sometimes when I'm going through my inbox, I have several messages that I reply to one at a time. It seems like posts aren't being marked as read after I view them, so it would be nice to have a manual "mark as read" button on each inbox entry.

Instance icon is cropped too small

LOVE the work done to show the instance icon in the top left. Only problem is it crops it into a relatively tight circle. This leaves the lemdro.id icon looking in a rather sorry state:
image

Compared to how it should look:
image

Maybe just adjust how much cropping the circle does? You can see the bottom screenshot here still does have a circle but it is much "larger". Some other frontends don't even force the circle. It is kind of up to you design-wise. Thanks again!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.