Skip to content

Task 4086: Set changeset hashtags in Rapid manager - #104

Merged
shweta2101 merged 5 commits into
developfrom
feature-4086-changesets-tasks-linkage
Aug 10, 2026
Merged

Task 4086: Set changeset hashtags in Rapid manager#104
shweta2101 merged 5 commits into
developfrom
feature-4086-changesets-tasks-linkage

Conversation

@shweta2101

@shweta2101 shweta2101 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

DevBoard Task

https://dev.azure.com/TDEI-UW/TDEI/_workitems/edit/4086/

Changes implemented

  • Added a prefilled Rapid changeset hashtag for Tasking Editor sessions:
    • Format: #tm-{projectId}-{taskNumber}
    • Example: #tm-39-2
  • Passes the hashtag through Rapid’s supported hashtags URL parameter on initial load.
  • Updates Rapid’s internal initial hash parameters when switching tasks, preventing the previous task’s hashtag from being reused.
  • Reconstructs the hashtag from the current project/task after a page refresh.
  • Added unit coverage for initial tag population and task switching.

Impacted areas for testing

  • Open a task in the Tasking Editor and confirm the expected hashtag appears in Rapid’s changeset form.
  • Submit a changeset and confirm its hashtags tag contains the expected value.
  • Switch to another task and confirm the hashtag uses the new task number rather than the previous one.
  • Refresh the Tasking Editor page and confirm the correct hashtag remains prefilled.
  • Test projects and tasks with different IDs to verify the format.
  • Open the regular workspace editor and confirm task-specific hashtag behavior is not introduced there.
  • Confirm custom imagery and task boundary loading still work.
  • Confirm changeset submission and task completion continue working.

Manual verification

Verified the Rapid changeset/create request payload for project 45, task 127.

<tag k="hashtags" v="#tm-45-127"/>

Screenshots

Screenshot 2026-08-10 at 12 23 57 PM Screenshot 2026-08-10 at 4 47 51 PM

Summary

  • Add task-specific Rapid changeset hashtags in the format #tm-{projectId}-{taskNumber}.
  • Pass hashtags through Rapid’s hashtags URL parameter during initialization and task switching.
  • Restore the hashtag after page refreshes.
  • Validate Rapid’s initialHashParams before use.
  • Remove hashtags from generated map hashes while retaining Rapid’s initial hashtag parameters.
  • Update Rapid mocks and add unit tests for hashtag replacement during initialization and workspace switching.

Pass a task-specific changeset hashtag from the editor into the RapidManager and include it in the map URL hash. Editor: introduce changesetTag (#tm-<project>-<task>), pass it to manager.init and manager.switchWorkspace, and append it (URL-encoded) as the hashtags parameter in generated hashes. RapidManager: add #setInitialChangesetHashtags to update the Rapid context's initialHashParams (adding or deleting the hashtags entry) and call it from init and switchWorkspace. Tests: adjust test setup (resetAsync, urlhash.initialHashParams) and add a unit test asserting that initializing/switching workspaces replaces the initial changeset hashtag as expected.
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The task editor derives a task-specific changeset hashtag and passes it to Rapid during initialization and workspace switching. Rapid updates its initial URL hash parameters and validates the required hash API.

Changes

Task changeset hashtag propagation

Layer / File(s) Summary
Rapid hashtag application and validation
services/rapid.ts, test/unit/services/rapid.test.ts
RapidManager.init and switchWorkspace accept optional hashtags, update initial URL hash parameters, and retain test coverage for both operations.
Editor changeset propagation
pages/workspace/[id]/projects/[projectId]/tasks/[taskId]/editor.vue, test/e2e/edit.spec.ts
The editor derives a task-specific changeset tag and passes it to Rapid lifecycle calls. The Rapid 2 test stub exposes the required systems APIs.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: jeffmaki, susrisha

Poem

A rabbit tags each task with care,
Rapid carries hashtags there.
Hash parameters update bright,
On startup and workspace flight.
Hop, test, and ship tonight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the task and the main change: setting changeset hashtags in the Rapid manager.

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.

@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)
test/unit/services/rapid.test.ts (1)

97-103: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover removal of a previous task hashtag.

This test covers only supplied hashtags. Add a call without the third argument and assert that initialHashParams no longer has hashtags. This protects the path that removes task state before the manager is used without a task tag.

Proposed test addition
     await manager.switchWorkspace(1763, null, '`#tm-39-3`');

     expect(initialHashParams.get('hashtags')).toBe('`#tm-39-3`');
+
+    await manager.switchWorkspace(1763, null);
+
+    expect(initialHashParams.has('hashtags')).toBe(false);
   });

Run run-tests.sh after this test change.

🤖 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 `@test/unit/services/rapid.test.ts` around lines 97 - 103, Add coverage in the
existing manager initialization/workspace-switch test for removal of task
hashtag state: after the current hashtag assertions, invoke the relevant manager
method without the third hashtag argument, then assert initialHashParams no
longer contains “hashtags”. Run run-tests.sh to verify the updated test.

Source: Coding guidelines

🤖 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 `@services/rapid.ts`:
- Around line 88-89: Remove trailing commas from the specified changed
TypeScript: both changesetHashtags parameter declarations in services/rapid.ts
(lines 88-89 and 121-123), the final initialHashParams entry in
test/unit/services/rapid.test.ts (lines 28-30), and the final array entry and
constructor argument in test/unit/services/rapid.test.ts (lines 67-74).

---

Nitpick comments:
In `@test/unit/services/rapid.test.ts`:
- Around line 97-103: Add coverage in the existing manager
initialization/workspace-switch test for removal of task hashtag state: after
the current hashtag assertions, invoke the relevant manager method without the
third hashtag argument, then assert initialHashParams no longer contains
“hashtags”. Run run-tests.sh to verify the updated test.
🪄 Autofix

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 Plus

Run ID: c38d3ebb-f00d-4628-9f55-4c5599660708

📥 Commits

Reviewing files that changed from the base of the PR and between 34171ba and 8b9511f.

📒 Files selected for processing (3)
  • pages/workspace/[id]/projects/[projectId]/tasks/[taskId]/editor.vue
  • services/rapid.ts
  • test/unit/services/rapid.test.ts

Comment thread services/rapid.ts Outdated
Add RapidInitialHashParams type and isRapidInitialHashParams type guard to safely detect Map-like initialHashParams. Use optional chaining when reading initialHashParams and check it with the guard before using it to prevent runtime errors. Change two RapidManager method signatures to return Promise<void> and give #setInitialChangesetHashtags an explicit void return type. Update e2e test to mock systems.urlhash.initialHashParams as a Map so the new guard passes.

@susrisha susrisha left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Adds the changesetHashtags based on the project and task. This is approved

Stop appending the &hashtags=<changesetTag> parameter in generateInitialHash within editor.vue. The changes remove the encoded changesetTag from both the customImagery and default return paths, simplifying the generated map hash and avoiding inclusion of the hashtags parameter in the URL.
Add a 'Hashtags' field to the changeset metadata in Details.vue, mapping to changeset.tags?.hashtags so hashtags from OSM changesets are surfaced in the review details UI.
@shweta2101
shweta2101 merged commit d46cff1 into develop Aug 10, 2026
2 checks passed
@shweta2101
shweta2101 deleted the feature-4086-changesets-tasks-linkage branch August 10, 2026 11:42
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.

2 participants