Staff Management System V1.1#190
Conversation
|
Thanks for the PR! One thing on the Components V2 activity-check fix — When the activity-check message was sent via A couple of fix options: clear the components unconditionally regardless of whether embeds are present, or branch on the V2 flag and rebuild the V2 component tree to mark the check as ended. |
|
Thanks for the reply! This should be the fix. |
|
Thanks for the feedback, just fixed that one specified one. I will also actually apply it to some other places if you don't mind. |
Co-authored-by: Copilot <copilot@github.com>
|
Thanks for the quick turnaround! One more thing on this path — for V2 templates the new code does run, but the resulting Two ways to keep the body visible:
Both keep the original check context visible to users while removing the live button. The first is the smaller change; the second lets you also tweak the styling/title to indicate the check has ended. |
|
Actually just came to this solution, I think it would be great if the user can configure the end message to their liking to like show other text and maybe other custom buttons etc. I will implement that logic which would probably also simplify this a bit |
Co-authored-by: Copilot <copilot@github.com>
|
I changed logic for this, though to make this reliable I had to add 2 new columns to a DB model, though I am interested to know if the migration process with the SCNX hosted bots will work to update it properly. |
Co-authored-by: Copilot <copilot@github.com>
|
Heads-up while integrating this into our closed-source build for SCNX — small edge case in the new const initiator = activeCheck.isAutomated
? localize('staff-management-system', 'label-system')
: `<@${activeCheck.initiatorId}>`;For activity checks that were already active at the time a server upgrades to this version, the migration backfills One-line fix: treat a missing const initiator = (activeCheck.isAutomated || !activeCheck.initiatorId)
? localize('staff-management-system', 'label-system')
: `<@${activeCheck.initiatorId}>`;We're applying this on our side already so SCNX users won't be affected — flagging it here in case you'd like to include it in this PR or address it separately. |
|
Side note unrelated to this PR — the broader SMG module has a lot of repeated // 1. Parse-if-string defensive guard
if (typeof template === 'string') {
try { template = JSON.parse(template); } catch (e) {}
}
// 2. Deep-clone via stringify+parse, then patch _schema
template = JSON.parse(JSON.stringify(template));
if (template?.embeds && !template._schema) template._schema = 'v3';Both end up being no-ops in practice:
The cleaner shape that matches the rest of the codebase is just: let msgOpts = await embedTypeV2(config.fieldName, placeholders);For the legacy-config edge case (configs persisted before Not a blocker for this PR — just flagging since you're already iterating on the module. Happy to open a separate cleanup PR if useful. |
|
Thanks for the comments - i've addressed the first one locally as well. Since your second comment was a bit vague (are these Claude comments?), should I address the JSON.parse/stringify changes inside this PR or for a different next PR for SMG? |
|
Re: cleanup — separate PR makes sense, would muddy this diff. Happy to open one for SMG once this lands. On the workflow: yeah, fair to ask. I do a manual review locally and test the changes myself, then run Claude alongside it to quickly catch major issues (like the While we're here, one more thing that came up during the merge that I held off on flagging — and the fix isn't in the current PR head, so it'd need a follow-up commit. The previous version had: let embedTemplate = typeof config.checkMessage === 'string'
? JSON.parse(config.checkMessage)
: config.checkMessage;
let msgOpts = await embedTypeV2(embedTemplate, { ... });The refactor (around line 1417) removed the The error path matters here: the Cleanest fix is to pass let msgOpts = await embedTypeV2(config.checkMessage, {
'%end-time%': dateToDiscordTimestamp(endTime, 'F'),
// ...rest of placeholders...
});We're already running this patch in our build, so SCNX users won't see the regression. |
|
Alright I have pushed the changes according to the feedback ^^ |
This updates the SMG module according to user feedbacks (latest 24 - 48hrs) and other bug reports
Changes:
No AI usage in this PR