Commit Graph

152 Commits

Author SHA1 Message Date
Tim Robinson 4884a49dfb Pretty-ify code. Remove unnecessary comment 2020-03-31 00:19:58 -07:00
Tim Robinson 8cce580008 Show who liked content on hover
- Adds a hover popup that shows the names of everyone who liked a post
when hovering of the heart.
- Add new call to post.get that retrieves the names of all voters and
returns them instead of their ID's.
2020-03-30 23:53:27 -07:00
Christian Bundy 7e22829578 Fix own profile error
Problem: A `null` relationship represents when it's your profile, which
isn't very intuitive. It causes an error when we try to check for the
`blocking` and `following` properties, which don't exist on `null`.

Solution: Instead of `null`, set a `me` property to tell whether this
relationship is our own profile.
2020-03-28 13:32:02 -07:00
Christian Bundy e7bd3ed305 Add block and unblock to author profile
Problem: We have a way to follow and unfollow, but there's no way to
block or unblock. Also if you go to the profile of a blocked peer, their
posts still show up.

Solution: Add block and unblock and hide messages from blocked peers on
their profile page.

Fixes: https://github.com/fraction/oasis/issues/370
2020-03-28 10:03:31 -07:00
Christian Bundy 4091fce767 Fix linter problems
Problem: This doesn't pass the linter.

Solution: Run `npm run fix` and disable the spell-checker when we
define language names.
2020-03-27 14:14:39 -07:00
wuhei b27b6241f2 Italian translation, changed a string in the Spanish translation 2020-03-27 19:12:49 +01:00
Christian Bundy fb23d25217 Add more type definitions to reduce implicit any
Problem: We still have heaps of implicit 'any' types that our linters
can't make sense of.

Solution: Keep on adding type documentation! Slowly but surely I'm
hoping we can reduce the amount of untyped JavaScript in the repo.
2020-03-27 08:21:40 -07:00
Christian Bundy defb57321e Merge branch 'master' of github.com:fraction/oasis into type-defs 2020-03-27 08:02:44 -07:00
Nick Wynja 8efe326cdf
Merge pull request #357 from christianbundy/consistent-ui
Fix UI inconsistencies
2020-03-27 09:44:47 -04:00
mario siqueira acba28af67 Prettiered 2020-03-26 18:13:38 -03:00
Mario Siqueira 2c86eb5cf1
fixed the fix
Previous fix did not take into account "unfollow". Now it does
2020-03-26 17:56:10 -03:00
Mario Siqueira a5ae700b92
fix follow button link for non-english languages
currently if non-english language is set in configuration, the FOLLOW button doesn't work (it takes the i18n translation as part of the URL).
2020-03-26 16:48:16 -03:00
Christian Bundy 9ddb23b501 Fix UI inconsistencies
Problem: After some fantastic new pull requests, there are some
inconsistencies between how each author implemented different features.

Solution: Fix regressions and iron out inconsistencies. This fixes the
heart highlight bug, uses the same indentation for Summaries + Threads +
the thread view, tightens up the CSP now that we don't need
unsafe-inline styles, and uses a neutral tone for indents with the same
width as the blockquote border (so far violet has been reserved for
private messages).
2020-03-25 16:03:51 -07:00
Jacob Karlsson 7e1b38394b Fix style 2020-03-25 21:31:23 +01:00
Jacob Karlsson e8b2a2d163 Merge branch 'master' of github.com:fraction/oasis into hide-forks 2020-03-25 21:24:09 +01:00
Jacob Karlsson 86450d49ce Auto-expand ancestors of the linked post 2020-03-25 21:09:04 +01:00
Jonathan Dahan 9bbf082304
Merge pull request #342 from christianbundy/connected-only
Only show connected peers in settings
2020-03-25 10:01:18 -04:00
Nick Wynja 95e7a31dcd lint fix 2020-03-25 09:05:53 -04:00
Nick Wynja 48f8108340 Merge master 2020-03-24 21:00:38 -04:00
Nick Wynja a96aaa5012 Merge conflict 2020-03-24 19:57:22 -04:00
Nick Wynja fa874e8f4f Fixes spacing issues in text-based browsers
Closes #329; Addresses spacing issues in text-based browsers by introducting block
elements and non-breaking spaces.
2020-03-24 19:40:12 -04:00
Christian Bundy 64ab443e27 Only show connected peers in settings
Problem: The peer list shows peers that are connected and in the process
of establishing a new connection, which has lots of turbulence. It's
confusing to see dozens of "connections" that only exist for a few
milliseconds when they're actually just connection attempts.

Solution: Only show peers with the state "connected".
2020-03-24 09:47:45 -07:00
Christian Bundy c9fffe2b9c Add TypeScript definitions for better guardrails
Problem: We have TypeScript enabled on the project but have been missing
lots of definition files, so there are like 500 errors when you enable
`--noImplicitAny`.

Solution: Add definitions and fix the bugs that they point out. This
reduces the number of errors with `--noImplicitAny` to 285.
2020-03-24 09:23:52 -07:00
Christian Bundy 32465e5983 Update npm dependencies
Problem: Our dependencies are falling behind and it'd be nice to have
them up-to-date. The only big update it that Common-Good upgraded to the
latest version of Prettier.

Solution: Update them!
2020-03-23 18:59:53 -07:00
Jacob Karlsson cbb8ff381c Add previews of forks 2020-03-22 23:43:25 +01:00
Jacob Karlsson 3ed1e3e12f Rename variables with old names 2020-03-22 22:22:35 +01:00
Jacob Karlsson a84d469c7d Remove old way of indenting forks 2020-03-22 22:06:07 +01:00
Jacob Karlsson 66627be257 Simplify repeated logic 2020-03-22 21:48:59 +01:00
Jacob Karlsson aae34fbfad Remove inner functions by combining them 2020-03-22 21:36:26 +01:00
Jacob Karlsson 3b1bdc9218 Fix off-by-1 error WAOW 2020-03-22 21:20:30 +01:00
Jacob Karlsson 7171732bc0 Remove old commented code 2020-03-22 20:58:27 +01:00
Jacob Karlsson dba4ec2955 Add basic fork styling 2020-03-22 20:54:48 +01:00
Jacob Karlsson 7b05b78e52 Merge remote-tracking branch 'origin/master' into hide-forks 2020-03-21 14:43:37 +01:00
Christian Bundy e5df3a1497 Rename errorView() to indexingView()
Problem: Since the `errorView()` has a refresh we can probably just call
it `indexingView()` and add the indexing-specific code.

Solution:  Rename `errorView()` to `indexingView()` and add a progress
bar for it.
2020-03-17 07:41:57 -07:00
Christian Bundy 1f050b18a4 Add auto-refreshing error page on indexing error
Problem: The indexing message is being thrown as an error, which is
pasted as plaintext, so we can't do a page refresh. This is frustrating
when you're waiting for the indexes to finish because you have to
manually refresh a bunch while you wait.

Solution: Use the prototype from @justinabrahms to add an HTML message
for the indexing error and automatically refresh the page every ten
seconds.
2020-03-17 07:24:46 -07:00
Nick Wynja c3a4474256 Merge branch 'master' of https://github.com/fraction/oasis into threads 2020-03-11 23:22:11 -04:00
Cinnamon dba544c9b5
Merge branch 'master' into add-profile-image-upload 2020-03-11 17:20:47 -07:00
Christian Bundy 2c806af919
Merge pull request #311 from georgeowell/rearrange-settings
Rearrange settings
2020-03-11 07:10:34 -07:00
Henning Schumann 076f5f21c1 Fixed link to popular view in navigation 2020-03-11 11:30:49 +01:00
KawaiiPunk 4232d0f05b
Moved peer connections to the top of settings 2020-03-11 09:26:02 +00:00
KawaiiPunk 850d1d2373
Rearranged settings in order of most likely use 2020-03-11 09:14:14 +00:00
Nick Wynja 7e601ae35a Adds Threads view for seeing wider conversation 2020-03-10 08:42:56 -04:00
Henning Schumann 15417422a4 Made "private/public" comment translatable 2020-03-09 12:19:01 +01:00
Henning Schumann 314033cdd0 Made content warning text field placeholder translatable 2020-03-09 11:57:21 +01:00
Christian Bundy a2e7f4ad6d
Merge pull request #293 from hng/feature/translations-de
Add German translations
2020-03-08 17:57:46 -07:00
Cinnamon e7c38e3ec5
Merge pull request #285 from christianbundy/vanilla-markdown
Vanilla markdown
2020-03-06 11:57:08 -08:00
Jacob Karlsson 5c1cd759bc Fix bug with missing flatness 2020-03-06 17:00:06 +01:00
Jacob Karlsson e4a9548cda Add basic hiding of forks 2020-03-06 16:33:31 +01:00
Henning Schumann 6aca504921 Merge remote-tracking branch 'upstream/master' into feature/translations-de 2020-03-05 19:53:53 +01:00
KawaiiPunk 3ed7a52d37
Specified "this post" rather than "the post" in /publish 2020-03-04 00:17:06 +00:00
Christian Bundy cb1cf5e87e Render vanilla Markdown with basic renderer
Problem: The SSB-Markdown library has some SSB-flavored quirks, like
messing with newline behavior, and is inappropriate for rendering plain
Markdown like the readme.

Solution: Since SSB-Markdown uses Markdown-It under the hood, we can use
the same library and just render our Markdown *without* the SSB-flavored
quirks. This gives us the ability to wrap text and avoid SSB-Markdown
problems without having to rewrite all of our Markdown.
2020-03-03 16:13:56 -08:00
KawaiiPunk d4cb2cf9e9
Changed "warning to "content warning" 2020-03-04 00:11:45 +00:00
Christian Bundy 02d6d5adac Add profile image upload
Problem: We can set our name and profile description but profile images
are expected by most people and supported by most clients and we don't
have them. A profile without an image can sometimes lack the intimacy
you'd get if you let people upload profile images that they can use as a
visual avatar.

Solution: Add profile image upload to the Edit Profile page and add a
bunch of plumbing for `ssb.blobs.add()` to add the blob and publish a
message setting it as a profile image.
2020-03-01 11:11:09 -08:00
Cinnamon e9fc29c592
Merge branch 'master' into edit-profile 2020-02-27 14:05:37 -08:00
Christian Bundy 927026937c Add hashtag support to search
Problem: Searching for a hashtag should bring you to the hashtag page,
and the hashtag page should have some useful information about which
page you're on instead of just showing you the messages.

Solution: Add code so that if you search for a hashtag you're brought to
that page, and display some useful help text at the top of the page
explaining the hashtag page. While ensuring that the hashtag page showed
posts from around the network (instead of only people you're following)
I fixed the popular page so that it has the same behavior again (fixing
a regression) and filtered out gatherings (fixing *another* regression)
on the popular page. These probably should've happened in another commit
but I got carried away. :/

Happy to split this commit into two if it hurts to bundle the popular
fixes with the hashtag fix, but I'm low on energy and want to at least
open a PR in case it doesn't bother anyone.
2020-02-27 12:14:29 -08:00
Christian Bundy 3686113043 Add profile edit page
Problem: An SSB client should allow you to declare your own name, but
Oasis didn't support that behavior at all.

Solution: Add a basic 'Edit Profile' page that lets you set your name
and description. This doesn't implement profile images because I had
limited time and didn't want to think about encoding formats, but it's
worth mentioning that I remember something about binary uploads with the
default form encoding actually send 3 times as much data because of
escapes or something? This might not effect us because we're on
localhost, but I want to make a note that this isn't implemented yet.

This also makes a small change regarding the `<label>` element --
previously we were writing them as siblings to the input and using the
`for` attribute to target the input, but while messing with the CSS I
tried putting them directly in the `label()` and it ends up having the
same effect with less code.
2020-02-26 13:45:40 -08:00
Jonathan Dahan 16f19e85fb
Merge pull request #232 from christianbundy/add-version
Add Oasis version to settings
2020-02-18 14:03:41 -05:00
Christian Bundy 8088a9aa8b Add Oasis version to settings
Problem: It was impossible to tell which version of Oasis you're
running, which makes it hard to know when you need to update.

Solution: Put the version in the settings so it's easy to reference.
2020-02-18 10:44:36 -08:00
Christian Bundy 58b4d419f7 Create 'Summaries' page for new summary view
Problem: Until we have a way to change the view of each page, it seems
to me that each of the views that we're experimenting with should be on
their own page rather than modifying the existing pages to add more
functionality. I'm also noticing that I can't process all of the
information that's on the screen when the new horizontal layout is used,
and I think we would benefit from using the previous layout
consistently.

Solution: Move the summary view to its own page so that we can continue
to iterate on it without modifying the popular view, which is already
complex, and revert the style changes to maintain consistency with the
rest of the linear design (threads go downward, indentation denotes
sub-threads, etc).
2020-02-17 12:08:03 -08:00
Vincent Ahrend 2e7bc4739b Add code style fixes 2020-02-17 12:57:01 +01:00
Vincent Ahrend 6977cc3ee3 Show a preview of comments in post listings 2020-02-16 20:14:23 +01:00
Christian Bundy 876ba89947 Hide custom publish behind publish menu
Problem: The new custom publish was called 'Manual mode', which I'm
afraid isn't super easy to understand for people who don't already know
SSB. The custom publishing page didn't follow the same conventions as
other pages, either.

Solution: Hide the custom publish mode behind the publish page, with a
warning that it's for 'advanced users', and ensure that it uses the same
conventions and visual styles as other pages and code around the app.
2020-02-14 12:33:26 -08:00
Daan Wynen 5c038e70a3 [WIP] raw json submission form 2020-02-14 20:50:36 +01:00
Christian Bundy 2bc3aed067 Remove automatic mentions from private threads
Problem: When replying to a private thread we already know who the
recipients are, and they're already going to get the notification, so
there's really no reason to add a mention.

Solution: Remove the mention when the message is private.
2020-02-12 11:00:23 -08:00
Henning Schumann 18fc02dc87 Started German translation 2020-02-12 16:47:09 +01:00
Jonathan Dahan adfed1bead Add content warning publishing, fixes #191 2020-02-11 22:18:10 -05:00
Joshua Kelly f7ab71e891 Changes /meta to /settings
Problem: meta was renamed in the UI to settings, but the URLs say meta

Solution: Rename them to /settings/*
2020-02-10 18:07:55 -08:00
Cinnamon 7ee77172f2
Merge branch 'master' into add-invite-code 2020-02-06 14:22:55 -08:00
Christian Bundy 20b8bd188b Re-add publish to nav menu
Problem: Publish was missing! Oops.

Solution: Re-add it.

Resolves https://github.com/fraction/oasis/issues/171
2020-02-06 11:44:37 -08:00
Christian Bundy 602a495c7c Fix emoji and breaking space in main nav
Problem: The regular space in the sidebar emoji was breaking the line at
a specific viewport width and the emoji were being shown as the wrong
font.

Solution: Use a non-breaking space and `font-family: initial` for
full-color emoji instead of using the system font.

Resolves https://github.com/fraction/oasis/issues/150
Resolves https://github.com/fraction/oasis/issues/153
2020-02-05 14:35:30 -08:00
Christian Bundy d212948833 Add view info for Private, Mentions, and Publish
Problem: The Private and Mentions page didn't have view labels yet, and
Publish should be its own page instead of being at the top of every
page.

Solution: Inspired by @cinnamon-bun's work to add friendly view labels,
plus a new Publish page.  This also moves the period selection from the
popular page into the view label, which felt better to me with the
previous `<section>` background. I also tried a different text format
for describing the pages, using a common form and using `<strong>` to
draw attention to any change from "Posts from people you follow, sorted
by recency" which feels like the expected default for most people.

@cinnamon-bun: To me this feels like a fun back-and-forth where I'm
riffing on your work and hoping that you do the same, but if it feels
wrong/rude please let me know. Trying to work on designs with a system
like C4 is super new for me and I wouldn't be surprised if there are
pain points to fix!

Resolves https://github.com/fraction/oasis/issues/160
2020-02-04 17:52:50 -08:00
Christian Bundy 547ceeeac9 Add basic follow-back invites to settings page
Problem: There was no way to onboard new users since we couldn't redeem
invites.

Solution: Add basic follow-back invites to the settings page. This takes
an invite string, runs it through invite.accept, and either returns the
error in full *or* redeems the invite quietly.
2020-02-04 15:03:05 -08:00
Cinnamon 351ee2a2b5 remove leftover console.log 2020-02-04 14:21:33 -08:00
Cinnamon b79ece89e6 add title to likes page 2020-02-04 13:59:54 -08:00
Cinnamon 479285d244 add help text explaining what is in each view 2020-02-04 13:30:28 -08:00
Christian Bundy de117f8416 Merge branch 'master' of github.com:fraction/oasis into add-i18n 2020-02-04 09:57:45 -08:00
Christian Bundy 1099395dfa Merge branch 'master' of github.com:fraction/oasis into add-i18n 2020-02-03 21:51:59 -08:00
Christian Bundy 5635b36074 Merge branch 'master' of github.com:fraction/oasis into fix-search 2020-02-02 12:24:06 -08:00
Christian Bundy b0103ad847 Fix search hanging when querying 3 or fewer chars
Problem: SSB-Search has a bug where too few characters just hangs the
search indefinitely and never returns. https://github.com/fraction/oasis/issues/107

Solution: Enforce a minimum length of 3 characters in the search. I
bumped into another bug where HyperScript, a dependency of HyperAxe,
doesn't support the `minlength` attribute, so I had to deploy a small
workaround for that too. The fixes aren't very pretty but they're better
than just ignoring the problem.
2020-02-02 12:20:47 -08:00
Christian Bundy edf87a70df Persist language in cookies and fix fork drop-down
Problem: The previous commits didn't persist language choices and the
drop-down's initial value wasn't respecting the language you selected.

Solution: Persist the language choice in a cookie, defaulting to
English, and build the drop-down with the selected language. This also
changes the word "Spanish" to "Español", and slightly refactors
`http.js` to accept *middleware* rather than just routes. This lets us
add other middleware, such as the language selection middleware added in
this commit.
2020-02-02 09:31:43 -08:00
Christian Bundy 5225deef39 Remove duplicate condition 2020-02-01 14:16:06 -08:00
Christian Bundy 339fbdcf6a Add super basic language selection
Problem: The previous commit added English as a language but didn't add
other languages or ways to switch between them.

Solution: Add the most primitive language selection possible and a few
small translations contributed by @bramdroid during a totally unrelated
conversation. This does not persist the language selection and doesn't
auto-select the current language from the dropdown, but those should be
easy to add in the future.
2020-02-01 14:08:37 -08:00
Christian Bundy 214ef3335e Add basic scaffolding for internationalization
Problem: It was impossible to do any internationalization because
strings were all embedded throughout Oasis.

Solution: Add an internationalization submodule that provides
language-specific strings for the text elements in views. In future
commits we can add language selection and fallbacks for when the
selected language doesn't support the text we need to have translated.
2020-02-01 13:20:22 -08:00
Christian Bundy ff54db563a
Merge pull request #132 from fraction/no-follow-yourself
Remove follow button from your own profile
2020-01-31 21:05:54 -08:00
Cinnamon 12ad2c5834 Remove follow button from your own profile 2020-01-31 20:34:46 -08:00
Christian Bundy 0e9243eff0 Merge branch 'master' of github.com:fraction/oasis into view-markdown 2020-01-31 17:48:05 -08:00
Cinnamon 71d96128bd Change header on meta page to "Settings" 2020-01-31 15:58:40 -08:00
Christian Bundy 02326867a1 Move Markdown handling from model module to view
Problem: The model code was doing our Markdown rendering, which feels to
me like a layer violation because *generally* the model is meant to be a
thin abstraction over the underlying database without any concept of the
presentation layer.

Solution: Move the Markdown renderer to the view module and manage
Markdown rendering in the presentation layer.
2020-01-31 14:39:18 -08:00
martingrondin d0d12bd83f Fixed capitalization on networking buttons on Meta page. 2020-01-30 02:04:49 -05:00
Christian Bundy ec3e4d489a Merge branch 'master' of github.com:fraction/oasis into conn-buttons 2020-01-28 10:25:42 -08:00
Christian Bundy b56b4bcd74 Update Flotilla to fix conn.stop bug
Problem: Stopping the networking would sometimes allow peers to remain
connected, which was confusing.

Solution: Upgrade to latest SSB-CONN to pull in a bugfix for this
behavior. Huge thanks to @staltz for the quick fix!
2020-01-28 10:22:24 -08:00
Christian Bundy ae08e0715f Use capitalization for Oasis links and buttons
Problem: Using all-lowercase-everything isn't really a standard around
the web and it might be better to use consistent capitalization. This
was brought up in: https://github.com/fraction/oasis/issues/98

Solution: This changes the main navigation to use links with the first
letter capitalized, like how Patchwork + Twitter + Mastodon + etc do it.
This means that we're consistently using sentence case everywhere, which
I think is our best option. Originally I tried experimenting with
all-caps for actions, which I found aesthetically pleasing, but you have
to reduce the font size to make it look good (bad!) and I was reading
that all-caps text is harder for friends with dyslexia or vision
impairments.
2020-01-27 15:48:13 -08:00
Christian Bundy 681e3c6755 Add buttons to 'meta' page to manage networking
Problem: Sometimes you want to disconnect from the network but you don't
want to have to restart Oasis with the `--offline` flag
(https://github.com/fraction/oasis/issues/89). Sometimes networking gets
stuck and you need to run the equivalent of `ssb gossip reconnect`
(https://github.com/fraction/oasis/issues/63).

Solution: Buttons on the 'meta' page that let you start, stop, or
restart SSB-CONN whenever you want. Note that this commit includes an
update to SSB-CONN, but this version and the previous version both have
a bug where hitting 'stop' twice in a row will throw an error. This
commit implements a workaround for the bug, but it's something we'll
want to remove later once the underlying bug is fixed.
2020-01-26 16:55:48 -08:00
Cinnamon b2e7652b31 Show peers by name, by host, or by key 2020-01-23 12:46:09 -08:00
Cinnamon a963248ed3
Merge branch 'master' into meta-names 2020-01-23 12:03:16 -08:00
Cinnamon 9064e2fe2b
Merge branch 'master' into common-good 2020-01-23 11:10:22 -08:00
Christian Bundy 817bfaa7e0 Add prototype for names in peer list 2020-01-22 17:29:14 -08:00
Cinnamon fffa827244 Add help text in Meta about peer connections 2020-01-22 15:19:00 -08:00
Christian Bundy b34b04c2c2 Experiment with common-good module 2020-01-21 16:22:19 -08:00
Christian Bundy 78b26f3de9 Fix follow button showing on own profile 2020-01-11 15:38:33 -08:00