Skip to content

Changeset comment feature + notes comment feature#88

Open
jeffmaki wants to merge 11 commits into
developfrom
jeff-notes
Open

Changeset comment feature + notes comment feature#88
jeffmaki wants to merge 11 commits into
developfrom
jeff-notes

Conversation

@jeffmaki

@jeffmaki jeffmaki commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

AZDO #3967 and #3966

Summary

  • Added changeset and note comment posting support in the review discussion UI.
  • Added error toasts while preserving drafts when comment submission fails.
  • Refreshes changeset comments from the server and optimistically appends note comments.
  • Updated OSM API comment requests and note response handling.
  • Added end-to-end and unit test coverage for successful and failed comment posting.
  • Updated Nuxt development server and proxy configuration.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jeffmaki, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 23 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5aab09e0-74be-4ae9-98fa-b2d85ee80a82

📥 Commits

Reviewing files that changed from the base of the PR and between d32973a and 03e45aa.

📒 Files selected for processing (8)
  • .env.example
  • .github/workflows/ci.yml
  • .gitignore
  • components/review/Discussion.vue
  • nuxt.config.ts
  • services/osm.ts
  • test/e2e/review.spec.ts
  • test/unit/services/osm.test.ts
📝 Walkthrough

Walkthrough

Comment posting now reports failures while preserving drafts, refreshes changeset discussions, and optimistically updates note discussions. OSM client requests use encoded query parameters, note parsing is refactored, and Nuxt development proxy settings are expanded.

Changes

Comment flow updates

Layer / File(s) Summary
OSM comment client behavior
services/osm.ts, test/unit/services/osm.test.ts
Note conversion uses a typed helper; comment endpoints send URL-encoded query text, and note posting supports returning an updated note. Tests cover retrieval and request encoding.
Discussion refresh and send flow
components/review/Discussion.vue, test/e2e/review.spec.ts
Discussion sending now reports errors, retains failed drafts, refreshes changesets, and optimistically appends note comments. End-to-end tests cover success and failure cases.

Development server routing

Layer / File(s) Summary
Development proxy configuration
nuxt.config.ts
The dev server binds to all interfaces, proxy routes use changeOrigin, additional backend prefixes are supported, and Vite accepts any hostname.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested reviewers: cyrossignol, shweta2101

Poem

A bunny typed a comment with care,
Then kept the draft when errors were there.
Notes hopped in fresh, timestamps shone,
Proxies opened paths widely known.
“Thump, thump!” said the rabbit—well done!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: adding comment features for changesets and notes.
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.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@jeffmaki jeffmaki requested review from cyrossignol and removed request for cyrossignol July 10, 2026 21:42
@jeffmaki jeffmaki marked this pull request as draft July 10, 2026 21:44

@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: 4

🤖 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 `@nuxt.config.ts`:
- Around line 31-32: Remove the newly added trailing commas from the devServer
configuration and the additional changed entries around the corresponding
configuration block in nuxt.config.ts, following the project’s
no-trailing-commas style.
- Around line 52-56: Update the Vite server configuration in nuxt.config.ts to
remove allowedHosts: true and keep host validation enabled by using the default
empty list or an explicit allowlist. Support additional tunnel hosts through the
__VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS environment variable.

In `@services/osm.ts`:
- Around line 59-78: Guard against missing comments in noteFeatureToEntity by
defaulting properties.comments to an empty array before iterating. Update the
comments access in the loop and returned OsmNote so undefined feature properties
or comments never cause iteration to throw.
- Around line 462-501: Remove the duplicate postNoteComment method in
services/osm.ts. Keep the Promise<void> implementation that posts the encoded
text query parameter, and delete or rename the later JSON-returning
implementation so only one method with this signature remains.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b8f25c48-b8f8-4be4-b6f1-cfb7157f534b

📥 Commits

Reviewing files that changed from the base of the PR and between bc945e3 and d32973a.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • components/review/Discussion.vue
  • nuxt.config.ts
  • services/osm.ts
  • test/e2e/review.spec.ts
  • test/unit/services/osm.test.ts

Comment thread nuxt.config.ts
Comment thread nuxt.config.ts Outdated
Comment thread services/osm.ts
Comment on lines +59 to +78
function noteFeatureToEntity(feature: Feature): OsmNote {
const geometry = feature.geometry as Point;
const properties = feature.properties ?? { };

for (const comment of properties.comments) {
comment.date = new Date(comment.date);
}

notes.push({
id: properties.id,
status: properties.status,
lat: geometry.coordinates[1] ?? 0,
lon: geometry.coordinates[0] ?? 0,
created_at: new Date(properties.date_created),
comments: properties.comments,
});
for (const comment of properties.comments) {
comment.date = new Date(comment.date);
}

return notes;
return {
id: properties.id,
status: properties.status,
lat: geometry.coordinates[1] ?? 0,
lon: geometry.coordinates[0] ?? 0,
created_at: new Date(properties.date_created),
comments: properties.comments,
};
}

function notesGeoJsonToEntities(geoJson: FeatureCollection): OsmNote[] {
return geoJson.features.map(noteFeatureToEntity);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Guard against undefined properties.comments

When feature.properties is undefined, the ?? { } fallback yields an empty object, but properties.comments is then undefined and for (const comment of undefined) throws a TypeError. Add a defensive fallback to [].

🛡️ Proposed fix
 function noteFeatureToEntity(feature: Feature): OsmNote {
   const geometry = feature.geometry as Point;
   const properties = feature.properties ?? { };
 
-  for (const comment of properties.comments) {
+  for (const comment of properties.comments ?? []) {
     comment.date = new Date(comment.date);
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function noteFeatureToEntity(feature: Feature): OsmNote {
const geometry = feature.geometry as Point;
const properties = feature.properties ?? { };
for (const comment of properties.comments) {
comment.date = new Date(comment.date);
}
notes.push({
id: properties.id,
status: properties.status,
lat: geometry.coordinates[1] ?? 0,
lon: geometry.coordinates[0] ?? 0,
created_at: new Date(properties.date_created),
comments: properties.comments,
});
for (const comment of properties.comments) {
comment.date = new Date(comment.date);
}
return notes;
return {
id: properties.id,
status: properties.status,
lat: geometry.coordinates[1] ?? 0,
lon: geometry.coordinates[0] ?? 0,
created_at: new Date(properties.date_created),
comments: properties.comments,
};
}
function notesGeoJsonToEntities(geoJson: FeatureCollection): OsmNote[] {
return geoJson.features.map(noteFeatureToEntity);
function noteFeatureToEntity(feature: Feature): OsmNote {
const geometry = feature.geometry as Point;
const properties = feature.properties ?? { };
for (const comment of properties.comments ?? []) {
comment.date = new Date(comment.date);
}
return {
id: properties.id,
status: properties.status,
lat: geometry.coordinates[1] ?? 0,
lon: geometry.coordinates[0] ?? 0,
created_at: new Date(properties.date_created),
comments: properties.comments,
};
}
function notesGeoJsonToEntities(geoJson: FeatureCollection): OsmNote[] {
return geoJson.features.map(noteFeatureToEntity);
🤖 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 `@services/osm.ts` around lines 59 - 78, Guard against missing comments in
noteFeatureToEntity by defaulting properties.comments to an empty array before
iterating. Update the comments access in the loop and returned OsmNote so
undefined feature properties or comments never cause iteration to throw.

Comment thread services/osm.ts
@jeffmaki jeffmaki marked this pull request as ready for review July 10, 2026 21:58
@jeffmaki jeffmaki requested a review from cyrossignol July 10, 2026 22:23
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