Skip to content

Feat/forge templates - #36

Closed
NavpreetST wants to merge 0 commit into
mainfrom
feat/forge-templates
Closed

Feat/forge templates#36
NavpreetST wants to merge 0 commit into
mainfrom
feat/forge-templates

Conversation

@NavpreetST

@NavpreetST NavpreetST commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features
    • Per-file diff expansion in task details view
    • Changed files summary header showing file count
    • Quick access link to view associated pull request

@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
axis-dash Ready Ready Preview, Comment Jun 11, 2026 9:56am

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR extends the Forge API contract with PR and repo metadata, implements per-file diff expansion controls in ForgePanel with PR link display, and updates CI pre-push checklist guidance for GitHub Actions version pinning detection.

Changes

Forge API and Diff Viewer Enhancement

Layer / File(s) Summary
ForgeTaskDetail API extension
src/lib/api/forgeClient.ts
ForgeTaskDetail interface gains pr_number (nullable number) and repo (string) fields from the Forge task status endpoint.
ForgePanel diff expansion and PR link
src/lib/components/ForgePanel.svelte
Adds a Svelte $effect to clear per-file expansion state when tasks or diffs change, reworks the diff viewer header to display changed-file count and optional PR link, and replaces static patch display with per-file expand/collapse controls that conditionally render the patch <pre> only when expanded.

CI Checklist Update

Layer / File(s) Summary
Pre-push checklist grep command update
.opencode/agent/helios-cli.md
The grep scan pattern and workflow file path for detecting unpinned uses: references are updated in the pre-push checklist.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • NavpreetST/axis-dash#35: Updates ForgeTaskDetail and enhances ForgePanel diff expansion rendering with the same pr_number/repo fields and per-file collapsible patch display.
  • NavpreetST/axis-dash#21: Introduces the foundational Forge panel and client components that this PR extends with per-file diff expansion and PR metadata.
  • NavpreetST/axis-dash#27: Adds PR gate-fetching logic (fetchPRGates(prNumber)) that depends on the new pr_number field being added to ForgeTaskDetail in this PR.

Poem

🐰 A forge now knows which PR's in the flow,
With diffs that expand, then collapse—just so!
Each file unfolds at a fluffy command,
While checklists tighten their grep-ing hand. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The PR title 'Feat/forge templates' is vague and does not clearly communicate the actual changes made in the pull request. Provide a more descriptive title that clearly indicates the specific changes, such as 'Add PR number and repo fields to ForgeTaskDetail and expand file diffs in ForgePanel' or similar.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/forge-templates

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/lib/components/ForgePanel.svelte

Oops! Something went wrong! :(

ESLint: 10.4.1

The requested operation requires ESLint to serialize configuration data,
but the configuration key "compilerOptions.runes" contains a function value,
which cannot be serialized.

Please double-check your configuration for errors.

If you still have problems, please stop by https://eslint.org/chat/help to chat
with the team.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/lib/components/ForgePanel.svelte (1)

102-104: ⚡ Quick win

Consider resetting expandedFiles when the diff data or selected task changes.

The expansion state currently persists across task switches. If a user expands src/app.ts in task A and then selects task B (which also modifies src/app.ts), the file will start expanded in task B. This could be confusing.

♻️ Suggested fix to reset expansion state

Add a $effect to reset expandedFiles when the selected task or diff data changes:

 function toggleFile(path: string) {
   expandedFiles[path] = !expandedFiles[path];
 }
+
+$effect(() => {
+  // Reset expansion state when task or diff changes
+  if ($forgeSelectedId || $forgeDiffData) {
+    expandedFiles = {};
+  }
+});
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/components/ForgePanel.svelte` around lines 102 - 104, The expansion
state in expandedFiles persists across task switches; add a Svelte reactive
statement that resets expandedFiles to an empty object whenever the selected
task or the diff data changes so expandedFiles no longer carries over between
tasks—update the component to watch the selectedTask and diffData variables and
clear expandedFiles (used by toggleFile) when either changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/components/ForgePanel.svelte`:
- Around line 324-333: The if-block in ForgePanel.svelte currently checks
{$forgeDetail.pr_number} truthily which treats 0 as falsy; update the condition
to explicitly test for null (e.g., $forgeDetail.pr_number !== null) while still
verifying $forgeDetail.repo so PR number 0 is correctly rendered; locate the
{`#if` $forgeDetail.pr_number && $forgeDetail.repo} block and replace the truthy
check with an explicit null comparison.

---

Nitpick comments:
In `@src/lib/components/ForgePanel.svelte`:
- Around line 102-104: The expansion state in expandedFiles persists across task
switches; add a Svelte reactive statement that resets expandedFiles to an empty
object whenever the selected task or the diff data changes so expandedFiles no
longer carries over between tasks—update the component to watch the selectedTask
and diffData variables and clear expandedFiles (used by toggleFile) when either
changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 628fc90d-24d8-4c48-a7bd-9b5c4220ad5d

📥 Commits

Reviewing files that changed from the base of the PR and between da5cba7 and ab681e4.

📒 Files selected for processing (3)
  • src/lib/api/forgeClient.ts
  • src/lib/components/ForgePanel.svelte
  • src/routes/todo/+page.svelte

Comment thread src/lib/components/ForgePanel.svelte

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/lib/components/ForgePanel.svelte (1)

106-110: 💤 Low value

Consider unconditionally resetting expandedFiles in the effect.

The current condition if ($forgeSelectedId || $forgeDiffData) means expandedFiles is only cleared when there's a selected task or diff data. When both become null (e.g., task deselected), the state isn't cleared, leaving stale expansion state in memory. While harmless (the diff viewer won't render when no task is selected), unconditionally resetting on every dependency change would be more explicit:

$effect(() => {
  const _ = $forgeSelectedId ?? $forgeDiffData;
  expandedFiles = {};
});

The current implementation is correct and acceptable; this is a minor clarity improvement.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/components/ForgePanel.svelte` around lines 106 - 110, In the $effect
block that currently checks `if ($forgeSelectedId || $forgeDiffData)` before
clearing `expandedFiles`, change it to unconditionally reset `expandedFiles =
{}` on every effect run so stale expansion state is never retained; update the
`$effect` callback (the one referencing `$forgeSelectedId` and `$forgeDiffData`)
to always assign `expandedFiles = {}` rather than only doing so inside the
conditional.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/lib/components/ForgePanel.svelte`:
- Around line 106-110: In the $effect block that currently checks `if
($forgeSelectedId || $forgeDiffData)` before clearing `expandedFiles`, change it
to unconditionally reset `expandedFiles = {}` on every effect run so stale
expansion state is never retained; update the `$effect` callback (the one
referencing `$forgeSelectedId` and `$forgeDiffData`) to always assign
`expandedFiles = {}` rather than only doing so inside the conditional.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c5fd83e0-f1f7-4992-9ce6-cbb4520b78d0

📥 Commits

Reviewing files that changed from the base of the PR and between ab681e4 and 5782ed5.

📒 Files selected for processing (1)
  • src/lib/components/ForgePanel.svelte

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.opencode/agent/helios-cli.md:
- Line 4: Update the grep command to use the correct file glob and regex: change
the file pattern from the literal "_.yml" to "*.yml" to match all workflow YAML
files, and change the regex from "uses:._@v[0-9]" to "uses:.*`@v`[0-9]" so it
matches typical GitHub Actions lines like "uses: actions/checkout@v4"; apply
this edit to the grep invocation shown in the diff so subsequent pipelines
search all .yml files and correctly detect uses:...@vN patterns.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d64f1ce6-561d-499f-ae76-2826dbf106fc

📥 Commits

Reviewing files that changed from the base of the PR and between 5782ed5 and 66d5fa9.

📒 Files selected for processing (2)
  • .opencode/agent/helios-cli.md
  • src/lib/components/ForgePanel.svelte
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/components/ForgePanel.svelte

Comment thread .opencode/agent/helios-cli.md Outdated
Only then report "ready for merge."

1. npm run lint && npm run test
2. grep -n 'uses:._@v[0-9]' .github/workflows/_.yml | grep -v '# pinned'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Fix the file glob and regex pattern in the grep command.

The grep command has two critical issues that prevent it from working:

  1. File glob _.yml: The underscore is a literal character, not a wildcard. This pattern will only match a file literally named _.yml, not ci.yml or other workflow files. Should be *.yml to match all YAML workflow files.

  2. Regex pattern uses:._@v[0-9]: This matches "uses:" + any char + literal underscore + "@v" + digit (e.g., uses:x_@v4), but will NOT match standard GitHub Actions syntax like uses: actions/checkout@v4. Should be uses:.*@v[0-9] to match any characters between uses: and @v.

🔧 Proposed fix
-grep -n 'uses:._@v[0-9]' .github/workflows/_.yml | grep -v '# pinned'
+grep -n 'uses:.*`@v`[0-9]' .github/workflows/*.yml | grep -v '# pinned'
🧰 Tools
🪛 LanguageTool

[uncategorized] ~4-~4: The official name of this software platform is spelled with a capital “H”.
Context: ...m run test 2. grep -n 'uses:.@v[0-9]' .github/workflows/.yml | grep -v '# pinned' ...

(GITHUB)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.opencode/agent/helios-cli.md at line 4, Update the grep command to use the
correct file glob and regex: change the file pattern from the literal "_.yml" to
"*.yml" to match all workflow YAML files, and change the regex from
"uses:._@v[0-9]" to "uses:.*`@v`[0-9]" so it matches typical GitHub Actions lines
like "uses: actions/checkout@v4"; apply this edit to the grep invocation shown
in the diff so subsequent pipelines search all .yml files and correctly detect
uses:...@vN patterns.

@NavpreetST NavpreetST closed this Jun 11, 2026
@NavpreetST
NavpreetST force-pushed the feat/forge-templates branch from 66d5fa9 to da5cba7 Compare June 11, 2026 10:42
NavpreetST added a commit that referenced this pull request Jun 11, 2026
fix: POST /forge/{id}/gate ignores approve body field
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.

1 participant