From 6ef858ec66a7bb84ff84b310fb74ae1243396c95 Mon Sep 17 00:00:00 2001 From: vikramsh2002 Date: Mon, 1 Jun 2026 16:00:19 +0530 Subject: [PATCH] Feature new portfolio projects by default --- .github/prompts/portfolio-project-sync.prompt.yml | 10 ++++++++-- portfolio-v2/docs/portfolio-sync.md | 1 + portfolio-v2/scripts/applyPortfolioProjectUpdate.mjs | 8 +++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/prompts/portfolio-project-sync.prompt.yml b/.github/prompts/portfolio-project-sync.prompt.yml index 99c8868..03beb7f 100644 --- a/.github/prompts/portfolio-project-sync.prompt.yml +++ b/.github/prompts/portfolio-project-sync.prompt.yml @@ -13,7 +13,8 @@ messages: - Mark needs_review when the update is too vague, promotional, or missing enough project details. - For new projects, use empty string for image so the workflow can capture the live/demo site thumbnail. - For existing project updates, preserve or reuse the existing image only when it still clearly fits. - - Use featured false for newly added projects unless the update explicitly says it should be featured. + - Use featured true for newly added projects so they appear at the top by default. + - Use featurePolicy "explicit_unfeatured" only when the update clearly says the project should not be featured or should not appear at the top. - role: user content: |- Current portfolio projects JSON: @@ -82,12 +83,17 @@ jsonSchema: |- }, "required": ["title", "subtitle", "image", "description", "impact", "tags", "featured", "links"] }, + "featurePolicy": { + "type": "string", + "enum": ["default_featured", "explicit_featured", "explicit_unfeatured"], + "description": "For add_project, default to default_featured unless the update explicitly controls whether the project should appear at the top." + }, "reviewNotes": { "type": "array", "items": { "type": "string" }, "maxItems": 6 } }, - "required": ["intent", "risk", "matchTitle", "reason", "project", "reviewNotes"] + "required": ["intent", "risk", "matchTitle", "reason", "project", "featurePolicy", "reviewNotes"] } } diff --git a/portfolio-v2/docs/portfolio-sync.md b/portfolio-v2/docs/portfolio-sync.md index cff1aac..838bfa5 100644 --- a/portfolio-v2/docs/portfolio-sync.md +++ b/portfolio-v2/docs/portfolio-sync.md @@ -47,6 +47,7 @@ The workflow: - Converts the update into structured project data. - Prepares a project thumbnail by reusing an existing local image, downloading `card_image_url`, or capturing a screenshot from the live/demo URL. - Applies an add/update to the project list. +- Places newly added projects in the featured/top project row by default unless the update explicitly says not to feature them. - Runs the Vite build. - Opens a pull request with a summary when the update is safe enough for review. - Dispatches `Portfolio V2 CI` for the generated PR branch so required checks run for bot-created PRs. diff --git a/portfolio-v2/scripts/applyPortfolioProjectUpdate.mjs b/portfolio-v2/scripts/applyPortfolioProjectUpdate.mjs index 7b04442..509c17a 100644 --- a/portfolio-v2/scripts/applyPortfolioProjectUpdate.mjs +++ b/portfolio-v2/scripts/applyPortfolioProjectUpdate.mjs @@ -24,6 +24,7 @@ if (!Array.isArray(currentProjects)) { const normalizedIntent = normalizeIntent(change.intent); const risk = normalizeRisk(change.risk); const project = normalizeProject(change.project); +const featurePolicy = normalizeFeaturePolicy(change.featurePolicy); const reviewNotes = Array.isArray(change.reviewNotes) ? change.reviewNotes.filter(Boolean) : []; let action = "none"; let changed = false; @@ -54,7 +55,7 @@ if (normalizedIntent === "add_project" || normalizedIntent === "update_project") { ...project, image: project.image || defaultProjectImage, - featured: Boolean(project.featured), + featured: featurePolicy !== "explicit_unfeatured", }, ...currentProjects, ]; @@ -114,6 +115,11 @@ function normalizeRisk(risk) { return allowed.has(risk) ? risk : "high"; } +function normalizeFeaturePolicy(featurePolicy) { + const allowed = new Set(["default_featured", "explicit_featured", "explicit_unfeatured"]); + return allowed.has(featurePolicy) ? featurePolicy : "default_featured"; +} + function normalizeProject(project = {}) { const title = clean(project.title);