Skip to content

Conversation

@juanbrujo
Copy link
Member

Descripción

Se veía muy feo en Slack, se rediseñó el output.

Ejemplo de comportamiento

$ huemul yodev developer

Untitled

`$ npm test -- test/yodev.test.js --match="yodev*"`
`$ huemul yodev [QUERY]`
Updated comments to include detailed information about the script's functionality, dependencies, configuration, commands, examples, and author.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the job search output formatting to improve display in Slack by using Slack's Block Kit API instead of plain text formatting. The changes modernize the user interface and provide a cleaner, more structured presentation of job listings.

  • Implements Slack Block Kit formatting with sections, dividers, and context blocks for better visual hierarchy
  • Adds fallback formatting for non-Slack platforms to ensure compatibility
  • Updates emoji usage in search message and result displays

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +66 to +105
const blocks = [
{
type: 'section',
text: {
type: 'mrkdwn',
text: `Encontré ${totalJobs} resultado(s):`
}
}
]

if (job.salary) lines.push(`💰 *Sueldo:* ${job.salary}`)
if (job.type) lines.push(`🧩 *Tipo:* ${job.type}`)
if (job.source) lines.push(`🛰️ *Fuente:* ${job.source}`)
limitedJobs.forEach((job) => {
blocks.push({ type: 'divider' })

return lines.join('\n')
const lines = [`*<${job.url}|${job.title}>*`]
lines.push(`*Empresa:* ${job.company}`)
lines.push(`*Ubicación:* ${job.location}`)
if (job.posted || job.date) lines.push(`*Publicado:* ${job.posted || job.date}`)
if (job.salary) lines.push(`*Sueldo:* ${job.salary}`)
if (job.type) lines.push(`*Tipo:* ${job.type}`)
if (job.source) lines.push(`*Fuente:* ${job.source}`)

blocks.push({
type: 'section',
text: {
type: 'mrkdwn',
text: lines.join('\n')
}
})
})

if (viewMoreUrl) {
messages.push(`\n🔍 ¿Quieres ver más ofertas? Visita: ${viewMoreUrl}`)
blocks.push({ type: 'divider' })
blocks.push({
type: 'context',
elements: [{
type: 'mrkdwn',
text: `¿Quieres ver más ofertas? Visita: <${viewMoreUrl}|yodev.dev>`
}]
})
}
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Slack blocks are being built unconditionally, but they're only used when the platform is Slack. This creates unnecessary computation when the platform is not Slack. Consider moving the blocks construction inside the Slack-specific conditional block (line 107) to avoid building data structures that won't be used in non-Slack environments.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@gmq gmq merged commit 0e86cfe into devschile:master Dec 29, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants