Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug 176: preserve YAML comments when reordering items by matching… #685

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

turnah
Copy link

@turnah turnah commented Dec 10, 2024

… content instead of position

⚠️⚠️⚠️ Since we do not accept all types of pull requests and do not want to waste your time. Please be sure that you have read pull request rules:
https://github.com/louislam/dockge/blob/master/CONTRIBUTING.md

Tick the checkbox if you understand [x]:

  • I have read and understand the pull request rules.

Description

Fixes #176

Current Behavior

Comments between array items (particularly in labels) are lost when entering edit mode because they're tied to array positions rather than content.

Fix Implementation

  • Modified copyYAMLCommentsItems in common/util-common.ts
  • Changed from position-based to content-based comment preservation
  • Maintains all existing functionality while fixing comment handling
  • No breaking changes or additional configuration required

Type of change

Please delete any options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • My code follows the style guidelines of this project
  • I ran ESLint and other linters for modified files
  • I have performed a self-review of my own code and tested it
  • I have commented my code, particularly in hard-to-understand areas
    (including JSDoc for methods)
  • My changes generate no new warnings
  • My code needed automated testing. I have added them (this is optional task)

Screenshots (if any)

Take the following example, before the fix all comments on the label would be removed

image

After the fix, all comments remain attached to their items

image

My first ever PR so apologies if i've missed anything!

@louislam louislam added this to the 1.5.0 milestone Dec 26, 2024
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.

Commented out lines in compose file disappear when starting/deploying container.
2 participants