Code Monkey home page Code Monkey logo

pinafore's Introduction

Pinafore No Maintenance Intended

Note: Pinafore is unmaintained. Read this. Original documentation follows.

An alternative web client for Mastodon, focused on speed and simplicity.

Pinafore is available at pinafore.social. Beta releases are at dev.pinafore.social.

See the user guide for basic usage. See the admin guide if Pinafore cannot connect to your instance.

For updates and support, follow @[email protected].

Browser support

Pinafore supports the latest versions of the following browsers:

  • Chrome
  • Edge
  • Firefox
  • Safari

Compatible versions of each (Opera, Brave, Samsung, etc.) should be fine.

Goals and non-goals

Goals

  • Support the most common use cases
  • Small page weight
  • Fast even on low-end devices
  • Accessibility
  • Offline support in read-only mode
  • Progressive Web App features
  • Multi-instance support
  • Support latest versions of Chrome, Edge, Firefox, and Safari
  • Support non-Mastodon instances (e.g. Pleroma) as well as possible
  • Internationalization

Secondary / possible future goals

  • Serve as an alternative frontend tied to a particular instance
  • Offline search

Non-goals

  • Supporting old browsers, proxy browsers, or text-based browsers
  • React Native / NativeScript / hybrid-native version
  • Android/iOS apps (using Cordova or similar)
  • Full functionality with JavaScript disabled
  • Emoji support beyond the built-in system emoji
  • Multi-column support
  • Admin/moderation panel
  • Offline support in read-write mode (would require sophisticated sync logic)

Building

Pinafore requires Node.js and Yarn.

To build Pinafore for production, first install dependencies:

yarn --production --pure-lockfile

Then build:

yarn build

Then run:

PORT=4002 node server.js

Docker

To build a Docker image for production:

docker build .
docker run -d -p 4002:4002 [your-image]

Now Pinafore is running at localhost:4002.

docker-compose

Alternatively, use docker-compose to build and serve the image for production:

docker-compose up --build -d

The image will build and start, then detach from the terminal running at localhost:4002.

Updating

To keep your version of Pinafore up to date, you can use git to check out the latest tag:

git checkout $(git tag -l | sort -Vr | head -n 1)

Exporting

Pinafore is a static site. When you run yarn build, static files will be written to __sapper__/export.

It is not recommended to directly expose these files when self-hosting. Instead, you should use node server.js (e.g. with an nginx or Apache proxy in front). This adds several things you don't get from the raw static files:

  • CSP headers (important for security)
  • Certain dynamic routes (less important because of Service Worker managing routing, but certain things could break if Service Workers are disabled in the user's browser)

Having an nginx config generator is currently an open issue.

Developing and testing

See CONTRIBUTING.md for how to run Pinafore in dev mode and run tests.

Changelog

For a changelog, see the GitHub releases.

For a list of breaking changes, see BREAKING_CHANGES.md.

What's with the name?

Pinafore is named after the Gilbert and Sullivan play. The soundtrack is very good.

pinafore's People

Contributors

aldarone avatar alrra avatar blackle avatar charlag avatar codl avatar dependabot[bot] avatar graue avatar greenkeeper[bot] avatar hellojaccc avatar jcsteh avatar joenepraat avatar krinkle avatar marcozehe avatar mlcdf avatar nickcolley avatar nolanlawson avatar nvdaes avatar phtan avatar ringtailsoftware avatar rylancates avatar sdgluck avatar sgenoud avatar sorin-davidoi avatar spankyworks avatar stanclai avatar szermatt avatar tbroyer avatar tepreece avatar uiri avatar vinnl avatar

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pinafore's Issues

It could be easier to switch between accounts!

Hello. :) So I read the contributor guidelines, and I understand that this might be an issue that it's too early-days for and you might not respond, which is totally fine.

First of all, this is very nice to use! I love the dark text on the light background, too. My feedback is just that it takes a lot of clicks/taps to switch between accounts - Settings > Instances > [Instance] > "Switch to this instance" > Home. So a way to make that a little faster, and maybe even a way to change which account you're posting to from the "New Toot" text box area, could be really nice!

Thank you for your hard work on this, the results so far are LOVELY.

Self-hosted Pinafore instances should report their own custom URL

If I create an toot using the instance https://pinafore.photog.social the public Mastodon toot page says it was created using Pinafore and links that text to https://pinafore.social.
Shouldn't it link directly to the instance which was used to create the toot?
Other people could see that note and it would help the decentralization if that note links to different instances and not only the official one.
As the correct link must be configured for the callback from the OAuth login page it should be easy to use the same address for the footer note.

PWA support on iOS 11.3

Reported here:

PWA functionality does not play nicely yet on iOS11.3 because when adding an instance, Safari opens & gets the login cookie instead of the sandboxed PWA webview, so it cannot login.

Hit detection on compose button sometimes fails in Chrome

In desktop Chrome, if you scroll fast on the home timeline and click the sticky-positioned "compose" button, occasionally the hit detection falls through and clicks the underlying element instead. No repro in Edge, Firefox, or Safari. Probably a Chrome bug, but there may be some way to work around it.

Content Security Policy (CSP)

Pinafore doesn't load any JS/CSS from anywhere but pinafore.social, but it'd be nice to protect against any potential XSS attacks by stipulating that fact in the CSP headers.

Media pagination

When you click the _n_th media in a status, you should be able to click some left or right buttons (or use the left/right keyboard buttons) to paginate between them.

Swipe gesture on mobile

Swipe left and right on a timeline to switch columns, so you don't need to tap the button in the navigation header.

I avoided this because I found that the react-swipeable-views on Mastodon sometimes has false positives on certain browsers. E.g. on mobile Firefox you scroll down, but it's interpreted as a swipe, which is confusing. Also touchmove events can block scrolling.

I think it may be possible to do this performantly and accurately with Pointer Events, but this needs some investigation first.

Service Worker updates result in async chunk failures

When the Service Worker updates, I've observed that in desktop Firefox the async chunks might fail to load unless you refresh the page. There is probably a way to fix this, but haven't figured it out yet.

STR:

  1. Update the service worker until you see the "app update available" toast
  2. Click a button that triggers a modal or something that triggers an async chunk
  3. Observe that the async chunk fails to load

Push notifications

I'm not sure we could do this in a privacy-respecting way. I'd really prefer not to handle any user data server-side.

Perhaps it would be possible to extend the Mastodon server API to allow clients to hook into the web push notification system? That way all user data would still reside with the instance, and the web client would just be responsible for receiving pushes.

After posting a reply, keyboard focus is not restored to the toot I am replying to.

To reproduce, with VoiceOver and Safari on the Mac:

  1. Find a toot to reply to, then navigate to the Reply button and hit Ctrl+Option+Space (keystroke to activate current control).
  2. Navigate forward (ctrl+option+right arrow) to the input to compose your reply. Write something.
  3. Forward some more to the Toot button and hit Ctrl+Option+Space.

Expected: Toot is posted, and focus is restored to the Reply button of the toot I was replying to.
Actual: Toot is posted, but focus ends up somewhere random. So far, I've either landed at the very bottom of the page or at the toot controls at the top that are unrelated to replying.

"Error: undefined" when adding an instance

When attempting to add an instance, https://i.write.codethat.sucks, I get: Error: undefined. Is this a valid Mastodon instance? I see an OPTIONS, a GET, and a POST, all succeeding. In the console, an InvalidStateError and then some error event involving the string IDBOpenDBRequest. Something to do with IndexedDB?

Firefox ESR 52, Debian Linux 9.

Export as static site

This is useful for folks who want to self-host Pinafore but don't want to spin up a whole Node server to do so. It'd also be useful for hybrid mobile apps.

In theory sapper export should work, but I'm on an older version of Sapper and so it doesn't. Need to either 1) upgrade Sapper, or 2) write my own script to crawl the various URLs and generate a static site. (2) may be easier given all the modifications I've made to the Sapper code.

opening cybrespace custom emoji locks up pinafore

Pixel 2, Chrome 65.0.3324, installed as a PWA. Also confirmed on Chrome 65, ubuntu linux

The entire site locks up, leading to the app needing to be force-closed (on mobile), or displaying the "oh snap!" page on chrome.

of note is that we have lots of emoji (339) and a couple that are broken (for unknown reasons, the asset urls return 403s)

Add title as well as alt for image descriptions

I can read image descriptive/alternative text by right clicking the image and viewing image info, but it would be nice to be able to see the descriptive text without having to click anything.

Basic feature parity with Mastodon web UI

To reach basic parity with the Mastodon web UI, we need these features:

  • mention someone from their profile page
  • block/unblock accounts
  • mute/unmute accounts
  • authorize/reject follow requests
  • show list of followers/following on account profile
  • pin/unpin toots
  • mute conversation
  • hide boosts from someone
  • block/unblock instances
  • show client that posted a toot (web/Amaroq/etc)
  • report toots
  • confirmation dialogs for deleting/boosting/blocking/muting/etc
  • confirmation to also mute notifications when muting someone
  • media focal points
  • opengraph cards
  • edit profile
  • edit lists
  • paginate list of accounts beyond 80
  • close/open all CWs in a thread at once
  • embed a status

Dark themes

There's no reason we couldn't also support dark themes.

20 second timeout may be too aggressive

The goal is to fallback to offline mode when offline, but for some instances this means media uploads just don't work. Upping to 30 seconds or having a higher timeout for media would be a potential fix.

Support for private browsing (Safari, Edge, Firefox)

When using Safaris private mode it shows an error page saying that it can't open the site after entering the 2FA code for your instance. All extensions were disabled.

Safari 11.1 on macOS 10.13.4

Screenshot (in German):
bildschirmfoto 2018-04-09 um 18 28 46

Filter timelines

This is currently not supported, but ideally you should be able to set filters that apply to all instances.

Easier instance switching

Right now you have to go into the settings to switch instances, but it'd be nice if you could do it from the home page.

Too many itemIdsToAdd events for threads

There appears to be a leak in websockets for threads; I shouldn't be seeing this many console logs about this.

adding  0 items to itemIdsToAdd for thread status/99830632393220746
adding  1 items to itemIdsToAdd for thread status/99830809027028309
adding  1 items to itemIdsToAdd for thread status/99830575416375613
adding  1 items to itemIdsToAdd for thread status/99830830651335119
adding  0 items to itemIdsToAdd for thread status/99830810675607503
adding  0 items to itemIdsToAdd for thread status/99830521172162781

Can't add an instance if there's a trailing slash in the URL

I tried to add https://i.write.codethat.sucks/ as an instance and received this error:

Error: NetworkError when attempting to fetch resource.. Is this a valid Mastodon instance?

Nothing stands out in the dev console or network log (and I don't see a request attempt being made.)

Firefox ESR 52, Debian Linux 9. Is this maybe an issue with Service Workers? I see that entered Firefox in January 2018.

when replying to a toot, input is hidden by keyboard

Pixel 2, Chrome 65.0.3324, installed as a PWA (no clue how to find the app shell version sorry :( may be different from the installed chrome)

After pressing "reply", the input field opens and receives focus, but then the keyboard opens and covers the input field, emoji/attach/cw controls, and toot button. The input form does not appear to automatically scroll into view the way I would expect it to

ideally, the correct behavior here is that, after the keyboard opens, not only the input field but also the "TOOT" button is still in view.

Full emoji keyboard

It's not ideal performance-wise, but not everyone has an emoji keyboard on their operating system or knows how to use it. We probably ought to have a full emoji keyboard beyond just the custom emoji.

Distinguish notifications from different instances

Currently, all incoming notifications show up in the Notifications tab, regardless of which instance you're using. It would be helpful to distinguish this, whether it be by only showing notifications for the active instance, adding a tag, or something else.

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.