fix: adaptar formato de respuestas al modo compacto

Co-authored-by: aider (openrouter/openai/gpt-5) <aider@aider.chat>
pull/1/head
borja 2 months ago
parent 0401f1661c
commit ca09b82390

@ -238,17 +238,17 @@ export class CommandService {
const rendered = items.map((t) => {
const isOverdue = t.due_date ? t.due_date < todayYMD : false;
const datePart = t.due_date ? `${isOverdue ? `${ICONS.warn} ` : ''}${ICONS.date} ${formatDDMM(t.due_date)}` : '';
return `- ${codeId(t.id)} ${t.description || '(sin descripción)'}${datePart}${ICONS.unassigned} sin responsable`;
return `- ${t.id}) _${t.description || '(sin descripción)'}_${datePart}${ICONS.unassigned} sin responsable`;
});
const total = TaskService.countGroupUnassigned(context.groupId);
if (total > items.length) {
rendered.push(italic(`… y ${total - items.length} más`));
rendered.push(`… y ${total - items.length} más`);
}
return [{
recipient: context.sender,
message: [bold(`${groupName} — Sin responsable`), ...rendered].join('\n')
message: [`${groupName} — Sin responsable`, ...rendered].join('\n')
}];
}
@ -276,7 +276,7 @@ export class CommandService {
(groupId && GroupSyncService.activeGroupsCache.get(groupId)) ||
(groupId && groupId !== '(sin grupo)' ? groupId : 'Sin grupo');
sections.push(bold(groupName));
sections.push(groupName);
const rendered = await Promise.all(arr.map(async (t) => {
const names = await Promise.all(
(t.assignees || []).map(async (uid) => (await ContactsService.getDisplayName(uid)) || uid)
@ -287,14 +287,14 @@ export class CommandService {
: `${t.assignees!.length > 1 ? '👥' : '👤'} ${names.join(', ')}`;
const isOverdue = t.due_date ? t.due_date < todayYMD : false;
const datePart = t.due_date ? `${isOverdue ? `${ICONS.warn} ` : ''}${ICONS.date} ${formatDDMM(t.due_date)}` : '';
return `- ${codeId(t.id)} ${t.description || '(sin descripción)'}${datePart}${owner}`;
return `- ${t.id}) _${t.description || '(sin descripción)'}_${datePart}${owner}`;
}));
sections.push(...rendered);
}
const totalMy = TaskService.countUserPending(context.sender);
if (totalMy > myItems.length) {
sections.push(italic(`… y ${totalMy - myItems.length} más`));
sections.push(`… y ${totalMy - myItems.length} más`);
}
} else {
sections.push('No tienes tareas pendientes.');
@ -308,17 +308,17 @@ export class CommandService {
const groupName = GroupSyncService.activeGroupsCache.get(context.groupId) || context.groupId;
const unassigned = TaskService.listGroupUnassigned(context.groupId, LIMIT);
if (unassigned.length > 0) {
sections.push(bold(`${groupName} — Sin responsable`));
sections.push(`${groupName} — Sin responsable`);
const renderedUnassigned = unassigned.map((t) => {
const isOverdue = t.due_date ? t.due_date < todayYMD : false;
const datePart = t.due_date ? `${isOverdue ? `${ICONS.warn} ` : ''}${ICONS.date} ${formatDDMM(t.due_date)}` : '';
return `- ${codeId(t.id)} ${t.description || '(sin descripción)'}${datePart}${ICONS.unassigned} sin responsable`;
return `- ${t.id}) _${t.description || '(sin descripción)'}_${datePart}${ICONS.unassigned} sin responsable`;
});
sections.push(...renderedUnassigned);
const totalUnassigned = TaskService.countGroupUnassigned(context.groupId);
if (totalUnassigned > unassigned.length) {
sections.push(italic(`… y ${totalUnassigned - unassigned.length} más`));
sections.push(`… y ${totalUnassigned - unassigned.length} más`);
}
} else {
sections.push(`${groupName} — Sin responsable\n(no hay tareas sin responsable)`);
@ -336,17 +336,17 @@ export class CommandService {
gid;
if (unassigned.length > 0) {
sections.push(bold(`${groupName} — Sin responsable`));
sections.push(`${groupName} — Sin responsable`);
const renderedUnassigned = unassigned.map((t) => {
const isOverdue = t.due_date ? t.due_date < todayYMD : false;
const datePart = t.due_date ? `${isOverdue ? `${ICONS.warn} ` : ''}${ICONS.date} ${formatDDMM(t.due_date)}` : '';
return `- ${codeId(t.id)} ${t.description || '(sin descripción)'}${datePart}${ICONS.unassigned} sin responsable`;
return `- ${t.id}) _${t.description || '(sin descripción)'}_${datePart}${ICONS.unassigned} sin responsable`;
});
sections.push(...renderedUnassigned);
const totalUnassigned = TaskService.countGroupUnassigned(gid);
if (totalUnassigned > unassigned.length) {
sections.push(italic(`… y ${totalUnassigned - unassigned.length} más`));
sections.push(`… y ${totalUnassigned - unassigned.length} más`);
}
}
}
@ -406,7 +406,7 @@ export class CommandService {
: `${t.assignees!.length > 1 ? '👥' : '👤'} ${names.join(', ')}`;
const isOverdue = t.due_date ? t.due_date < todayYMD : false;
const datePart = t.due_date ? `${isOverdue ? `${ICONS.warn} ` : ''}${ICONS.date} ${formatDDMM(t.due_date)}` : '';
return `- ${codeId(t.id)} ${t.description || '(sin descripción)'}${datePart}${owner}`;
return `- ${t.id}) _${t.description || '(sin descripción)'}_${datePart}${owner}`;
}));
const total = TaskService.countGroupPending(context.groupId);
@ -416,7 +416,7 @@ export class CommandService {
return [{
recipient: context.sender,
message: [bold(groupName), ...rendered].join('\n')
message: [groupName, ...rendered].join('\n')
}];
}
@ -446,7 +446,7 @@ export class CommandService {
(groupId && GroupSyncService.activeGroupsCache.get(groupId)) ||
(groupId && groupId !== '(sin grupo)' ? groupId : 'Sin grupo');
sections.push(bold(groupName));
sections.push(groupName);
const rendered = await Promise.all(arr.map(async (t) => {
const names = await Promise.all(
(t.assignees || []).map(async (uid) => (await ContactsService.getDisplayName(uid)) || uid)
@ -457,13 +457,13 @@ export class CommandService {
: `${t.assignees!.length > 1 ? '👥' : '👤'} ${names.join(', ')}`;
const isOverdue = t.due_date ? t.due_date < todayYMD : false;
const datePart = t.due_date ? `${isOverdue ? `${ICONS.warn} ` : ''}${ICONS.date} ${formatDDMM(t.due_date)}` : '';
return `- ${codeId(t.id)} ${t.description || '(sin descripción)'}${datePart}${owner}`;
return `- ${t.id}) _${t.description || '(sin descripción)'}_${datePart}${owner}`;
}));
sections.push(...rendered);
}
if (total > items.length) {
sections.push(italic(`… y ${total - items.length} más`));
sections.push(`… y ${total - items.length} más`);
}
return [{
@ -514,16 +514,10 @@ export class CommandService {
}];
}
const dueLine = res.task?.due_date ? `${ICONS.date} ${formatDDMM(res.task?.due_date)}` : '';
const lines = [
`${ICONS.complete} ${codeId(id)} completada`,
`${res.task?.description || '(sin descripción)'}`,
dueLine,
italic(`Gracias, ${who}.`)
].filter(Boolean);
const due = res.task?.due_date ? `${ICONS.date} ${formatDDMM(res.task?.due_date)}` : '';
return [{
recipient: context.sender,
message: lines.join('\n')
message: `${ICONS.complete} ${codeId(id)} completada — ${res.task?.description || '(sin descripción)'}${due}`
}];
}

Loading…
Cancel
Save