-
Notifications
You must be signed in to change notification settings - Fork 38
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
✨ Pass queue config to the server query when fetching statuses #263
Changes from all commits
0306a9a
2101f54
fb56422
ca939fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,9 @@ export const LocalPreferences = () => { | |
<p className="text-sm mb-2"> | ||
You can choose to make media content (video and image) with the | ||
following labels appear on your screen with your preferred filter. | ||
<br /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not related to the PR but adding additional clarification as requested by mods. |
||
This is your personal configuration and won{"'"}t be shared with other | ||
moderators. | ||
</p> | ||
|
||
<form onSubmit={handleSubmit}> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,9 @@ export const ExternalLabelerConfig = () => { | |
subscriptions there. | ||
</p> | ||
<p className="mt-1 text-sm text-gray-900 dark:text-gray-200"> | ||
You can unsubscribe from any external labeler at any time. | ||
You can unsubscribe from any external labeler at any time. This is | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not related to the PR but adding additional clarification as requested by mods. |
||
your personal configuration and won{"'"}t be shared with other | ||
moderators. | ||
</p> | ||
|
||
<div className="flex flex-row justify-end items-end my-3 gap-2"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,38 @@ const LinkToAuthor = ({ | |
) | ||
} | ||
|
||
// Utility function to detect and replace links with <a> tags | ||
const wrapLinksInText = (text: string): JSX.Element[] => { | ||
// Regular expression to match URLs | ||
const urlRegex = /(https?:\/\/[^\s]+)/g | ||
|
||
// Split text into parts, with URLs as matches | ||
const parts = text.split(urlRegex) | ||
|
||
return parts.map((part, index) => { | ||
Comment on lines
+40
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The parts matching the regex wont be included in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my regex-foo is not good at all but stackoverflow said wrapping it in parentheses makes it a capture group which is why the matches will be included in the returned array. |
||
if (urlRegex.test(part)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Global ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For example: const regex = /a/g
regex.test('a') // true
regex.test('a') // false There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. again, not sure how accurate I am with this but it seems to be only an issue when applied to same string and since we're applying it on different |
||
// If part matches a URL, return it as a link | ||
return ( | ||
<a | ||
key={index} | ||
href={part} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
className="break-all underline" | ||
> | ||
{part} | ||
</a> | ||
) | ||
} | ||
// Otherwise, return it as plain text | ||
return <span key={index}>{part}</span> | ||
}) | ||
} | ||
|
||
const TextWithLinks: React.FC<{ text: string }> = ({ text }) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not related to the PR but mods reported that sometimes they leave links to verification/investigation content and the links always cause the layout to break. This is basically looking for links in comment and making sure they are used wrapped in a tag and wraps the text properly to next line. |
||
return <p className="whitespace-pre-wrap">{wrapLinksInText(text)}</p> | ||
} | ||
|
||
const Comment = ({ | ||
modEvent, | ||
}: { | ||
|
@@ -60,7 +92,9 @@ const Comment = ({ | |
)} | ||
</div> | ||
</div> | ||
{modEvent.event.comment && <p>{modEvent.event.comment}</p>} | ||
{modEvent.event.comment && ( | ||
<TextWithLinks text={modEvent.event.comment} /> | ||
)} | ||
{/* This is only for legacy actions, new actions won't have these properties for these events */} | ||
<EventLabels | ||
header="Added: " | ||
|
@@ -141,7 +175,7 @@ const Report = ({ | |
</div> | ||
</div> | ||
{modEvent.event.comment && ( | ||
<p className="mt-1">{modEvent.event.comment}</p> | ||
<TextWithLinks text={modEvent.event.comment} /> | ||
)} | ||
|
||
{isMessageSubject(modEvent.subject) && ( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,15 @@ | |
# yarn lockfile v1 | ||
|
||
|
||
"@atproto/api@^0.13.19": | ||
version "0.13.19" | ||
resolved "https://registry.yarnpkg.com/@atproto/api/-/api-0.13.19.tgz#a3b47847bfe00d3f83da2bd3f6dc5566f43887b0" | ||
integrity sha512-rLWQBZaOIk3ds1Fx9CwrdyX3X2GbdSEvVJ9mdSPNX40joiEaE1ljGMOcziFipbvZacXynozE4E0Sb1CgOhzfmA== | ||
"@atproto/api@^0.13.23": | ||
version "0.13.23" | ||
resolved "https://registry.yarnpkg.com/@atproto/api/-/api-0.13.23.tgz#f65d0d7946afa4ca467b7763b056f0824432bcf6" | ||
integrity sha512-V1Z5kgfSsqlFaC14sjnZL1Psv/9Lq/YKW1w7TIBq948Rtq8l+c6BpGrOH2Ssdcphpqi4OSeSYRsmJJlD6GGJ5w== | ||
dependencies: | ||
"@atproto/common-web" "^0.3.1" | ||
"@atproto/lexicon" "^0.4.3" | ||
"@atproto/lexicon" "^0.4.4" | ||
"@atproto/syntax" "^0.3.1" | ||
"@atproto/xrpc" "^0.6.4" | ||
"@atproto/xrpc" "^0.6.5" | ||
await-lock "^2.2.2" | ||
multiformats "^9.9.0" | ||
tlds "^1.234.0" | ||
|
@@ -36,10 +36,10 @@ | |
pino "^8.6.1" | ||
zod "^3.14.2" | ||
|
||
"@atproto/common@^0.4.4": | ||
version "0.4.4" | ||
resolved "https://registry.yarnpkg.com/@atproto/common/-/common-0.4.4.tgz#79096aef920f5ad7cda5c682d7ed7416d0581e1a" | ||
integrity sha512-58tMbn6A1Zu296s/l3uIj8z9d7IRHpZvLOfsFRikaQaYrzhJpL2aPY4uFQ8GJcxnsxeUnxBCrQz9we5jVVJI5Q== | ||
"@atproto/common@^0.4.5": | ||
version "0.4.5" | ||
resolved "https://registry.yarnpkg.com/@atproto/common/-/common-0.4.5.tgz#28fd176a9b5527c723828e725586bc0be9fa9516" | ||
integrity sha512-LFAGqHcxCI5+b31Xgk+VQQtZU258iGPpHJzNeHVcdh6teIKZi4C2l6YV+m+3CEz+yYcfP7jjUmgqesx7l9Arsg== | ||
dependencies: | ||
"@atproto/common-web" "^0.3.1" | ||
"@ipld/dag-cbor" "^7.0.3" | ||
|
@@ -77,30 +77,30 @@ | |
"@atproto/crypto" "^0.4.2" | ||
axios "^0.27.2" | ||
|
||
"@atproto/lexicon@^0.4.3": | ||
version "0.4.3" | ||
resolved "https://registry.yarnpkg.com/@atproto/lexicon/-/lexicon-0.4.3.tgz#d69f6bb363a6326df7766c48132bfa30e22622d9" | ||
integrity sha512-lFVZXe1S1pJP0dcxvJuHP3r/a+EAIBwwU7jUK+r8iLhIja+ml6NmYv8KeFHmIJATh03spEQ9s02duDmFVdCoXg== | ||
"@atproto/lexicon@^0.4.4": | ||
version "0.4.4" | ||
resolved "https://registry.yarnpkg.com/@atproto/lexicon/-/lexicon-0.4.4.tgz#0d97314bb57b693b76f2495fa5e02872469dd93a" | ||
integrity sha512-QFEmr3rpj/RoAmfX9ALU/asBG/rsVtQZnw+9nOB1/AuIwoxXd+ZyndR6lVUc2+DL4GEjl6W2yvBru5xbQIZWyA== | ||
dependencies: | ||
"@atproto/common-web" "^0.3.1" | ||
"@atproto/syntax" "^0.3.1" | ||
iso-datestring-validator "^2.2.2" | ||
multiformats "^9.9.0" | ||
zod "^3.23.8" | ||
|
||
"@atproto/[email protected].58": | ||
version "0.1.58" | ||
resolved "https://registry.yarnpkg.com/@atproto/ozone/-/ozone-0.1.58.tgz#578d1cd2d0ce53648c633859f0ea5545971cf583" | ||
integrity sha512-GdW/vZQGsPf3R+p/APPIdxKggfkiHl38+HVfykqxbCTvPKC0jheRXg8I93hsCPNWXg50A2Aei1YEQg15SOCNwQ== | ||
"@atproto/[email protected].62": | ||
version "0.1.62" | ||
resolved "https://registry.yarnpkg.com/@atproto/ozone/-/ozone-0.1.62.tgz#53974547a89edfd2884c05343c2fe06b12c0888f" | ||
integrity sha512-xM/y3elUsjXRWCoffNf5A9BNM2GsodsuvJgLzSTjm4vTsuGz/J821ZMq/09+bGAFq3swB/OCQwXx0h+SkY0CFQ== | ||
dependencies: | ||
"@atproto/api" "^0.13.19" | ||
"@atproto/common" "^0.4.4" | ||
"@atproto/api" "^0.13.23" | ||
"@atproto/common" "^0.4.5" | ||
"@atproto/crypto" "^0.4.2" | ||
"@atproto/identity" "^0.4.3" | ||
"@atproto/lexicon" "^0.4.3" | ||
"@atproto/lexicon" "^0.4.4" | ||
"@atproto/syntax" "^0.3.1" | ||
"@atproto/xrpc" "^0.6.4" | ||
"@atproto/xrpc-server" "^0.7.3" | ||
"@atproto/xrpc" "^0.6.5" | ||
"@atproto/xrpc-server" "^0.7.4" | ||
"@did-plc/lib" "^0.0.1" | ||
axios "^1.6.7" | ||
compression "^1.7.4" | ||
|
@@ -122,15 +122,15 @@ | |
resolved "https://registry.yarnpkg.com/@atproto/syntax/-/syntax-0.3.1.tgz#4346418728f9643d783d2ffcf7c77e132e1f53d4" | ||
integrity sha512-fzW0Mg1QUOVCWUD3RgEsDt6d1OZ6DdFmbKcDdbzUfh0t4rhtRAC05KbZYmxuMPWDAiJ4BbbQ5dkAc/mNypMXkw== | ||
|
||
"@atproto/xrpc-server@^0.7.3": | ||
version "0.7.3" | ||
resolved "https://registry.yarnpkg.com/@atproto/xrpc-server/-/xrpc-server-0.7.3.tgz#d09b36d00edb7aacca48675d1ebb7fa796fa11bd" | ||
integrity sha512-x0qegkN6snrbXJO3v9h2kuh9e90g6ZZkDXv3COiraGS3yRTzIm6i4bMvDSfCI50+0xCNtPKOkpn8taRoRgkyiw== | ||
"@atproto/xrpc-server@^0.7.4": | ||
version "0.7.4" | ||
resolved "https://registry.yarnpkg.com/@atproto/xrpc-server/-/xrpc-server-0.7.4.tgz#dfac8f7276c1c971a35eaba627eb6372088441c3" | ||
integrity sha512-MrAwxfJBQm/kCol3D8qc+vpQzBMzLqvtUbauSSfVVJ10PlGtxg4LlXqcjkAuhrjyrqp3dQH9LHuhDpgVQK+G3w== | ||
dependencies: | ||
"@atproto/common" "^0.4.4" | ||
"@atproto/common" "^0.4.5" | ||
"@atproto/crypto" "^0.4.2" | ||
"@atproto/lexicon" "^0.4.3" | ||
"@atproto/xrpc" "^0.6.4" | ||
"@atproto/lexicon" "^0.4.4" | ||
"@atproto/xrpc" "^0.6.5" | ||
cbor-x "^1.5.1" | ||
express "^4.17.2" | ||
http-errors "^2.0.0" | ||
|
@@ -140,12 +140,12 @@ | |
ws "^8.12.0" | ||
zod "^3.23.8" | ||
|
||
"@atproto/xrpc@^0.6.4": | ||
version "0.6.4" | ||
resolved "https://registry.yarnpkg.com/@atproto/xrpc/-/xrpc-0.6.4.tgz#4cf59774f7c72e5bc821bc5f1d57f0a6ae2014db" | ||
integrity sha512-9ZAJ8nsXTqC4XFyS0E1Wlg7bAvonhXQNQ3Ocs1L1LIwFLXvsw/4fNpIHXxvXvqTCVeyHLbImOnE9UiO1c/qIYA== | ||
"@atproto/xrpc@^0.6.5": | ||
version "0.6.5" | ||
resolved "https://registry.yarnpkg.com/@atproto/xrpc/-/xrpc-0.6.5.tgz#8b180fc5f6b8374fd00c41b9e4cd7b24ead48e6b" | ||
integrity sha512-t6u8iPEVbWge5RhzKZDahSzNDYIAxUtop6Q/X/apAZY1rgreVU0/1sSvvRoRFH19d3UIKjYdLuwFqMi9w8nY3Q== | ||
dependencies: | ||
"@atproto/lexicon" "^0.4.3" | ||
"@atproto/lexicon" "^0.4.4" | ||
zod "^3.23.8" | ||
|
||
"@cbor-extract/[email protected]": | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to the PR but relocating the panels as requested by mods.