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

Post preview with blobs and mentions #462

Merged
merged 51 commits into from
Nov 11, 2020
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
423c0c1
begin working on preview with blobs
cryptix Oct 12, 2020
b101472
improve visual hierarchy by refining bold text use
cblgh Oct 12, 2020
5064e32
ignore vim swap files
cblgh Oct 12, 2020
b4fb448
improve thread view
cblgh Oct 12, 2020
d2c5c5f
make like button the same size as other footer actions
cblgh Oct 12, 2020
52382ba
condense threads in summaries view, as well
cblgh Oct 12, 2020
cc8d2db
extract preview code into generatePreview
cblgh Oct 13, 2020
e64b595
implement comment previewing
cblgh Oct 13, 2020
be41279
whoops cleanup
cryptix Oct 12, 2020
5cb4c8a
use file-type for mime and enhanced preview
cryptix Oct 12, 2020
0ea5f99
fix crash w/ no likes, improve preview styling
cblgh Oct 13, 2020
0e8ee0c
improve thread view
cblgh Oct 12, 2020
e63937c
condense threads in summaries view, as well
cblgh Oct 12, 2020
83ab086
extract preview code into generatePreview
cblgh Oct 13, 2020
2d5781f
add subtopic previewing
cblgh Oct 14, 2020
0449ebd
refactor previewView, fix displaying content warnings in previews
cblgh Oct 14, 2020
119c1f8
implement content warnings for comments, subtopics
cblgh Oct 14, 2020
680a894
add blob upload to comment, subtopics
cblgh Oct 14, 2020
6d50e53
remove exif data from uploaded jpegs
cblgh Oct 14, 2020
53ee4a5
tweak post preview css
cblgh Oct 14, 2020
2f042c5
remove superfluous padding top from post-preview2C
cblgh Oct 14, 2020
8fe9c5b
make subtopicView and commentView consistent w/ threads
cblgh Oct 14, 2020
9004280
some @mentions in preview
cryptix Oct 14, 2020
2fca625
delineate bottom border of summary details
cblgh Oct 15, 2020
8127008
add i18n.preview for all languages except .de, improve labels
cblgh Oct 15, 2020
632d23c
add german translations (thx cryptix)
cblgh Oct 15, 2020
d1e68e9
some prefix matching logic
cryptix Oct 15, 2020
a2817cf
implement relationship-based name matching
cblgh Oct 15, 2020
6ea47eb
some more comments
cryptix Oct 15, 2020
d4a1602
add much improved mentions listing
cblgh Oct 16, 2020
9fb2b87
add i18n for mentions component
cblgh Oct 16, 2020
28f1821
improve mentions regex edge cases
cblgh Oct 16, 2020
8f9ef5e
change name->feed lookup structure
cryptix Oct 16, 2020
ffb207c
add more delims, fix double nicknames
cblgh Oct 16, 2020
2f746d9
remove bracket from regex
cblgh Oct 16, 2020
c3acbc8
fix @mentions lookup table
cryptix Oct 18, 2020
3bdca12
invalidate @mentions cache if the user follows someone
cryptix Oct 18, 2020
e7dd215
fix common-good setup
cryptix Oct 19, 2020
4884f26
add simple test for blob uploads
cryptix Oct 19, 2020
67241ce
pin deps
cryptix Oct 19, 2020
6220da4
fix button sizes
cblgh Oct 19, 2020
e08901d
replace warning with comment
cblgh Oct 20, 2020
0624aeb
shuffle css around to make prettier / common-good happy
cblgh Oct 20, 2020
756fd18
fix eslint errors
cblgh Oct 20, 2020
988d35a
manually edit package-lock
cblgh Oct 21, 2020
d88d960
reset test/basic.js
cblgh Oct 21, 2020
4d5c571
restore common-good check & fix its errors
cblgh Oct 21, 2020
e3906e2
fix race on blobs variable
cryptix Nov 1, 2020
e7ea4db
make code flow more shallow
cryptix Nov 1, 2020
e567443
try workaround
cblgh Nov 11, 2020
2fc33f4
document quick fix for making the server definitively exit
cblgh Nov 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ yarn.lock

# Visual Studio Code
launch.json
*.code-workspace
*.code-workspace

# Vim
.*.sw[a-z]
7,052 changes: 4,341 additions & 2,711 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"dev": "nodemon --inspect src/index.js --debug --no-open",
"fix": "common-good fix",
"start": "node src/index.js",
"test": "tap --timeout 240 && common-good check --dependency-check-suffix '-i changelog-version -i mkdirp -i nodemon -i stylelint-config-recommended'",
"test": "tap --timeout 240 && common-good test --dependency-check-suffix '-i changelog-version -i mkdirp -i nodemon -i stylelint-config-recommended'",
"preversion": "npm test",
"version": "mv docs/CHANGELOG.md ./ && changelog-version && mv CHANGELOG.md docs/ && git add docs/CHANGELOG.md"
},
Expand All @@ -26,6 +26,7 @@
"@koa/router": "^8.0.0",
"debug": "^4.1.1",
"env-paths": "^2.2.0",
"file-type": "^15.0.1",
"highlight.js": "^9.18.1",
"hyperaxe": "^1.3.0",
"is-svg": "^4.2.1",
Expand All @@ -36,11 +37,13 @@
"lodash": "^4.17.11",
"markdown-it": "^10.0.0",
"open": "^7.0.3",
"piexifjs": "^1.0.4",
"pretty-ms": "^6.0.0",
"pull-paramap": "^1.2.2",
"pull-sort": "^1.0.2",
"pull-stream": "^3.6.12",
"require-style": "^1.1.0",
"sharp": "^0.25.2",
"ssb-client": "^4.9.0",
"ssb-config": "^3.4.4",
"ssb-markdown": "^6.0.7",
Expand All @@ -49,8 +52,7 @@
"ssb-ref": "^2.13.9",
"ssb-tangle": "^1.0.1",
"ssb-thread-schema": "^1.1.1",
"yargs": "^15.3.1",
"sharp": "^0.25.2"
"yargs": "^15.3.1"
},
"devDependencies": {
"@types/debug": "^4.1.5",
Expand Down
119 changes: 114 additions & 5 deletions src/assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -113,24 +113,53 @@ a {
color: var(--fg-light);
}

button {
button,
.file-button {
cursor: pointer;
background: var(--fg);
color: var(--bg);
border: var(--size--4) solid var(--fg);
padding: var(--size--1) var(--size-0);
border-radius: var(--common-radius);
font-size: 8pt;
}

.file-button {
float: right;
margin: 0;
background: transparent;
color: var(--fg);
}

#blob {
visibility: hidden;
height: 0;
padding: 0;
margin: 0;
}

section.post-preview {
padding-top: 0;
background: var(--bg-selection);
border: var(--fg-alt) solid 1px;
}

section.post-preview > section > footer {
display: none;
}

section header a {
display: flex;
color: var(--fg-status);
text-decoration: none;
font-weight: bold;
margin-right: var(--size--2);
margin-left: var(--size--2);
}

section header a:hover {
text-decoration: underline;
}

/* For use with elements specific for
* rendering in a text browser and intended
* to be hidden in a graphical browser. */
Expand All @@ -141,7 +170,11 @@ section header a {
section > footer > div > a,
section > footer > div > form > button {
color: var(--fg-status);
font-weight: bold;
}

section > footer > div > a:hover,
section > footer > div > form > button:hover {
text-decoration: underline;
}

section > footer > div > form > button {
Expand Down Expand Up @@ -319,13 +352,16 @@ nav {
nav > ul > li > a {
color: var(--fg);
text-decoration: none;
font-weight: bold;
}

nav > ul > li > a.current {
nav > ul > li > a:hover {
text-decoration: underline;
}

nav > ul > li > a.current {
font-weight: bold;
}

section {
padding: var(--size-0);
border-radius: var(--common-radius);
Expand All @@ -336,6 +372,69 @@ section {
box-sizing: border-box;
}

.indent section,
.thread-container section {
margin: unset;
border-radius: unset;
border-bottom: var(--fg-alt) solid 1px;
}

.indent details[open] {
border-bottom: var(--fg-alt) solid 1px;
}

.indent section:last-of-type,
.thread-container section:last-of-type {
border-bottom: unset;
}

.mentions-container {
display: grid;
grid-template-columns: 4rem auto;
grid-column-gap: 1rem;
margin-bottom: var(--size-0);
}

.mentions-image {
grid-row: 1 / span 2;
}
.mentions-image > img {
border: var(--fg) solid 1px;
}

.mentions-container .emoji {
font-size: 1.5rem;
}

.mentions-name {
font-size: 1.25rem;
text-decoration: unset;
}

.mentions-name:hover {
text-decoration: underline;
}

.emo-rel {
display: inline-grid;
align-items: center;
grid-template-columns: 2rem auto;
grid-column-gap: 0.25rem;
}

.mentions-listing {
display: inline;
background-color: var(--bg);
padding: var(--size--1);
font-size: 92%;
border-radius: var(--common-radius);
border: var(--size--4) solid var(--bg-status);
user-select: all;
font-size: var(--size--1);
overflow-x: auto;
width: 24rem;
}

section > header {
background: var(--bg);
color: var(--fg-status);
Expand All @@ -352,6 +451,10 @@ section > header {
flex-grow: 1;
}

.author-action > a {
text-decoration: underline;
}

section > header > div {
display: flex;
justify-content: space-between;
Expand All @@ -371,6 +474,7 @@ section header span {
section header .author > a:first-child {
margin-left: 0;
color: var(--fg-light);
font-weight: bold;
}

/*
Expand Down Expand Up @@ -400,6 +504,7 @@ section > .centered-footer {

section > footer {
color: var(--fg-status);
margin-top: var(--size-0);
}

section > footer br {
Expand All @@ -415,6 +520,10 @@ section > footer > div > * {
text-decoration: none;
}

section > footer > div > form > button:first-of-type {
font-size: 100%;
}

section > footer > div > form > button.liked {
color: var(--red);
}
Expand Down