Skip to content

fix(undo):SP-4445 prevent undo from reverting all completed files to … - #159

Merged
agustingroh merged 1 commit into
mainfrom
fix/SP-4445-undo-reverts-completed-files
Jun 9, 2026
Merged

agustingroh merged 1 commit into
mainfrom
fix/SP-4445-undo-reverts-completed-files

Conversation

@agustingroh

@agustingroh agustingroh commented Jun 9, 2026 •

Copy link
Copy Markdown
Collaborator

…pending

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Fixed undo/redo behavior when opening a folder at runtime—completed files no longer incorrectly revert to pending status after undoing include actions.

@agustingroh
agustingroh requested a review from matiasdaloia June 9, 2026 16:35
@coderabbitai

coderabbitai Bot commented Jun 9, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 92428343-9690-4a77-8b42-9556233e3b4e

📥 Commits

Reviewing files that changed from the base of the PR and between 3b302fe and 9c8ba3a.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • backend/service/component_service_impl.go
  • backend/service/component_service_impl_test.go

📝 Walkthrough

Walkthrough

This PR fixes an undo/redo consistency bug in ComponentServiceImpl by registering a config change listener that clears stacks and refreshes initial filters when folders are opened at runtime, including comprehensive test coverage and changelog documentation.

Changes

Undo/Redo consistency after runtime folder switch

Layer / File(s) Summary
Config change listener implementation
backend/service/component_service_impl.go
Added config package import and registered onConfigChange listener in NewComponentServiceImpl that clears undoStack, redoStack, and initialFilters, then refreshes initialFilters from current settings when configuration changes at runtime.
Undo/redo test after folder switch
backend/service/component_service_impl_test.go
New unit test TestComponentServiceUndoRedoAfterOpeningFolder verifies that opening a folder containing completed files, then including and undoing a pending file, reverts only the newly included file while preserving pre-existing completed entries. Includes bomIncludes helper to check BOM membership.
Changelog entry
CHANGELOG.md
Added v0.13.3 release entry documenting the undo/include bugfix, with corresponding comparison link reference.

🎯 2 (Simple) | ⏱️ ~12 minutes

🐰 A folder opened at runtime sparked a quirk—
Undo stacks grew tangled, undoing past work.
Now listeners clear stacks with pristine care,
Each folder switch resets with fresh, focused fare!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main fix: preventing undo operations from incorrectly reverting completed files to pending status, which directly addresses the bug documented in the changelog and fixed in the code changes.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/SP-4445-undo-reverts-completed-files

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.

🔧 golangci-lint (2.12.2)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


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 and usage tips.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

SCANOSS SCAN Completed 🚀

  • Detected components: 3
  • Undeclared components: 0
  • Declared components: 3
  • Detected files: 191
  • Detected files undeclared: 0
  • Detected files declared: 191
  • Licenses detected: 2
  • Licenses detected with copyleft: 1
  • Policies: ✅ 1 pass (1 total)

View more details on SCANOSS Action Summary

@agustingroh
agustingroh merged commit d6777e5 into main Jun 9, 2026
6 checks passed
@agustingroh
agustingroh deleted the fix/SP-4445-undo-reverts-completed-files branch June 9, 2026 22:44
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