Skip to content

Include approved submissions in apps list#48

Merged
ghostleek merged 3 commits intomainfrom
fix/app-submissions
Mar 4, 2026
Merged

Include approved submissions in apps list#48
ghostleek merged 3 commits intomainfrom
fix/app-submissions

Conversation

@ghostleek
Copy link
Copy Markdown
Contributor

This pull request updates how user-submitted apps are handled and displayed in the application, improving both backend logic and user experience. The main change is that user-submitted apps now appear immediately on the user's profile, regardless of approval status, but only appear on the main homepage after being approved. The changes also refactor how apps are combined and surfaced in the API responses.

App display and submission logic updates:

  • User-submitted apps now show immediately on the user's profile, regardless of approval status, by removing the restriction to only join approved submissions in the profile API. The submission status is also included in the profile response for transparency. (api/profile/[slug].tsR95-R99)
  • The homepage now combines official apps with only approved user-submitted apps, transforming submissions to match the official app interface for consistency in display. [1] [2]

Documentation and user flow updates:

  • The user flow documentation clarifies that self-submitted apps appear instantly on personal profiles but require approval to be listed on the main homepage.

Query approved app submissions and merge them with official apps for the public apps response. Adds import for appSubmissions, fetches approved submissions ordered by submittedAt, maps each submission into the existing App shape (sets slug to `ugc-{id}`, isOfficial=false, fills frequency from clickCount, fallback category to 'Other', empty tags, and normalizes timestamps), and combines that list with the official apps (renamed to officialApps). Keeps existing featured/today logic unchanged.
@ghostleek ghostleek requested a review from Copilot March 4, 2026 14:52
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
string-v2 Error Error Mar 21, 2026 3:51pm

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates how user-submitted apps (UGC) are surfaced: they should appear immediately on a user’s profile regardless of approval status, while only approved submissions appear on the homepage/apps directory endpoint. It also updates documentation to reflect the new flow.

Changes:

  • Profile API now joins submitted apps without filtering to approved status and attempts to add submission status to the query result.
  • Apps API now merges official apps with approved submissions by transforming submissions into the same shape as official apps.
  • Documentation updated to describe the new profile vs homepage visibility rules for submissions.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
claude.md Updates documentation of profile/homepage behavior for submitted apps.
api/profile/[slug].ts Removes approved-only join restriction for profile apps and selects submission status.
api/apps.ts Fetches approved submissions, transforms them into “App-like” objects, and merges them into the apps list response.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 92 to +95
submissionLogoUrl: appSubmissions.logoUrl,
submissionDescription: appSubmissions.description,
submissionCategory: appSubmissions.category,
submissionStatus: appSubmissions.status,
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submissionStatus is selected from appSubmissions, but it is never surfaced in the returned apps payload (the submitted-app branch in apps_data does not include it). This means the API response still doesn't expose submission approval status as described in the PR; include the status field in the submitted app objects (and consider naming it consistently, e.g. status or submissionStatus).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Comment on lines +21 to +26
// Get all approved submissions
const approvedSubmissions = await db
.select()
.from(appSubmissions)
.where(eq(appSubmissions.status, 'approved'))
.orderBy(desc(appSubmissions.submittedAt));
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/api/apps now returns approved UGC submissions mixed in with official apps. This endpoint is also used as the source of truth for pinning/autocomplete flows that assume IDs exist in the apps table (e.g. profile “Add to profile and homepage” and /api/profile/add-app validates against apps). As-is, a user can select/pin a submission ID and hit 404/lose the pin in management views. Consider either (1) keeping /api/apps as official-only and adding a separate endpoint (or query param) for “homepage apps incl. submissions”, or (2) returning a distinct identifier/type for submissions and updating consumers to filter to isOfficial for pin/autocomplete.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 4, 2026

@ghostleek I've opened a new pull request, #52, to work on those changes. Once the pull request is ready, I'll request review from you.

@ghostleek
Copy link
Copy Markdown
Contributor Author

@copilot can you resolve merge conflicts on api/apps.ts?

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 4, 2026

@ghostleek I've opened a new pull request, #53, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 4, 2026

@ghostleek I've opened a new pull request, #54, to work on those changes. Once the pull request is ready, I'll request review from you.

@ghostleek ghostleek merged commit 14d9200 into main Mar 4, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants