ronantakizawa/codereview-bench huggingface dataset:
Repository: louislam/uptime-kuma
File: src/components/MonitorList.vue (Vue)

Code before:
        margin-bottom: 8px;

        form {
            width: 100%;
        }
    }
}

.search-icon {
    position: absolute;
    right: 10px;
    color: #c0c0c0;
    cursor: pointer;
    transition: all ease-in-out 0.1s;
    z-index: 1;

    &:hover {
        opacity: 0.5;
    }
}

.search-input {
    max-width: 15em;
    padding-right: 30px;

    @media (min-width: 550px) and (max-width: 769px), (min-width: 1150px) and (max-width: 1199px), (min-width: 1500px) {
        max-width: 100%;
        width: 100%;
    }
}

.monitor-item {
    width: 100%;
}

.tags {
    margin-top: 4px;
    padding-left: 67px;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.bottom-style {
    padding-left: 67px;
    margin-top: 5px;
}

@media (max-width: 550px) {
    .selection-controls {
        .selected-count {

Review comment (suggestion):
```suggestion
    @media (max-width: 549px), (min-width: 770px) and (max-width: 1149px),(min-width: 1200px) and (max-width: 1499px) {
```

Code after:
        margin-bottom: 8px;

        form {
            width: 100%;
        }
    }
}

.search-icon {
    position: absolute;
    right: 10px;
    color: #c0c0c0;
    cursor: pointer;
    transition: all ease-in-out 0.1s;
    z-index: 1;

    &:hover {
        opacity: 0.5;
    }
}

.search-input {
    max-width: 15em;
    padding-right: 30px;

    @media (max-width: 549px), (min-width: 770px) and (max-width: 1149px), (min-width: 1200px) and (max-width: 1499px) {
        max-width: 100%;
        width: 100%;
    }
}

.monitor-item {
    width: 100%;
}

.tags {
    margin-top: 4px;
    padding-left: 67px;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.bottom-style {
    padding-left: 67px;
    margin-top: 5px;
}

@media (max-width: 549px), (min-width: 770px) and (max-width: 1149px), (min-width: 1200px) and (max-width: 1499px) {
    .selection-controls {
        .selected-count {
Repository: louislam/uptime-kuma
File: src/components/MonitorList.vue (Vue)

Code before:
        width: 100%;
    }

    .gap-2 {
        gap: 0.5rem;
    }

    .selected-count {
        margin-left: auto;
    }
}

@media (max-width: 770px) {
    .list-header {
        margin: -20px;
        margin-bottom: 10px;
        padding: 5px;
    }
}

.search-wrapper {
    display: flex;
    align-items: center;
    position: relative;

    @media (min-width: 550px) and (max-width: 769px), (min-width: 1150px) and (max-width: 1199px), (min-width: 1500px) {
        order: -1;
        width: 100%;
        margin-bottom: 8px;

        form {
            width: 100%;
        }
    }
}

.search-icon {
    position: absolute;
    right: 10px;
    color: #c0c0c0;
    cursor: pointer;
    transition: all ease-in-out 0.1s;
    z-index: 1;

    &:hover {
        opacity: 0.5;
    }
}

.search-input {
    max-width: 15em;

Review comment (suggestion):
```suggestion
    @media (max-width: 549px), (min-width: 770px) and (max-width: 1149px),(min-width: 1200px) and (max-width: 1499px) {
```

Code after:
        width: 100%;
    }

    .gap-2 {
        gap: 0.5rem;
    }

    .selected-count {
        margin-left: auto;
    }
}

@media (max-width: 770px) {
    .list-header {
        margin: -20px;
        margin-bottom: 10px;
        padding: 5px;
    }
}

.search-wrapper {
    display: flex;
    align-items: center;
    position: relative;

    @media (max-width: 549px), (min-width: 770px) and (max-width: 1149px), (min-width: 1200px) and (max-width: 1499px) {
        order: -1;
        width: 100%;
        margin-bottom: 8px;

        form {
            width: 100%;
        }
    }
}

.search-icon {
    position: absolute;
    right: 10px;
    color: #c0c0c0;
    cursor: pointer;
    transition: all ease-in-out 0.1s;
    z-index: 1;

    &:hover {
        opacity: 0.5;
    }
}

.search-input {
    max-width: 15em;
Repository: louislam/uptime-kuma
File: src/components/MonitorList.vue (Vue)

Code before:
    border-bottom: 1px solid #dee2e6;
    border-radius: 10px 10px 0 0;
    margin: -10px;
    margin-bottom: 10px;
    padding: 10px;

    .dark & {
        background-color: $dark-header-bg;
        border-bottom: 0;
    }
}

.search-row {
    display: flex;
    padding: 10px;
    padding-bottom: 5px;
}

.header-top {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    padding: 10px;

    @media (min-width: 550px) and (max-width: 769px), (min-width: 1150px) and (max-width: 1199px), (min-width: 1500px) {
        flex-wrap: wrap;
    }
}

.select-checkbox-wrapper {
    display: flex;
    align-items: center;

    .form-check-input {
        cursor: pointer;
        margin: 0;
    }
}

.header-filter {
    display: flex;
    align-items: center;
}

.actions-wrapper {
    display: flex;
    align-items: center;

    .dropdown-toggle {
        white-space: nowrap;

Review comment (suggestion):
```suggestion
    @media (max-width: 549px), (min-width: 770px) and (max-width: 1149px),(min-width: 1200px) and (max-width: 1499px) {
```

Code after:
    border-bottom: 1px solid #dee2e6;
    border-radius: 10px 10px 0 0;
    margin: -10px;
    margin-bottom: 10px;
    padding: 10px;

    .dark & {
        background-color: $dark-header-bg;
        border-bottom: 0;
    }
}

.search-row {
    display: flex;
    padding: 10px;
    padding-bottom: 5px;
}

.header-top {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    padding: 10px;

    @media (max-width: 549px), (min-width: 770px) and (max-width: 1149px), (min-width: 1200px) and (max-width: 1499px) {
        flex-wrap: wrap;
    }
}

.select-checkbox-wrapper {
    display: flex;
    align-items: center;

    .form-check-input {
        cursor: pointer;
        margin: 0;
    }
}

.header-filter {
    display: flex;
    align-items: center;
}

.actions-wrapper {
    display: flex;
    align-items: center;

    .dropdown-toggle {
        white-space: nowrap;
Repository: louislam/uptime-kuma
File: db/knex_migrations/2025-10-15-0001-add-monitor-response-config.js (JavaScript)

Code before:
exports.up = function (knex) {
    return knex.schema.alterTable("monitor", function (table) {
        table.boolean("save_response").notNullable().defaultTo(false);
        table.boolean("save_error_response").notNullable().defaultTo(false);
        table.integer("response_max_length").defaultTo(10240); // Default 10KB
    });
};

exports.down = function (knex) {
    return knex.schema.alterTable("monitor", function (table) {
        table.dropColumn("save_response");
        table.dropColumn("save_error_response");
        table.dropColumn("response_max_length");
    });
};


Review comment (bug):
Since this is likely what users will want and doing it this way makes building a debugging-UI further on simpler, lets enable this.

Please also in the frontend enable this by default 😉

```suggestion
        table.boolean("save_error_response").notNullable().defaultTo(true);
```

Code after:
exports.up = function (knex) {
    return knex.schema.alterTable("monitor", function (table) {
        table.boolean("save_response").notNullable().defaultTo(false);
        table.boolean("save_error_response").notNullable().defaultTo(true);
        table.integer("response_max_length").notNullable().defaultTo(10240); // Default 10KB
    });
};

exports.down = function (knex) {
    return knex.schema.alterTable("monitor", function (table) {
        table.dropColumn("save_response");
        table.dropColumn("save_error_response");
        table.dropColumn("response_max_length");
    });
};
Repository: louislam/uptime-kuma
File: db/knex_migrations/2026-01-15-0000-add-json-query-retry-only-status-code.js (JavaScript)

Code before:
/* SQL:
ALTER TABLE monitor ADD retry_only_on_status_code_failure BOOLEAN default 0 not null;
*/
exports.up = function (knex) {
    // Add new column to table monitor for json-query retry behavior
    return knex.schema.alterTable("monitor", function (table) {
        table.boolean("retry_only_on_status_code_failure").defaultTo(false).notNullable();
    });
};

exports.down = function (knex) {
    return knex.schema.alterTable("monitor", function (table) {
        table.dropColumn("retry_only_on_status_code_failure");
    });
};


Review comment (suggestion):
```suggestion
exports.up = function (knex) {
    // Add new column to table monitor for json-query retry behavior
```

Code after:
exports.up = function (knex) {
    // Add new column to table monitor for json-query retry behavior
    return knex.schema.alterTable("monitor", function (table) {
        table.boolean("retry_only_on_status_code_failure").defaultTo(false).notNullable();
    });
};

exports.down = function (knex) {
    return knex.schema.alterTable("monitor", function (table) {
        table.dropColumn("retry_only_on_status_code_failure");
    });
};
Repository: louislam/uptime-kuma
File: db/knex_migrations/2025-10-15-0001-add-monitor-response-config.js (JavaScript)

Code before:
exports.up = function (knex) {
    return knex.schema.alterTable("monitor", function (table) {
        table.boolean("save_response").notNullable().defaultTo(false);
        table.boolean("save_error_response").notNullable().defaultTo(true);
        table.integer("response_max_length").notNullable().defaultTo(256); // Default 256B
    });
};

exports.down = function (knex) {
    return knex.schema.alterTable("monitor", function (table) {
        table.dropColumn("save_response");
        table.dropColumn("save_error_response");
        table.dropColumn("response_max_length");
    });
};


Review comment (suggestion):
okay, maybe higher a bit

```suggestion
        table.integer("response_max_length").notNullable().defaultTo(1024); // Default 1KB
```

Code after:
exports.up = function (knex) {
    return knex.schema.alterTable("monitor", function (table) {
        table.boolean("save_response").notNullable().defaultTo(false);
        table.boolean("save_error_response").notNullable().defaultTo(true);
        table.integer("response_max_length").notNullable().defaultTo(1024); // Default 1KB
    });
};

exports.down = function (knex) {
    return knex.schema.alterTable("monitor", function (table) {
        table.dropColumn("save_response");
        table.dropColumn("save_error_response");
        table.dropColumn("response_max_length");
    });
};
Repository: louislam/uptime-kuma
File: db/knex_migrations/2026-01-16-0000-add-screenshot-delay.js (JavaScript)

Code before:
exports.up = function (knex) {
    return knex.schema.alterTable("monitor", function (table) {
        table.integer("screenshot_delay").defaultTo(0);
    });
};

exports.down = function (knex) {
    return knex.schema.alterTable("monitor", function (table) {
        table.dropColumn("screenshot_delay");
    });
};


Review comment (suggestion):
```suggestion
        table.integer("screenshot_delay").notNullable().defaultTo(0);
```

Code after:
exports.up = function (knex) {
    return knex.schema.alterTable("monitor", function (table) {
        table.integer("screenshot_delay").notNullable().unsigned().defaultTo(0);
    });
};

exports.down = function (knex) {
    return knex.schema.alterTable("monitor", function (table) {
        table.dropColumn("screenshot_delay");
    });
};
Repository: louislam/uptime-kuma
File: db/knex_migrations/2026-01-16-0000-add-screenshot-delay.js (JavaScript)

Code before:
exports.up = function (knex) {
    return knex.schema.alterTable("monitor", function (table) {
        table.integer("screenshot_delay").notNullable().defaultTo(0);
    });
};

exports.down = function (knex) {
    return knex.schema.alterTable("monitor", function (table) {
        table.dropColumn("screenshot_delay");
    });
};


Review comment (suggestion):
```suggestion
        table.integer("screenshot_delay").notNullable().unsigned().defaultTo(0);
```

Code after:
exports.up = function (knex) {
    return knex.schema.alterTable("monitor", function (table) {
        table.integer("screenshot_delay").notNullable().unsigned().defaultTo(0);
    });
};

exports.down = function (knex) {
    return knex.schema.alterTable("monitor", function (table) {
        table.dropColumn("screenshot_delay");
    });
};
Repository: louislam/uptime-kuma
File: server/notification-providers/wecom.js (JavaScript)

Code before:
     * @returns {object} Message
     */
    composeMessage(notification, heartbeatJSON, msg) {
        let title = "UptimeKuma Message";
        if (msg != null && heartbeatJSON != null && heartbeatJSON["status"] === UP) {
            title = "UptimeKuma Monitor Up";
        }
        if (msg != null && heartbeatJSON != null && heartbeatJSON["status"] === DOWN) {
            title = "UptimeKuma Monitor Down";
        }

        let textObj = {
            content: title + "\n" + msg,
        };

        // Handle mentioned_mobile_list if configured
        if (notification.weComMentionedMobileList && notification.weComMentionedMobileList.trim()) {
            // Split by comma, trim whitespace, and filter out empty strings
            let mobileList = notification.weComMentionedMobileList
                .split(",")
                .map((mobile) => mobile.trim())
                .filter((mobile) => mobile.length > 0);

            if (mobileList.length > 0) {
                textObj.mentioned_mobile_list = mobileList;
            }
        }

        return {
            msgtype: "text",
            text: textObj,
        };
    }
}

module.exports = WeCom;


Review comment (suggestion):
```suggestion
        if (notification.weComMentionedMobileList?.trim()) {
            let mentionedMobiles = notification.weComMentionedMobileList
                .split(",")
                .map((mobile) => mobile.trim())
                .filter((mobile) => mobile.length > 0);

            if (mobileList.length > 0) {
                textObj.mentioned_mobile_list = mentionedMobiles;
            }
```

Code after:
     * @returns {object} Message
     */
    composeMessage(notification, heartbeatJSON, msg) {
        let title = "UptimeKuma Message";
        if (msg != null && heartbeatJSON != null && heartbeatJSON["status"] === UP) {
            title = "UptimeKuma Monitor Up";
        }
        if (msg != null && heartbeatJSON != null && heartbeatJSON["status"] === DOWN) {
            title = "UptimeKuma Monitor Down";
        }

        let textObj = {
            content: title + "\n" + msg,
        };

        // Handle mentioned_mobile_list if configured
        if (notification.weComMentionedMobileList?.trim()) {
            let mentionedMobiles = notification.weComMentionedMobileList
                .split(",")
                .map((mobile) => mobile.trim())
                .filter((mobile) => mobile.length > 0);

            if (mentionedMobiles.length > 0) {
                textObj.mentioned_mobile_list = mentionedMobiles;
            }
        }

        return {
            msgtype: "text",
            text: textObj,
        };
    }
}

module.exports = WeCom;
Repository: louislam/uptime-kuma
File: server/notification-providers/wecom.js (JavaScript)

Code before:
     * @param {object} heartbeatJSON Heartbeat details (For Up/Down only)
     * @param {string} msg General message
     * @returns {object} Message
     */
    composeMessage(notification, heartbeatJSON, msg) {
        let title = "UptimeKuma Message";
        if (msg != null && heartbeatJSON != null && heartbeatJSON["status"] === UP) {
            title = "UptimeKuma Monitor Up";
        }
        if (msg != null && heartbeatJSON != null && heartbeatJSON["status"] === DOWN) {
            title = "UptimeKuma Monitor Down";
        }

        let textObj = {
            content: title + "\n" + msg,
        };

        // Handle mentioned_mobile_list if configured
        if (notification.weComMentionedMobileList?.trim()) {
            let mentionedMobiles = notification.weComMentionedMobileList
                .split(",")
                .map((mobile) => mobile.trim())
                .filter((mobile) => mobile.length > 0);

            if (mobileList.length > 0) {
                textObj.mentioned_mobile_list = mentionedMobiles;
            }
        }

        return {
            msgtype: "text",
            text: textObj,
        };
    }
}

module.exports = WeCom;


Review comment (suggestion):
```suggestion
            if (mentionedMobiles.length > 0) {
                textObj.mentioned_mobile_list = mentionedMobiles;
```


Code after:
     * @param {object} heartbeatJSON Heartbeat details (For Up/Down only)
     * @param {string} msg General message
     * @returns {object} Message
     */
    composeMessage(notification, heartbeatJSON, msg) {
        let title = "UptimeKuma Message";
        if (msg != null && heartbeatJSON != null && heartbeatJSON["status"] === UP) {
            title = "UptimeKuma Monitor Up";
        }
        if (msg != null && heartbeatJSON != null && heartbeatJSON["status"] === DOWN) {
            title = "UptimeKuma Monitor Down";
        }

        let textObj = {
            content: title + "\n" + msg,
        };

        // Handle mentioned_mobile_list if configured
        if (notification.weComMentionedMobileList?.trim()) {
            let mentionedMobiles = notification.weComMentionedMobileList
                .split(",")
                .map((mobile) => mobile.trim())
                .filter((mobile) => mobile.length > 0);

            if (mentionedMobiles.length > 0) {
                textObj.mentioned_mobile_list = mentionedMobiles;
            }
        }

        return {
            msgtype: "text",
            text: textObj,
        };
    }
}

module.exports = WeCom;
Repository: louislam/uptime-kuma
File: src/components/notifications/Ntfy.vue (Vue)

Code before:
    },
    mounted() {
        if (typeof this.$parent.notification.ntfyPriority === "undefined") {
            this.$parent.notification.ntfyserverurl = "https://ntfy.sh";
            this.$parent.notification.ntfyPriority = 5;
        }

        // Setting down priority if it's undefined
        if (typeof this.$parent.notification.ntfyPriorityDown === "undefined") {
            this.$parent.notification.ntfyPriorityDown = 5;
        }

        // Handling notifications that added before 1.22.0
        if (typeof this.$parent.notification.ntfyAuthenticationMethod === "undefined") {
            if (!this.$parent.notification.ntfyusername) {
                this.$parent.notification.ntfyAuthenticationMethod = "none";
            } else {
                this.$parent.notification.ntfyAuthenticationMethod = "usernamePassword";
            }
        }

        // Auto-enable template checkbox if either field has content
        if (typeof this.$parent.notification.ntfyUseTemplate === "undefined") {
            const hasTitle = this.$parent.notification.ntfyCustomTitle?.trim();
            const hasMessage = this.$parent.notification.ntfyCustomMessage?.trim();
            this.$parent.notification.ntfyUseTemplate = !!(hasTitle || hasMessage);
        }
    },
};
</script>


Review comment (suggestion):
```suggestion
            const hasTitle = !!this.$parent.notification.ntfyCustomTitle?.trim();
            const hasMessage = !!this.$parent.notification.ntfyCustomMessage?.trim();
            this.$parent.notification.ntfyUseTemplate = hasTitle || hasMessage;
```

Code after:
    },
    mounted() {
        if (typeof this.$parent.notification.ntfyPriority === "undefined") {
            this.$parent.notification.ntfyserverurl = "https://ntfy.sh";
            this.$parent.notification.ntfyPriority = 5;
        }

        // Setting down priority if it's undefined
        if (typeof this.$parent.notification.ntfyPriorityDown === "undefined") {
            this.$parent.notification.ntfyPriorityDown = 5;
        }

        // Handling notifications that added before 1.22.0
        if (typeof this.$parent.notification.ntfyAuthenticationMethod === "undefined") {
            if (!this.$parent.notification.ntfyusername) {
                this.$parent.notification.ntfyAuthenticationMethod = "none";
            } else {
                this.$parent.notification.ntfyAuthenticationMethod = "usernamePassword";
            }
        }

        // Auto-enable template checkbox if either field has content
        if (typeof this.$parent.notification.ntfyUseTemplate === "undefined") {
            const hasTitle = !!this.$parent.notification.ntfyCustomTitle?.trim();
            const hasMessage = !!this.$parent.notification.ntfyCustomMessage?.trim();
            this.$parent.notification.ntfyUseTemplate = hasTitle || hasMessage;
        }
    },
};
</script>
Repository: louislam/uptime-kuma
File: src/components/notifications/JiraServiceManagement.vue (Vue)

Code before:
<template>
    <div class="mb-3">
        <label for="jsm-cloud-id" class="form-label">
            {{ $t("Cloud ID") }}
            <span style="color: red"><sup>*</sup></span>
        </label>
        <input id="jsm-cloud-id" v-model="$parent.notification.jsmCloudId" type="text" class="form-control" required />
    </div>
    <div class="mb-3">
        <label for="jsm-email" class="form-label">
            {{ $t("Email") }}
            <span style="color: red"><sup>*</sup></span>
        </label>
        <input id="jsm-email" v-model="$parent.notification.jsmEmail" type="email" class="form-control" required />
    </div>
    <div class="mb-3">
        <label for="jsm-api-token" class="form-label">
            {{ $t("API Token") }}
            <span style="color: red"><sup>*</sup></span>
        </label>
        <HiddenInput
            id="jsm-api-token"
            v-model="$parent.notification.jsmApiToken"
            required="true"
            autocomplete="false"
        ></HiddenInput>
    </div>
    <div class="mb-3">
        <label for="jsm-priority" class="form-label">{{ $t("Priority") }}</label>

Review comment (suggestion):
Below, you are not translation this.
Do you think this can be translated?

I think this is a name which is fairly unlikely to have a good translation, or?


```suggestion
            Cloud ID
```


Code after:
<template>
    <div class="mb-3">
        <label for="jsm-cloud-id" class="form-label">
            {{ $t("Cloud ID") }}
            <span style="color: red"><sup>*</sup></span>
        </label>
        <input id="jsm-cloud-id" v-model="$parent.notification.jsmCloudId" type="text" class="form-control" required />
        <i18n-t tag="p" keypath="aboutJiraCloudId" style="margin-top: 8px">
            <a href="https://support.atlassian.com/jira/kb/retrieve-my-atlassian-sites-cloud-id/" target="_blank">
                {{ $t("see Jira Cloud Docs") }}
            </a>
        </i18n-t>
    </div>
    <div class="mb-3">
        <label for="jsm-email" class="form-label">
            {{ $t("Email") }}
            <span style="color: red"><sup>*</sup></span>
        </label>
        <input id="jsm-email" v-model="$parent.notification.jsmEmail" type="email" class="form-control" required />
    </div>
    <div class="mb-3">
        <label for="jsm-api-token" class="form-label">
            {{ $t("API Token") }}
            <span style="color: red"><sup>*</sup></span>
        </label>
        <HiddenInput
            id="jsm-api-token"
            v-model="$parent.notification.jsmApiToken"
            required="true"