Skip to content

Experiment descriptions #8105

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

Open
wants to merge 8 commits into
base: dev/feature
Choose a base branch
from
Open

Conversation

Efnilite
Copy link
Member

@Efnilite Efnilite commented Aug 1, 2025

Problem

Currently, experiments have no standardized way of being displayed in docs sites. There's also no easily available description or display name which docs sites can use for displaying.

Solution

Adds an optional description and display name to Experiment.

Testing Completed

Manually checked.

Supporting Information


Completes: none
Related: none

@Efnilite Efnilite added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label Aug 1, 2025
@Efnilite Efnilite requested a review from Pikachu920 as a code owner August 1, 2025 21:07
@Efnilite Efnilite added the documentation Related to Skript's official documentation. label Aug 1, 2025
@Efnilite Efnilite requested review from AyhamAl-Ali and a team as code owners August 1, 2025 21:07
@Efnilite Efnilite requested review from sovdeeth and removed request for a team August 1, 2025 21:07
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Aug 1, 2025
@Efnilite Efnilite changed the title Feature descriptions Experiment descriptions Aug 1, 2025
@skriptlang-automation skriptlang-automation bot removed the needs reviews A PR that needs additional reviews label Aug 1, 2025
@Efnilite Efnilite requested a review from sovdeeth August 2, 2025 09:40
@Efnilite Efnilite moved this to In Review in 2.13 Releases Aug 5, 2025
@Efnilite Efnilite requested a review from sovdeeth August 20, 2025 18:29
@Efnilite Efnilite requested a review from sovdeeth August 21, 2025 13:25
@skriptlang-automation skriptlang-automation bot added the feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. label Aug 21, 2025
@github-project-automation github-project-automation bot moved this from In Review to Awaiting Merge in 2.13 Releases Aug 21, 2025
Copy link
Member

@APickledWalrus APickledWalrus left a comment

Choose a reason for hiding this comment

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

Good stuff so far

Comment on lines +389 to +392
JsonArray description = new JsonArray();
for (String part : experiment.description().split("\\n")) {
description.add(part);
}
Copy link
Member

Choose a reason for hiding this comment

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

This can be moved inside of the else below, right?

CATCH_ERRORS("Runtime Error Catching",
"catch runtime errors",
"""
A new catch [run[ ]time] error[s] section allows you to catch and suppress runtime errors within it and access them later with [the] last caught [run[ ]time] errors.
Copy link
Member

Choose a reason for hiding this comment

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

Would remove the pattern syntax from this

private final LifeCycle phase;
private final SkriptPattern compiledPattern;

Feature(String codeName, LifeCycle phase, String... patterns) {
Feature(@NotNull String displayName, @NotNull String codeName,
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick but I feel like it makes more sense to have codeName first

/**
* @return The description for this experiment.
*/
default @NotNull String description() {
Copy link
Member

Choose a reason for hiding this comment

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

Should this be a list of strings? I feel like that's the standard, but would like to hear thoughts. Could keep the single string constructor and just split at newlines for simplicity too.

@github-project-automation github-project-automation bot moved this from Awaiting Merge to In Review in 2.13 Releases Aug 21, 2025
@skriptlang-automation skriptlang-automation bot removed the feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. label Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related to Skript's official documentation. enhancement Feature request, an issue about something that could be improved, or a PR improving something.
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

5 participants