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

feat(xyz): support use linebreak as separate for zyz #16685

Conversation

bluelovers
Copy link
Contributor

Description

使 xyz input 額外支援以 斷行 作為分隔符

優點是比起全部都在同一行使用 , 時更具有閱讀性
在想對於 xyz 內容作順序調整時也比較輕鬆

另外 忽略空行 所以能夠像圖片這樣兼具分組效果的輸入值(僅供人類閱讀用,不影響腳本行為)

Screenshots/videos:

image

Checklist:

@bluelovers
Copy link
Contributor Author

feat(xyz): 支援使用斷行作為 zyz 分隔符

新增功能:

  • 斷行分隔: 除了逗號 (,),現在 xyz 輸入也支援使用斷行符 (linebreak) 來分隔 zyz。
  • 可讀性提升: 相較於將所有 zyz 放在同一行以逗號分隔,使用斷行符能讓輸入內容更易於閱讀和理解。
  • 順序調整便利: 當需要調整 zyz 的順序時,使用斷行符能更輕鬆地進行操作。
  • 忽略空行: 系統會自動忽略空行,因此您可以像圖片所示,將輸入值分組以增加可讀性 (僅供人類參考,不影響腳本執行)。

優點總結:

  • 更佳可讀性: 提升代碼的可維護性。
  • 更易於操作: 方便使用者調整和管理輸入內容。
  • 靈活的輸入格式: 支援多種輸入方式,滿足不同使用場景。

feat(xyz): Support using line breaks as separators for zyz

New Features:

  • Line Break Separation: In addition to commas (,), xyz input now supports using line breaks to separate zyz.
  • Improved Readability: Compared to placing all zyz on the same line separated by commas, using line breaks makes the input content easier to read and understand.
  • Easier Order Adjustment: When you need to adjust the order of zyz, using line breaks makes it easier to manipulate.
  • Ignore Blank Lines: The system will automatically ignore blank lines, so you can group input values like in the image for better readability (for human reference only, does not affect script execution).

Summary of Advantages:

  • Better Readability: Improves code maintainability.
  • Easier to Use: Allows users to adjust and manage input content more easily.
  • Flexible Input Format: Supports multiple input formats to meet different use cases.

Copy link
Collaborator

@w-e-w w-e-w left a comment

Choose a reason for hiding this comment

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

old comment

the input already supports line break as separated no need for extra implementation

ignoring white spaces is not an option at least for arbitrary inputs such Prompt S/R
with Prompt S/R it is quite common for a a user too input blank entry deliberately because they want they prompt to be "removed"

if you limit ignoring white spaces behavior to only fields with options like Checkpoint name then that could be possible
irrc number number of fields already ignore white spaces

note what spaces will be automatically removed when you if you toggle use text inputs instead of dropdowns (aka csv_mode)

image

screenshot is without the pr

after a re-reviewing it would seems like things that you're trying to achieve already supported
unless I'm missing something it seems like using new line as separator and other things already supported
so this PR seems to be redundant

image

screenshot of xyz 4 Checkpoint name in 3 groups separated using new lines working without using this PR

the first two rules seems to completely redundant because of csv.reader(skipinitialspace=True)
the third rule seems to a improperly implemented method of filtering out blank options
but depending on the axix case blank options may be valid inputs
so you shouldn't filter them out without confirming that they are not valid
but the problem is there's no good way of testing if something is valid. the closest way would be from the Axis.confirm function, but unfortunately the that is not suited to be used as filter, reason one being that is intended to to raise an exception if there is an issue, reason 2 is that it could be implemented by the extension so there's no control on what it may do and they may be lasting consequences if it's executed twice
so unless we're going to adding more complexity to the already complex system the best thing to do is probably to not to filtering additional filtering

saying this I'm considering removing the filtering of options when switching between csv_mode

@w-e-w w-e-w changed the base branch from master to dev November 28, 2024 05:52
@w-e-w w-e-w requested a review from catboxanon as a code owner November 28, 2024 05:52
@bluelovers bluelovers closed this Nov 29, 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.

2 participants