ux(coding-agent): standardized elision indicators in scraper output
- Replaced inconsistent list truncation messages with a standardized `[...N items elided...]` format across all scrapers. - Updated documentation reference to use consistent variable naming convention.
This commit is contained in:
@@ -262,7 +262,7 @@ width models in measure-vs-slice produced crashes.
|
||||
|
||||
- Fast path: printable ASCII is one cell per code unit.
|
||||
- Anything past the ASCII prefix measures through `Bun.stringWidth` (CSI/OSC
|
||||
stripped to zero); tabs are added back at `getDefaultTabWidth()` columns.
|
||||
stripped to zero); tabs are added back at the fixed `DEFAULT_TAB_WIDTH` columns.
|
||||
- OSC 66 sized spans are added back as `scale × (explicit w ?? payload width)` —
|
||||
`Bun.stringWidth` would otherwise strip the whole span to zero.
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ export const handleFirefoxAddons: SpecialHandler = async (
|
||||
md += `- ${permission}\n`;
|
||||
}
|
||||
if (permissions.length > preview.length) {
|
||||
md += `\n*...and ${permissions.length - preview.length} more*\n`;
|
||||
md += `\n[…${permissions.length - preview.length} permissions elided…]\n`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ export const handleGoPkg: SpecialHandler = async (
|
||||
sections.push(exported.slice(0, 50).join("\n"));
|
||||
if (exported.length > 50) {
|
||||
notes.push(`showing 50 of ${exported.length} exports`);
|
||||
sections.push(`\n... and ${exported.length - 50} more`);
|
||||
sections.push(`\n[…${exported.length - 50} exports elided…]`);
|
||||
}
|
||||
sections.push("");
|
||||
}
|
||||
@@ -240,7 +240,7 @@ export const handleGoPkg: SpecialHandler = async (
|
||||
sections.push(imports.slice(0, 20).join("\n"));
|
||||
if (imports.length > 20) {
|
||||
notes.push(`showing 20 of ${imports.length} imports`);
|
||||
sections.push(`\n... and ${imports.length - 20} more`);
|
||||
sections.push(`\n[…${imports.length - 20} imports elided…]`);
|
||||
}
|
||||
sections.push("");
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ function formatModuleMarkdown(module: ModuleResponse, release: ReleaseResponse |
|
||||
md += "\n";
|
||||
}
|
||||
if (runtimeDeps.length > 20) {
|
||||
md += `\n*...and ${runtimeDeps.length - 20} more*\n`;
|
||||
md += `\n[…${runtimeDeps.length - 20} dependencies elided…]\n`;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -212,7 +212,7 @@ function formatReleaseMarkdown(release: ReleaseResponse): string {
|
||||
md += "\n";
|
||||
}
|
||||
if (runtimeDeps.length > 20) {
|
||||
md += `\n*...and ${runtimeDeps.length - 20} more*\n`;
|
||||
md += `\n[…${runtimeDeps.length - 20} dependencies elided…]\n`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ export const handleNvd: SpecialHandler = async (
|
||||
md += `- \`${cpe}\`\n`;
|
||||
}
|
||||
if (cpes.length > 20) {
|
||||
md += `\n*...and ${cpes.length - 20} more*\n`;
|
||||
md += `\n[…${cpes.length - 20} CPEs elided…]\n`;
|
||||
}
|
||||
md += "\n";
|
||||
}
|
||||
@@ -195,7 +195,7 @@ export const handleNvd: SpecialHandler = async (
|
||||
md += `- ${ref.url}${tags}\n`;
|
||||
}
|
||||
if (vuln.references.length > 15) {
|
||||
md += `\n*...and ${vuln.references.length - 15} more references*\n`;
|
||||
md += `\n[…${vuln.references.length - 15} references elided…]\n`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ function formatTagList(tags: string[], maxItems: number): string {
|
||||
const limited = tags.slice(0, maxItems);
|
||||
const formatted = limited.map(tag => `\`${tag}\``).join(", ");
|
||||
if (tags.length > maxItems) {
|
||||
return `${formatted} (and ${tags.length - maxItems} more)`;
|
||||
return `${formatted} […${tags.length - maxItems} tags elided…]`;
|
||||
}
|
||||
return formatted;
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ export const handleOpenCorporates: SpecialHandler = async (
|
||||
md += "\n";
|
||||
}
|
||||
if (inactiveOfficers.length > 10) {
|
||||
md += `\n*...and ${inactiveOfficers.length - 10} more former officers*\n`;
|
||||
md += `\n[…${inactiveOfficers.length - 10} former officers elided…]\n`;
|
||||
}
|
||||
md += "\n";
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ export const handlePubDev: SpecialHandler = async (url: string, timeout: number,
|
||||
md += "\n";
|
||||
}
|
||||
if (deps.length > 20) {
|
||||
md += `\n*...and ${deps.length - 20} more*\n`;
|
||||
md += `\n[…${deps.length - 20} dependencies elided…]\n`;
|
||||
}
|
||||
md += "\n";
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ export const handleRepology: SpecialHandler = async (
|
||||
}
|
||||
|
||||
if (packages.length > 15) {
|
||||
md += `\n*...and ${packages.length - 15} more repositories*\n`;
|
||||
md += `\n[…${packages.length - 15} repositories elided…]\n`;
|
||||
}
|
||||
|
||||
md += `\n---\n\n[View on Repology](${url})\n`;
|
||||
|
||||
@@ -294,7 +294,7 @@ async function renderSearch(
|
||||
}
|
||||
|
||||
if (results.length > maxResults) {
|
||||
md += `... and ${results.length - maxResults} more results\n`;
|
||||
md += `[…${results.length - maxResults} results elided…]\n`;
|
||||
}
|
||||
|
||||
return { content: md, ok: true };
|
||||
|
||||
@@ -150,7 +150,7 @@ async function handleModuleUrl(
|
||||
md += `| ${input.name} | \`${type}\` | ${required} | ${desc} |\n`;
|
||||
}
|
||||
if (inputs.length > 30) {
|
||||
md += `\n*... and ${inputs.length - 30} more inputs*\n`;
|
||||
md += `\n[…${inputs.length - 30} inputs elided…]\n`;
|
||||
}
|
||||
md += "\n";
|
||||
}
|
||||
@@ -165,7 +165,7 @@ async function handleModuleUrl(
|
||||
md += "\n";
|
||||
}
|
||||
if (outputs.length > 20) {
|
||||
md += `\n*... and ${outputs.length - 20} more outputs*\n`;
|
||||
md += `\n[…${outputs.length - 20} outputs elided…]\n`;
|
||||
}
|
||||
md += "\n";
|
||||
}
|
||||
@@ -180,7 +180,7 @@ async function handleModuleUrl(
|
||||
md += "\n";
|
||||
}
|
||||
if (deps.length > 15) {
|
||||
md += `\n*... and ${deps.length - 15} more dependencies*\n`;
|
||||
md += `\n[…${deps.length - 15} dependencies elided…]\n`;
|
||||
}
|
||||
md += "\n";
|
||||
}
|
||||
@@ -193,7 +193,7 @@ async function handleModuleUrl(
|
||||
md += `- \`${res.type}\` (${res.name})\n`;
|
||||
}
|
||||
if (resources.length > 20) {
|
||||
md += `\n*... and ${resources.length - 20} more resources*\n`;
|
||||
md += `\n[…${resources.length - 20} resources elided…]\n`;
|
||||
}
|
||||
md += "\n";
|
||||
}
|
||||
@@ -205,7 +205,7 @@ async function handleModuleUrl(
|
||||
md += `- **${sub.name}**: \`${sub.path}\`\n`;
|
||||
}
|
||||
if (mod.submodules.length > 10) {
|
||||
md += `\n*... and ${mod.submodules.length - 10} more submodules*\n`;
|
||||
md += `\n[…${mod.submodules.length - 10} submodules elided…]\n`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ async function handleProviderUrl(
|
||||
md += `- [${doc.title}](https://registry.terraform.io/providers/${namespace}/${type}/latest/docs/${doc.category}/${doc.slug})\n`;
|
||||
}
|
||||
if (docs.length > 15) {
|
||||
md += `\n*... and ${docs.length - 15} more*\n`;
|
||||
md += `\n[…${docs.length - 15} documents elided…]\n`;
|
||||
}
|
||||
md += "\n";
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ export const handleWikidata: SpecialHandler = async (
|
||||
if (values.length > 0) {
|
||||
// Limit values shown per property
|
||||
const displayValues = values.slice(0, 10);
|
||||
const overflow = values.length > 10 ? ` (+${values.length - 10} more)` : "";
|
||||
const overflow = values.length > 10 ? ` […${values.length - 10} values elided…]` : "";
|
||||
processedProperties.push(`- **${propLabel}:** ${displayValues.join(", ")}${overflow}`);
|
||||
}
|
||||
}
|
||||
@@ -187,7 +187,7 @@ export const handleWikidata: SpecialHandler = async (
|
||||
const maxProps = 50;
|
||||
md += processedProperties.slice(0, maxProps).join("\n");
|
||||
if (processedProperties.length > maxProps) {
|
||||
md += `\n\n*...and ${processedProperties.length - maxProps} more properties*`;
|
||||
md += `\n\n[…${processedProperties.length - maxProps} properties elided…]`;
|
||||
}
|
||||
md += "\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user