Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
cache: "npm"

- name: Cache Playwright browsers
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }}
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,9 @@ logs/
.claude/
.cursor/
.aider*

# Local MCP server config (may hold personal API keys)
.mcp.json

# Written by `next dev`
AGENTS.md
27 changes: 0 additions & 27 deletions .mcp.json

This file was deleted.

36 changes: 0 additions & 36 deletions E2E Overview.md

This file was deleted.

7 changes: 1 addition & 6 deletions app/(admin)/admin/_client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ import {
import { api } from "@/server/trpc/react";

type StatTone =
| "accent"
| "success"
| "warning"
| "danger"
| "info"
| "neutral";
"accent" | "success" | "warning" | "danger" | "info" | "neutral";

const toneClasses: Record<StatTone, string> = {
accent: "bg-accent/10 text-accent",
Expand Down
127 changes: 122 additions & 5 deletions app/(admin)/admin/moderation/_client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,30 @@ const ModerationQueue = () => {
},
});

// System (auto-flagged) reports live in their own table with their own ids,
// so they are dismissed through a separate mutation from member reports.
const { mutate: dismissSystemReport, isPending: isDismissingSystem } =
api.report.dismissSystem.useMutation({
onSuccess: () => {
toast.success("Report dismissed");
utils.admin.listReportedPosts.invalidate();
utils.admin.listFlaggedComments.invalidate();
utils.report.getCounts.invalidate();
},
onError: () => {
toast.error("Failed to dismiss report");
},
});

// Auto-moderation queue (posts awaiting review).
const inReview = api.admin.listInReview.useQuery();

// Live posts that have been flagged by users (open reports on published posts).
// Live posts with open reports, from members or the nightly review.
const reportedPosts = api.admin.listReportedPosts.useQuery();

// Comments flagged by the nightly review.
const flaggedComments = api.admin.listFlaggedComments.useQuery();

const { mutate: moderatePost, isPending: isModerating } =
api.admin.moderatePost.useMutation({
onSuccess: (_data, variables) => {
Expand Down Expand Up @@ -167,14 +185,18 @@ const ModerationQueue = () => {
};

// Dismiss all open reports for a reported-live post (the post stays published).
const handleDismissReportedPost = (reportIds: number[]) => {
const handleDismissReportedPost = (
reportIds: number[],
systemReportIds: number[],
) => {
reportIds.forEach((reportId) =>
reviewReport({
reportId,
status: "DISMISSED",
actionTaken: "Reports dismissed by admin",
}),
);
systemReportIds.forEach((reportId) => dismissSystemReport({ reportId }));
utils.admin.listReportedPosts.invalidate();
};

Expand Down Expand Up @@ -373,7 +395,7 @@ const ModerationQueue = () => {
</div>
</section>

{/* Reported (live) — published posts users have flagged */}
{/* Reported (live) — published posts flagged by users or the nightly review */}
<section className="card mb-8 p-5">
<div className="mb-4 flex items-center justify-between">
<p className="eyebrow m-0">
Expand Down Expand Up @@ -427,6 +449,11 @@ const ModerationQueue = () => {
{reasonLabels[post.latestReason as ReportReason] ??
post.latestReason}
</span>
{post.systemReportIds.length > 0 && (
<span className={`${chipBase} bg-info/12 text-info`}>
Auto-flagged
</span>
)}
{post.latestDetails && (
<span className="text-sm text-muted">
{post.latestDetails}
Expand Down Expand Up @@ -457,8 +484,98 @@ const ModerationQueue = () => {
</button>
<button
className="secondary-button px-3 py-1.5 text-sm"
disabled={isReviewing}
onClick={() => handleDismissReportedPost(post.reportIds)}
disabled={isReviewing || isDismissingSystem}
onClick={() =>
handleDismissReportedPost(
post.reportIds,
post.systemReportIds,
)
}
>
<XCircleIcon className="h-4 w-4" />
Dismiss
</button>
</div>
</div>
</div>
))}
</div>
</section>

{/* Flagged comments — comments the nightly review has auto-flagged */}
<section className="card mb-8 p-5">
<div className="mb-4 flex items-center justify-between">
<p className="eyebrow m-0">
<span className="slash">{"// "}</span>flagged comments
</p>
<span className="bg-danger/12 rounded-full px-2 py-0.5 font-mono text-xs text-danger">
{flaggedComments.data?.length ?? 0} flagged
</span>
</div>

{flaggedComments.isLoading && (
<p className="font-mono text-xs text-faint">Loading…</p>
)}

{!flaggedComments.isLoading &&
(flaggedComments.data?.length ?? 0) === 0 && (
<p className="font-mono text-xs text-faint">
{"// no flagged comments"}
</p>
)}

<div className="space-y-3">
{flaggedComments.data?.map((comment) => (
<div
key={comment.reportId}
className="border-b border-hairline pb-3 last:border-0 last:pb-0"
>
<div className="flex flex-wrap items-start justify-between gap-3">
<div className="min-w-0">
<p className="line-clamp-3 text-fg">{comment.body}</p>
<p className="font-mono text-xs text-faint">
@{comment.authorUsername ?? "unknown"} on{" "}
{comment.parentTitle || "Untitled"} ·{" "}
{getRelativeTime(comment.reportedAt)}
{comment.isDeleted ? " · deleted" : ""}
</p>
<div className="mt-1 flex flex-wrap items-center gap-2">
<span
className={`${chipBase} ${
reasonColors[comment.reason as ReportReason] ??
"border border-hairline text-muted"
}`}
>
{reasonLabels[comment.reason as ReportReason] ??
comment.reason}
</span>
<span className={`${chipBase} bg-info/12 text-info`}>
Auto-flagged
</span>
{comment.details && (
<span className="text-sm text-muted">
{comment.details}
</span>
)}
</div>
</div>
<div className="flex shrink-0 flex-wrap gap-2">
{comment.href && (
<Link
href={comment.href}
target="_blank"
className="secondary-button px-3 py-1.5 text-sm"
>
<ArrowTopRightOnSquareIcon className="h-4 w-4" />
View
</Link>
)}
<button
className="secondary-button px-3 py-1.5 text-sm"
disabled={isDismissingSystem}
onClick={() =>
dismissSystemReport({ reportId: comment.reportId })
}
>
<XCircleIcon className="h-4 w-4" />
Dismiss
Expand Down
18 changes: 9 additions & 9 deletions app/(app)/(tsandcs)/privacy/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Want to learn more about what we do with any information we collect? Review the

**Personal information you disclose to us**

***In Short:*** *We collect personal information that you provide to us.*
**_In Short:_** _We collect personal information that you provide to us._

We collect personal information that you voluntarily provide to us when you register on the Services, express an interest in obtaining information about us or our products and Services, when you participate in activities on the Services, or otherwise when you contact us.

Expand Down Expand Up @@ -110,7 +110,7 @@ All personal information that you provide to us must be true, complete, and accu

**2\. HOW DO WE PROCESS YOUR INFORMATION?**

***In Short:*** *We process your information to provide, improve, and administer our Services, communicate with you, for security and fraud prevention, and to comply with law. We may also process your information for other purposes with your consent.*
**_In Short:_** _We process your information to provide, improve, and administer our Services, communicate with you, for security and fraud prevention, and to comply with law. We may also process your information for other purposes with your consent._

**We process your personal information for a variety of reasons, depending on how you interact with our Services, including:**

Expand Down Expand Up @@ -172,7 +172,7 @@ In some exceptional cases, we may be legally permitted under applicable law to p

**4\. WHEN AND WITH WHOM DO WE SHARE YOUR PERSONAL INFORMATION?**

***In Short:*** *We may share information in specific situations described in this section and/or with the following third parties.*
**_In Short:_** _We may share information in specific situations described in this section and/or with the following third parties._

We may need to share your personal information in the following situations:

Expand All @@ -182,35 +182,35 @@ We may need to share your personal information in the following situations:

**5\. HOW DO WE HANDLE YOUR SOCIAL LOGINS?**

***In Short:*** *If you choose to register or log in to our Services using a social media account, we may have access to certain information about you.*
**_In Short:_** _If you choose to register or log in to our Services using a social media account, we may have access to certain information about you._

Our Services offer you the ability to register and log in using your third-party social media account details (like your Facebook or Twitter logins). Where you choose to do this, we will receive certain profile information about you from your social media provider. The profile information we receive may vary depending on the social media provider concerned, but will often include your name, email address, friends list, and profile picture, as well as other information you choose to make public on such a social media platform.

We will use the information we receive only for the purposes that are described in this privacy notice or that are otherwise made clear to you on the relevant Services. Please note that we do not control, and are not responsible for, other uses of your personal information by your third-party social media provider. We recommend that you review their privacy notice to understand how they collect, use, and share your personal information, and how you can set your privacy preferences on their sites and apps.

**6\. HOW LONG DO WE KEEP YOUR INFORMATION?**

***In Short:*** *We keep your information for as long as necessary to fulfill the purposes outlined in this privacy notice unless otherwise required by law.*
**_In Short:_** _We keep your information for as long as necessary to fulfill the purposes outlined in this privacy notice unless otherwise required by law._

We will only keep your personal information for as long as it is necessary for the purposes set out in this privacy notice, unless a longer retention period is required or permitted by law (such as tax, accounting, or other legal requirements). No purpose in this notice will require us keeping your personal information for longer than the period of time in which users have an account with us.

When we have no ongoing legitimate business need to process your personal information, we will either delete or anonymize such information, or, if this is not possible (for example, because your personal information has been stored in backup archives), then we will securely store your personal information and isolate it from any further processing until deletion is possible.

**7\. HOW DO WE KEEP YOUR INFORMATION SAFE?**

***In Short:*** *We aim to protect your personal information through a system of organizational and technical security measures.*
**_In Short:_** _We aim to protect your personal information through a system of organizational and technical security measures._

We have implemented appropriate and reasonable technical and organizational security measures designed to protect the security of any personal information we process. However, despite our safeguards and efforts to secure your information, no electronic transmission over the Internet or information storage technology can be guaranteed to be 100% secure, so we cannot promise or guarantee that hackers, cybercriminals, or other unauthorized third parties will not be able to defeat our security and improperly collect, access, steal, or modify your information. Although we will do our best to protect your personal information, transmission of personal information to and from our Services is at your own risk. You should only access the Services within a secure environment.

**8\. DO WE COLLECT INFORMATION FROM MINORS?**

***In Short:*** *We do not knowingly collect data from or market to children under 18 years of age.*
**_In Short:_** _We do not knowingly collect data from or market to children under 18 years of age._

We do not knowingly solicit data from or market to children under 18 years of age. By using the Services, you represent that you are at least 18 or that you are the parent or guardian of such a minor and consent to such minor dependent’s use of the Services. If we learn that personal information from users less than 18 years of age has been collected, we will deactivate the account and take reasonable measures to promptly delete such data from our records. If you become aware of any data we may have collected from children under age 18, please contact us at niall@codu.co.

**9\. WHAT ARE YOUR PRIVACY RIGHTS?**

***In Short:*** *In some regions, such as the European Economic Area (EEA), United Kingdom (UK), Switzerland, and Canada, you have rights that allow you greater access to and control over your personal information. You may review, change, or terminate your account at any time.*
**_In Short:_** _In some regions, such as the European Economic Area (EEA), United Kingdom (UK), Switzerland, and Canada, you have rights that allow you greater access to and control over your personal information. You may review, change, or terminate your account at any time._

In some regions (like the EEA, UK, Switzerland, and Canada), you have certain rights under applicable data protection laws. These may include the right (i) to request access and obtain a copy of your personal information, (ii) to request rectification or erasure; (iii) to restrict the processing of your personal information; (iv) if applicable, to data portability; and (v) not to be subject to automated decision-making. In certain circumstances, you may also have the right to object to the processing of your personal information. You can make such a request by contacting us by using the contact details provided in the section "HOW CAN YOU CONTACT US ABOUT THIS NOTICE?" below.

Expand Down Expand Up @@ -242,7 +242,7 @@ Most web browsers and some mobile operating systems and mobile applications incl

**11\. DO UNITED STATES RESIDENTS HAVE SPECIFIC PRIVACY RIGHTS?**

***In Short:*** *If you are a resident of California, Colorado, Connecticut, Utah or Virginia, you are granted specific rights regarding access to your personal information.*
**_In Short:_** _If you are a resident of California, Colorado, Connecticut, Utah or Virginia, you are granted specific rights regarding access to your personal information._

**What categories of personal information do we collect?**

Expand Down
1 change: 1 addition & 0 deletions app/(app)/code-of-conduct/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Eyebrow } from "@/components/ds";

export const metadata = {
title: "Code of conduct",
alternates: { canonical: "/code-of-conduct" },
description:
"We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone",
};
Expand Down
8 changes: 1 addition & 7 deletions app/(app)/feed/feedQuery.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
export type FeedSort = "recent" | "trending" | "popular";
export type FeedContentType =
| "ARTICLE"
| "LINK"
| "TIL"
| "QUESTION"
| "VIDEO"
| "DISCUSSION"
| null;
"ARTICLE" | "LINK" | "TIL" | "QUESTION" | "VIDEO" | "DISCUSSION" | null;

export const VALID_FEED_SORTS: FeedSort[] = ["recent", "trending", "popular"];
// Lowercase type values for URL params (converted to uppercase for the API)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Tue, May 21, 2024 • Niall Maher

_Well, right here!_

In case you didn't know, we offer free career mentoring in our Discord every Monday - what I like to call our *Monday Mentor*.
In case you didn't know, we offer free career mentoring in our Discord every Monday - what I like to call our _Monday Mentor_.

We usually do this in the mornings, but starting next week, we will try it from 16:00 (IST).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ I know many folks did this last year, but **I'd love to convince you to try it*

We have a writing challenge over on the Codú site.

**The challenge is simple:** *write six articles in six weeks and receive a mystery swag bag at the end of it!*
**The challenge is simple:** _write six articles in six weeks and receive a mystery swag bag at the end of it!_

Share your knowledge, experiences, and opinions on web development, from cutting-edge technologies to industry best practices.

Expand All @@ -35,7 +35,7 @@ So, are you ready to start?
3. Post your articles in the channel created for the challenge **#🎖-codu-writing-challenge**.
4. Write (at least) one article a week for 6 weeks. Once you write your 6th article, we will send you a form on Discord to fill in to claim your swag.

*Note: Our editor is in beta, so there may be bugs! Please let us know if you are struggling with anything in* ***#🐞-codu-website-feedback*** *or with any features you'd like added.*
_Note: Our editor is in beta, so there may be bugs! Please let us know if you are struggling with anything in_ **_#🐞-codu-website-feedback_** _or with any features you'd like added._

And now, back to my usual collection of things from the web:

Expand Down
Loading
Loading