fix: update provisioning step label for clarity

- Changed the label for the 'monitoring' step from 'Wait for files' to 'Provisioning' to better reflect the current process.
- Adjusted regex patterns in mention linkification functions to improve matching accuracy for mentions in markdown.
This commit is contained in:
iliya 2026-03-13 14:56:52 +02:00
parent 0df13e206b
commit ba083c317b
2 changed files with 9 additions and 5 deletions

View file

@ -3,7 +3,7 @@ export type ProvisioningStep = (typeof STEP_ORDER)[number];
export const STEP_LABELS: Record<ProvisioningStep, string> = { export const STEP_LABELS: Record<ProvisioningStep, string> = {
validating: 'Validate', validating: 'Validate',
spawning: 'Start CLI', spawning: 'Start CLI',
monitoring: 'Wait for files', monitoring: 'Provisioning',
verifying: 'Verify', verifying: 'Verify',
ready: 'Ready', ready: 'Ready',
}; };

View file

@ -24,8 +24,10 @@ export function linkifyMentionsInMarkdown(
// Sort by name length descending for greedy matching // Sort by name length descending for greedy matching
const names = [...memberColorMap.keys()].sort((a, b) => b.length - a.length); const names = [...memberColorMap.keys()].sort((a, b) => b.length - a.length);
const escaped = names.map((n) => n.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')); const escaped = names.map((n) => n.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'));
// eslint-disable-next-line no-useless-escape -- escaped chars needed for regex character class const pattern = new RegExp(
const pattern = new RegExp(`(^|\\s)@(${escaped.join('|')})(?=[\\s,.:;!?)\\]}\-]|$)`, 'gi'); `(^|[\\s(\\[{"\'])@(${escaped.join('|')})(?=[\\s,.:;!?)\\]}\-]|$)`,
'gi'
);
return text.replace(pattern, (_match, prefix: string, name: string) => { return text.replace(pattern, (_match, prefix: string, name: string) => {
// Find the canonical name (case-insensitive lookup) // Find the canonical name (case-insensitive lookup)
@ -53,8 +55,10 @@ export function linkifyTeamMentionsInMarkdown(
// Sort by name length descending for greedy matching // Sort by name length descending for greedy matching
const sorted = [...names].sort((a, b) => b.length - a.length); const sorted = [...names].sort((a, b) => b.length - a.length);
const escaped = sorted.map((n) => n.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')); const escaped = sorted.map((n) => n.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'));
// eslint-disable-next-line no-useless-escape -- escaped chars needed for regex character class const pattern = new RegExp(
const pattern = new RegExp(`(^|\\s)@(${escaped.join('|')})(?=[\\s,.:;!?)\\]}\-]|$)`, 'gi'); `(^|[\\s(\\[{"\'])@(${escaped.join('|')})(?=[\\s,.:;!?)\\]}\-]|$)`,
'gi'
);
return text.replace(pattern, (_match, prefix: string, name: string) => { return text.replace(pattern, (_match, prefix: string, name: string) => {
const canonical = sorted.find((n) => n.toLowerCase() === name.toLowerCase()) ?? name; const canonical = sorted.find((n) => n.toLowerCase() === name.toLowerCase()) ?? name;