diff --git a/scripts/validate-form/main.js b/scripts/validate-form/main.js index 66575e76..caf11e3b 100644 --- a/scripts/validate-form/main.js +++ b/scripts/validate-form/main.js @@ -1,4 +1,6 @@ const LABEL_NAME = "needs info" +const RE_VERSION = /Yazi\s+Version\s*:\s\d+\.\d+\.\d+\s\(/gm +const RE_DEPENDENCIES = /Dependencies\s+[/a-z]+\s*:\s/gm const RE_CHECKLIST = /#{3}\s+Checklist\s+(?:^-\s+\[x]\s+.+?\n){2}/gm function bugReportBody(creator, content, hash) { @@ -10,14 +12,14 @@ function bugReportBody(creator, content, hash) { - The bug can still be reproduced on the [newest nightly build](https://yazi-rs.github.io/docs/installation/#binaries). - The debug information (\`yazi --debug\`) is updated for the newest nightly. -- All required fields in the checklist have been checked. +- All *required* fields in the checklist have been checked. Issues with \`${LABEL_NAME}\` will be marked ready once edited with the proper content, or closed after 2 days of inactivity. ` } -function featureRequestBody(creator, content, hash) { - if (content.includes(` (${hash} `) && RE_CHECKLIST.test(content)) { +function featureRequestBody(creator, content) { + if (RE_VERSION.test(content) && RE_DEPENDENCIES.test(content) && RE_CHECKLIST.test(content)) { return null } @@ -25,7 +27,7 @@ function featureRequestBody(creator, content, hash) { - The requested feature does not exist in the [newest nightly build](https://yazi-rs.github.io/docs/installation/#binaries). - The debug information (\`yazi --debug\`) is updated for the newest nightly. -- All required fields in the checklist have been checked. +- All *required* fields in the checklist have been checked. Issues with \`${LABEL_NAME}\` will be marked ready once edited with the proper content, or closed after 2 days of inactivity. ` @@ -66,7 +68,7 @@ module.exports = async ({ github, context, core }) => { await github.rest.issues.addLabels({ ...context.repo, issue_number: id, - labels: [LABEL_NAME], + labels : [LABEL_NAME], }) await github.rest.issues.createComment({ ...context.repo, @@ -77,7 +79,7 @@ module.exports = async ({ github, context, core }) => { await github.rest.issues.removeLabel({ ...context.repo, issue_number: id, - name: LABEL_NAME, + name : LABEL_NAME, }) } } catch (e) { @@ -89,7 +91,7 @@ module.exports = async ({ github, context, core }) => { try { const { data: issues } = await github.rest.issues.listForRepo({ ...context.repo, - state: "open", + state : "open", labels: LABEL_NAME, }) @@ -102,13 +104,13 @@ module.exports = async ({ github, context, core }) => { await github.rest.issues.update({ ...context.repo, issue_number: issue.number, - state: "closed", + state : "closed", state_reason: "not_planned", }) await github.rest.issues.createComment({ ...context.repo, issue_number: issue.number, - body: `This issue has been automatically closed because it was marked as \`${LABEL_NAME}\` for more than 2 days without updates. + body : `This issue has been automatically closed because it was marked as \`${LABEL_NAME}\` for more than 2 days without updates. If the problem persists, please file a new issue and complete the issue template so we can capture all the details necessary to investigate further.`, }) } @@ -136,7 +138,7 @@ If the problem persists, please file a new issue and complete the issue template const body = bugReportBody(creator, content, hash) await updateLabels(id, !!body, body) } else if (await hasLabel(id, "feature")) { - const body = featureRequestBody(creator, content, hash) + const body = featureRequestBody(creator, content) await updateLabels(id, !!body, body) } } diff --git a/yazi-config/preset/theme-dark.toml b/yazi-config/preset/theme-dark.toml index 77b3f7f3..eb23277e 100644 --- a/yazi-config/preset/theme-dark.toml +++ b/yazi-config/preset/theme-dark.toml @@ -128,6 +128,10 @@ btn_labels = [ " [Y]es ", " (N)o " ] border = { fg = "blue" } title = { fg = "blue" } +# Table +tbl_col = { fg = "blue" } +tbl_cell = { fg = "yellow", reversed = true } + # : }}} diff --git a/yazi-config/preset/theme-light.toml b/yazi-config/preset/theme-light.toml index 7385bcae..f202d5a6 100644 --- a/yazi-config/preset/theme-light.toml +++ b/yazi-config/preset/theme-light.toml @@ -128,6 +128,10 @@ btn_labels = [ " [Y]es ", " (N)o " ] border = { fg = "blue" } title = { fg = "blue" } +# Table +tbl_col = { fg = "blue" } +tbl_cell = { fg = "yellow", reversed = true } + # : }}} diff --git a/yazi-config/src/theme/theme.rs b/yazi-config/src/theme/theme.rs index 5f4350de..a0faa38b 100644 --- a/yazi-config/src/theme/theme.rs +++ b/yazi-config/src/theme/theme.rs @@ -131,10 +131,11 @@ pub struct Which { #[derive(Deserialize, Serialize)] pub struct Confirm { - pub border: Style, - pub title: Style, - pub content: Style, - pub list: Style, + pub border: Style, + pub title: Style, + pub content: Style, + pub list: Style, + pub btn_yes: Style, pub btn_no: Style, pub btn_labels: [String; 2], @@ -144,6 +145,9 @@ pub struct Confirm { pub struct Spot { pub border: Style, pub title: Style, + + pub tbl_col: Style, + pub tbl_cell: Style, } #[derive(Deserialize, Serialize)] diff --git a/yazi-plugin/preset/plugins/file.lua b/yazi-plugin/preset/plugins/file.lua index 4dbce3b4..cd6ccf51 100644 --- a/yazi-plugin/preset/plugins/file.lua +++ b/yazi-plugin/preset/plugins/file.lua @@ -23,8 +23,8 @@ function M:spot(job) :area(ui.Pos { "center", w = 60, h = 20 }) :row(1) :col(1) - :col_style(ui.Style():fg("blue")) - :cell_style(ui.Style():fg("yellow"):reverse()) + :col_style(th.spot.tbl_col) + :cell_style(th.spot.tbl_cell) :widths { ui.Constraint.Length(14), ui.Constraint.Fill(1) } ) end diff --git a/yazi-plugin/preset/plugins/image.lua b/yazi-plugin/preset/plugins/image.lua index 2e8efd9e..079997c3 100644 --- a/yazi-plugin/preset/plugins/image.lua +++ b/yazi-plugin/preset/plugins/image.lua @@ -33,8 +33,8 @@ function M:spot(job) :row(job.skip) :row(1) :col(1) - :col_style(ui.Style():fg("blue")) - :cell_style(ui.Style():fg("yellow"):reverse()) + :col_style(th.spot.tbl_col) + :cell_style(th.spot.tbl_cell) :widths { ui.Constraint.Length(14), ui.Constraint.Fill(1) } ) end diff --git a/yazi-plugin/preset/plugins/video.lua b/yazi-plugin/preset/plugins/video.lua index e406ed9c..0a5e075c 100644 --- a/yazi-plugin/preset/plugins/video.lua +++ b/yazi-plugin/preset/plugins/video.lua @@ -82,8 +82,8 @@ function M:spot(job) :area(ui.Pos { "center", w = 60, h = 20 }) :row(1) :col(1) - :col_style(ui.Style():fg("blue")) - :cell_style(ui.Style():fg("yellow"):reverse()) + :col_style(th.spot.tbl_col) + :cell_style(th.spot.tbl_cell) :widths { ui.Constraint.Length(14), ui.Constraint.Fill(1) } ) end