diff --git a/KNOWLEDGE_BASE.md b/KNOWLEDGE_BASE.md index 4cf327f296..9def54b83c 100644 --- a/KNOWLEDGE_BASE.md +++ b/KNOWLEDGE_BASE.md @@ -20,6 +20,7 @@ This file documents the platform's features, stack, and stories. Feature entries - [Following, Latest, and Trending logs](#following-latest-and-trending-logs) - [Searching developers, organizations, and commits](#searching-developers-organizations-and-commits) - [Writing commits](#writing-commits) + - [Contributor requests](#contributor-requests) - [Translating commits](#translating-commits) - [Code, emoji, and mentions](#code-emoji-and-mentions) - [Draft previews](#draft-previews) @@ -229,6 +230,16 @@ Sources: [search page](resources/js/pages/search/index.tsx), [commit search quer Livestream history: the team agreed to build semantic search on [day two at 2:57:59](https://www.youtube.com/watch?v=nfmVdXZfzUE&t=10679s). The discussion connects immutable commits with simpler embeddings: editing would require re-embedding, versioning, and reconsidering notifications. At the time they deferred editing and versioning “for now”; the decision is now final: commit editing will never be added. +### Contributor requests + +The **Help wanted** board at `/help-wanted` lists requests for coding, testing, documentation, design, or feedback on GitHub projects. Guests can read approved requests. Filter by kind and open, filled, or all requests; pages contain up to 12 items, newest first. + +Signed-in developers post a request at `/help-wanted/create` with a description and an HTTPS `github.com/owner/repository` or issue URL. The description and project link become an ordinary immutable commit, subject to the same commit validation, rules acceptance, shared posting rate limit, timeouts, moderation, mutes, and blocks. Pending or rejected requests are visible only to their author on the board. Linking a project does not establish ownership or verify its visibility on GitHub. Replies use the normal commit thread. + +Only the author can mark a request filled or reopen it. Its description, kind, and project link cannot be edited. Deleting its commit hides the request; deleting the account removes its request records. Private JSON exports include the account's request metadata in schema version 10. + +The JSON API exposes `GET /api/v1/help-wanted` with optional `kind` and `status` filters, and signed `POST /api/v1/help-wanted` and `PUT /api/v1/help-wanted/{contributorRequest}` for creation and status changes. These use the same validation, visibility, and ownership rules as the web. + ### Writing commits A **commit** is a post on /dev/null, not a Git commit in a repository. Open the composer or press **c**, write your update, and choose **Commit** or press **⌘/Ctrl+Enter**. Text-only commits accept 1–4,000 characters; as you type, the ring around your avatar in the composer fills toward that limit. On the web and in the app, an image attachment makes the text optional (terminal commits still need text), but the 4,000-character maximum still applies. Runs of blank lines outside code collapse to one before the length is checked. Lists fold posts longer than 280 characters or 8 lines behind **Show more**. When a commit starts with a code block too long to fit, its first lines fade out to show that the code continues. **Show more** reveals the full snippet, and the copy control copies the whole block even while folded. Commits can be created and deleted, but not edited after publication. There are no plans to add commit editing, and it will never be added: to change a commit, delete it and post a new one. diff --git a/PRODUCT.md b/PRODUCT.md index c0fc1d6156..870c435bea 100644 --- a/PRODUCT.md +++ b/PRODUCT.md @@ -33,6 +33,7 @@ What exists, one line each (details in the knowledge base): - **Commits:** text with code, images, link cards and embedded players, or a poll; replies, quotes, threads, scheduling, translation. - **Logs:** Following, Latest, and Trending. +- **Help wanted:** public contributor requests for GitHub projects, grouped by the kind of help needed, with owner-managed open and filled status. - **Engagement:** follows, stars, saved commits, pins, mentions, and pastéis (an opt-in daily allowance of pastries). - **Profiles:** mirrored from GitHub, with an activity graph, streaks, achievements, a Unix rank, and a live marker while you stream on YouTube. - **Link pages:** every https link has a page listing the commits that use it as their card; once two people talk about a link, its cards and commit pages lead there. diff --git a/app/Actions/CreateContributorRequest.php b/app/Actions/CreateContributorRequest.php new file mode 100644 index 0000000000..65923ca9df --- /dev/null +++ b/app/Actions/CreateContributorRequest.php @@ -0,0 +1,26 @@ +commits->handle($user, $body, linkPreview: false); + + return ContributorRequest::query()->create([ + 'user_id' => $user->id, 'commit_id' => $commit->id, 'project_url' => $projectUrl, 'kind' => $kind, + ]); + }); + } +} diff --git a/app/Actions/CreateExport.php b/app/Actions/CreateExport.php index 26ff673e4a..d14472d800 100644 --- a/app/Actions/CreateExport.php +++ b/app/Actions/CreateExport.php @@ -9,6 +9,7 @@ use App\Models\Commit; use App\Models\CommitImage; use App\Models\CommitReport; +use App\Models\ContributorRequest; use App\Models\Conversation; use App\Models\ConversationParticipant; use App\Models\Device; @@ -43,6 +44,7 @@ * schema_version: int, * exported_at: string, * profile: array, + * contributor_requests: Generator, * active_days: Generator, * commits: Generator>, * organization_commits: Generator>, @@ -86,7 +88,7 @@ public function handle(User $user): array { return [ - 'schema_version' => 9, + 'schema_version' => 10, 'exported_at' => now()->toIso8601String(), 'profile' => [ 'github_id' => $user->github_id, @@ -128,6 +130,7 @@ public function handle(User $user): array 'updated_at' => $user->updated_at->toIso8601String(), ], 'active_days' => $this->activeDays($user), + 'contributor_requests' => $this->contributorRequests($user), 'commits' => $this->commits($user), 'organization_commits' => $this->organizationCommits($user), 'polls' => $this->polls($user), @@ -226,6 +229,20 @@ public function handle(User $user): array ]; } + /** + * @return Generator + */ + private function contributorRequests(User $user): Generator + { + foreach (ContributorRequest::query()->where('user_id', $user->id)->oldest()->oldest('id')->cursor() as $item) { + yield [ + 'commit_id' => $item->commit_id, 'project_url' => $item->project_url, + 'kind' => $item->kind->value, 'status' => $item->status->value, + 'filled_at' => $item->filled_at?->toIso8601String(), 'created_at' => $item->created_at->toIso8601String(), + ]; + } + } + /** * @return Generator> */ diff --git a/app/Actions/UpdateContributorRequest.php b/app/Actions/UpdateContributorRequest.php new file mode 100644 index 0000000000..b10c620d25 --- /dev/null +++ b/app/Actions/UpdateContributorRequest.php @@ -0,0 +1,21 @@ +whereKey($request->id)->where('status', '!=', $status)->update([ + 'status' => $status, + 'filled_at' => $status === ContributorRequestStatus::Filled ? now() : null, + ]); + $request->refresh(); + } +} diff --git a/app/Enums/ContributorHelp.php b/app/Enums/ContributorHelp.php new file mode 100644 index 0000000000..a314a1f912 --- /dev/null +++ b/app/Enums/ContributorHelp.php @@ -0,0 +1,19 @@ +value); + } +} diff --git a/app/Enums/ContributorRequestStatus.php b/app/Enums/ContributorRequestStatus.php new file mode 100644 index 0000000000..b716c4ae7b --- /dev/null +++ b/app/Enums/ContributorRequestStatus.php @@ -0,0 +1,11 @@ +builder( + $user, $request->enum('kind', ContributorHelp::class), $request->string('status', 'open')->value(), + )->paginate(12)->withQueryString()); + } + + public function store(CreateContributorRequestRequest $request, #[CurrentUser] User $user, CreateContributorRequest $action, ContributorRequestsQuery $requests): JsonResponse + { + $item = $action->handle($user, $request->string('body')->value(), $request->string('project_url')->value(), ContributorHelp::from($request->string('kind')->value())); + + return ContributorRequestResource::make($requests->builder($user, status: 'all')->findOrFail($item->id))->response()->setStatusCode(201); + } + + public function update(UpdateContributorRequestRequest $request, #[CurrentUser] User $user, ContributorRequest $contributorRequest, UpdateContributorRequest $action, ContributorRequestsQuery $requests): ContributorRequestResource + { + $action->handle($contributorRequest, ContributorRequestStatus::from($request->string('status')->value())); + + return ContributorRequestResource::make($requests->builder($user, status: 'all')->findOrFail($contributorRequest->id)); + } +} diff --git a/app/Http/Controllers/ContributorRequestController.php b/app/Http/Controllers/ContributorRequestController.php new file mode 100644 index 0000000000..de99b9444a --- /dev/null +++ b/app/Http/Controllers/ContributorRequestController.php @@ -0,0 +1,60 @@ +enum('kind', ContributorHelp::class); + $status = $request->string('status', 'open')->value(); + + return Inertia::render('contributor-request/index', [ + 'requests' => $requests->builder($user, $kind, $status)->paginate(12)->withQueryString() + ->through(fn (ContributorRequest $item): array => ContributorRequestResource::make($item)->resolve($request)), + 'filters' => ['kind' => $kind?->value, 'status' => $status], + ]); + } + + public function create(): Response + { + return Inertia::render('contributor-request/create'); + } + + public function store(CreateContributorRequestRequest $request, #[CurrentUser] User $user, CreateContributorRequest $action): RedirectResponse + { + $item = $action->handle($user, $request->string('body')->value(), $request->string('project_url')->value(), ContributorHelp::from($request->string('kind')->value())); + $pending = $item->commit?->status === CommitStatus::Pending; + Inertia::flash('toast', ['type' => $pending ? 'info' : 'success', 'message' => $pending + ? 'Request posted. Only you can see it until moderation approves it.' : 'Contributor request posted.']); + + return to_route('contributor-request.index'); + } + + public function update(UpdateContributorRequestRequest $request, ContributorRequest $contributorRequest, UpdateContributorRequest $action): RedirectResponse + { + $action->handle($contributorRequest, ContributorRequestStatus::from($request->string('status')->value())); + Inertia::flash('toast', ['type' => 'success', 'message' => $contributorRequest->status === ContributorRequestStatus::Filled ? 'Request marked as filled.' : 'Request reopened.']); + + return back(); + } +} diff --git a/app/Http/Middleware/ThrottleCommits.php b/app/Http/Middleware/ThrottleCommits.php index ddaed07333..b351cd1a36 100644 --- a/app/Http/Middleware/ThrottleCommits.php +++ b/app/Http/Middleware/ThrottleCommits.php @@ -49,7 +49,7 @@ private function slowDown(Request $request, int $retryAfter): Response } // The mobile app reads JSON with a code... - if ($request->routeIs('api-commit.store')) { + if ($request->routeIs('api-commit.store', 'api-contributor-request.store')) { return new ApiException(ApiErrorCode::RateLimited, $message, ['Retry-After' => $retryAfter])->render(); } diff --git a/app/Http/Requests/CreateContributorRequestRequest.php b/app/Http/Requests/CreateContributorRequestRequest.php new file mode 100644 index 0000000000..73398bf103 --- /dev/null +++ b/app/Http/Requests/CreateContributorRequestRequest.php @@ -0,0 +1,41 @@ +input('project_url'); + + // The project link also belongs in the immutable commit, including in ordinary logs and threads. + if (is_string($url) && mb_strlen($url) <= 255 && is_string($this->input('body')) && mb_trim($this->string('body')->value()) !== '') { + $this->merge(['body' => $this->string('body')->value()."\n\n".mb_trim($url), 'project_url' => mb_trim($url)]); + } + } + + /** @return array> */ + public function rules(): array + { + return [ + 'body' => CreateCommitRequest::bodyRules(), + 'project_url' => ['required', 'string', 'max:255', 'regex:~\Ahttps://github\.com/[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}/(?!\.{1,2}(?:/|$))[a-z\d_.-]+(?:/issues/[1-9]\d*)?/?\z~i'], + 'kind' => ['required', Rule::enum(ContributorHelp::class)], + ]; + } +} diff --git a/app/Http/Requests/ListContributorRequestsRequest.php b/app/Http/Requests/ListContributorRequestsRequest.php new file mode 100644 index 0000000000..5f62543dfa --- /dev/null +++ b/app/Http/Requests/ListContributorRequestsRequest.php @@ -0,0 +1,28 @@ +> */ + public function rules(): array + { + return [ + 'kind' => ['nullable', Rule::enum(ContributorHelp::class)], + 'status' => ['sometimes', 'required', Rule::in(['open', 'filled', 'all'])], + ]; + } +} diff --git a/app/Http/Requests/UpdateContributorRequestRequest.php b/app/Http/Requests/UpdateContributorRequestRequest.php new file mode 100644 index 0000000000..9eb64339e4 --- /dev/null +++ b/app/Http/Requests/UpdateContributorRequestRequest.php @@ -0,0 +1,29 @@ +route('contributorRequest'); + $user = $this->user(); + + return $item instanceof ContributorRequest && $user instanceof User && $item->user_id === $user->id && $item->commit !== null; + } + + /** @return array> */ + public function rules(): array + { + return ['status' => ['required', Rule::enum(ContributorRequestStatus::class)]]; + } +} diff --git a/app/Http/Resources/ContributorRequestResource.php b/app/Http/Resources/ContributorRequestResource.php new file mode 100644 index 0000000000..9f4563c18f --- /dev/null +++ b/app/Http/Resources/ContributorRequestResource.php @@ -0,0 +1,27 @@ + */ + public function toArray(Request $request): array + { + $viewer = $request->user(); + + return [ + 'id' => $this->id, 'project_url' => $this->project_url, 'kind' => $this->kind, + 'status' => $this->status, 'filled_at' => $this->filled_at?->toIso8601ZuluString(), + 'can_manage' => $viewer instanceof User && $this->user_id === $viewer->id, + 'commit' => ShownStreams::commit($this->commit), + ]; + } +} diff --git a/app/Models/ContributorRequest.php b/app/Models/ContributorRequest.php new file mode 100644 index 0000000000..cc64bf2358 --- /dev/null +++ b/app/Models/ContributorRequest.php @@ -0,0 +1,60 @@ + */ + use HasFactory; + + use HasUuids; + + /** @var array */ + protected $attributes = ['status' => 'open', 'filled_at' => null]; + + /** @return array */ + public function casts(): array + { + return [ + 'id' => 'string', 'user_id' => 'string', 'commit_id' => 'string', 'project_url' => 'string', + 'kind' => ContributorHelp::class, 'status' => ContributorRequestStatus::class, + 'filled_at' => 'datetime', 'created_at' => 'datetime', 'updated_at' => 'datetime', + ]; + } + + /** @return BelongsTo */ + public function commit(): BelongsTo + { + return $this->belongsTo(Commit::class); + } + + /** @return BelongsTo */ + public function user(): BelongsTo + { + return $this->belongsTo(User::class); + } +} diff --git a/app/Queries/ContributorRequestsQuery.php b/app/Queries/ContributorRequestsQuery.php new file mode 100644 index 0000000000..7c395e567f --- /dev/null +++ b/app/Queries/ContributorRequestsQuery.php @@ -0,0 +1,27 @@ + */ + public function builder(?User $viewer, ?ContributorHelp $kind = null, string $status = 'open'): Builder + { + return ContributorRequest::query() + ->whereHas('commit', fn (CommitBuilder $query): CommitBuilder => $query->visibleTo($viewer)->withoutMutedAuthorsFor($viewer)) + ->when($kind, fn (Builder $query): Builder => $query->where('kind', $kind)) + ->when($status !== 'all', fn (Builder $query): Builder => $query->where('status', $status)) + ->with(['commit' => function (BelongsTo $relation) use ($viewer): void { + $relation->getQuery()->withCardDataFor($viewer)->withVisibleReplyCount($viewer); + }]) + ->latest()->latest('id'); + } +} diff --git a/database/factories/ContributorRequestFactory.php b/database/factories/ContributorRequestFactory.php new file mode 100644 index 0000000000..515acc2325 --- /dev/null +++ b/database/factories/ContributorRequestFactory.php @@ -0,0 +1,29 @@ + */ +final class ContributorRequestFactory extends Factory +{ + /** @return array */ + public function definition(): array + { + return [ + 'user_id' => User::factory(), + 'commit_id' => fn (array $attributes): string => Commit::factory()->for(User::query()->whereKey($attributes['user_id'])->firstOrFail())->create()->id, + 'project_url' => 'https://github.com/example/project', + 'kind' => ContributorHelp::Testing, + 'status' => ContributorRequestStatus::Open, + 'filled_at' => null, + ]; + } +} diff --git a/database/migrations/2026_11_19_120000_create_contributor_requests_table.php b/database/migrations/2026_11_19_120000_create_contributor_requests_table.php new file mode 100644 index 0000000000..fc8e07504d --- /dev/null +++ b/database/migrations/2026_11_19_120000_create_contributor_requests_table.php @@ -0,0 +1,27 @@ +uuid('id')->primary(); + $table->foreignUuid('user_id')->constrained()->cascadeOnDelete(); + $table->foreignUuid('commit_id')->unique()->constrained()->cascadeOnDelete(); + $table->string('project_url', 255); + $table->string('kind', 20); + $table->string('status', 20)->default('open'); + $table->timestamp('filled_at')->nullable(); + $table->timestamps(); + $table->index('user_id'); + $table->index(['status', 'created_at', 'id']); + $table->index(['status', 'kind', 'created_at', 'id']); + }); + } +}; diff --git a/resources/js/components/app-nav.tsx b/resources/js/components/app-nav.tsx index 8164fd9b91..4805967ead 100644 --- a/resources/js/components/app-nav.tsx +++ b/resources/js/components/app-nav.tsx @@ -5,6 +5,7 @@ import { Star, GitCommitVertical, History, + HandHelping, MessagesSquare, PanelLeftClose, PanelLeftOpen, @@ -17,6 +18,7 @@ import { } from 'lucide-react'; import type { ReactElement, ReactNode } from 'react'; import { useEffect, useLayoutEffect, useRef, useState } from 'react'; +import ContributorRequestController from '@/actions/App/Http/Controllers/ContributorRequestController'; import ConversationController from '@/actions/App/Http/Controllers/ConversationController'; import { index as guildIndex } from '@/actions/App/Http/Controllers/GuildController'; import LogController from '@/actions/App/Http/Controllers/LogController'; @@ -111,6 +113,11 @@ function useNavItems(): (NavItem & { isActive: boolean })[] { href: hrefFor((user) => show(user)), icon: UserRound, }, + { + title: 'Help wanted', + href: ContributorRequestController.index(), + icon: HandHelping, + }, { title: 'Starred', href: hrefFor(() => StarredCommitController.index()), @@ -566,7 +573,9 @@ export function MobileNav({ children }: { children?: ReactNode }) { const [isChangelogOpen, setIsChangelogOpen] = useState(false); const allItems = useNavItems(); const menuItems = allItems.filter((item) => - ['Profile', 'Settings', 'Operations', 'Guilds'].includes(item.title), + ['Profile', 'Settings', 'Operations', 'Guilds', 'Help wanted'].includes( + item.title, + ), ); const items = allItems.filter( (item) => diff --git a/resources/js/components/user-menu-content.tsx b/resources/js/components/user-menu-content.tsx index a2e58bf97b..38abbc5e0e 100644 --- a/resources/js/components/user-menu-content.tsx +++ b/resources/js/components/user-menu-content.tsx @@ -6,6 +6,7 @@ import { Star, FileText, HeartHandshake, + HandHelping, LogOut, Settings, Shield, @@ -13,6 +14,7 @@ import { } from 'lucide-react'; import AboutController from '@/actions/App/Http/Controllers/AboutController'; import AppController from '@/actions/App/Http/Controllers/AppController'; +import ContributorRequestController from '@/actions/App/Http/Controllers/ContributorRequestController'; import OperationsController from '@/actions/App/Http/Controllers/OperationsController'; import PartnerController from '@/actions/App/Http/Controllers/PartnerController'; import PrivacyController from '@/actions/App/Http/Controllers/PrivacyController'; @@ -58,6 +60,16 @@ export function UserMenuContent({ user }: Props) { + + + + Help wanted + + + +
+ + + +

Post a contributor request

+
+
+
+ + + +
+

+ A clear ask goes a long way. +

+

+ Tell developers what you’re building and how they + can help. Replies stay in the normal commit thread. +

+
+
+
+ {({ processing, errors }) => ( + <> +
+ + +

+ Link a public repository or an issue. The + link will also appear in your commit. + Linking a project does not imply ownership. +

+ +
+
+ + + +
+
+ +