feat(ux): added text wrapping capabilities to markdown tables (#18240)

Co-authored-by: jacob314 <jacob314@gmail.com>
This commit is contained in:
Dev Randalpura
2026-02-10 13:12:53 -08:00
committed by GitHub
parent a2174751de
commit 49533cd106
6 changed files with 620 additions and 92 deletions

View File

@@ -1,5 +1,63 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`TableRenderer > 'handles non-ASCII characters (emojis …' 1`] = `
"
┌──────────────┬────────────┬───────────────┐
│ Emoji 😃 │ Asian 汉字 │ Mixed 🚀 Text │
├──────────────┼────────────┼───────────────┤
│ Start 🌟 End │ 你好世界 │ Rocket 🚀 Man │
│ Thumbs 👍 Up │ こんにちは │ Fire 🔥 │
└──────────────┴────────────┴───────────────┘
"
`;
exports[`TableRenderer > 'renders a table with mixed emojis, As…' 1`] = `
"
┌───────────────┬───────────────────┬────────────────┐
│ Mixed 😃 中文 │ Complex 🚀 日本語 │ Text 📝 한국어 │
├───────────────┼───────────────────┼────────────────┤
│ 你好 😃 │ こんにちは 🚀 │ 안녕하세요 📝 │
│ World 🌍 │ Code 💻 │ Pizza 🍕 │
└───────────────┴───────────────────┴────────────────┘
"
`;
exports[`TableRenderer > 'renders a table with only Asian chara…' 1`] = `
"
┌──────────────┬─────────────────┬───────────────┐
│ Chinese 中文 │ Japanese 日本語 │ Korean 한국어 │
├──────────────┼─────────────────┼───────────────┤
│ 你好 │ こんにちは │ 안녕하세요 │
│ 世界 │ 世界 │ 세계 │
└──────────────┴─────────────────┴───────────────┘
"
`;
exports[`TableRenderer > 'renders a table with only emojis and …' 1`] = `
"
┌──────────┬───────────┬──────────┐
│ Happy 😀 │ Rocket 🚀 │ Heart ❤️ │
├──────────┼───────────┼──────────┤
│ Smile 😃 │ Fire 🔥 │ Love 💖 │
│ Cool 😎 │ Star ⭐ │ Blue 💙 │
└──────────┴───────────┴──────────┘
"
`;
exports[`TableRenderer > handles wrapped bold headers without showing markers 1`] = `
"
┌─────────────┬───────┬─────────┐
│ Very Long │ Short │ Another │
│ Bold Header │ │ Long │
│ That Will │ │ Header │
│ Wrap │ │ │
├─────────────┼───────┼─────────┤
│ Data 1 │ Data │ Data 3 │
│ │ 2 │ │
└─────────────┴───────┴─────────┘
"
`;
exports[`TableRenderer > renders a 3x3 table correctly 1`] = `
"
┌──────────────┬──────────────┬──────────────┐
@@ -12,14 +70,117 @@ exports[`TableRenderer > renders a 3x3 table correctly 1`] = `
"
`;
exports[`TableRenderer > renders a table with long headers and 4 columns correctly 1`] = `
exports[`TableRenderer > renders a complex table with mixed content lengths correctly 1`] = `
"
┌───────────────────────────────────────────────────────┬──────────────────┐
Very Long Colum… │ Very Long Colum… │ Very Long Column… │ Very Long Colum…
├──────────────────┼──────────────────┼───────────────────┼──────────────────┤
│ Data 1.1 │ Data 1.2 │ Data 1.3Data 1.4
Data 2.1 │ Data 2.2 │ Data 2.3 │ Data 2.4
Data 3.1 │ Data 3.2 │ Data 3.3 │ Data 3.4
└──────────────────┴──────────────────┴───────────────────┴──────────────────┘
┌─────────────────────────────┬──────────────────────────────┬─────────────────────────────┬──────────────────────────────┬─────┬────────┬─────────┬───────┐
Comprehensive Architectural │ Implementation Details for │ Longitudinal Performance │ Strategic Security Framework │ Key │ Status │ Version │ Owner
│ Specification for the │ the High-Throughput │ Analysis Across │ for Mitigating Sophisticated │ │ │ │ │
│ Distributed Infrastructure │ Asynchronous Message │ Multi-Regional Cloud │ Cross-Site Scripting
Layer │ Processing Pipeline with │ Deployment Clusters │ Vulnerabilities │ │ │
│ Extended Scalability │ │ │ │ │
│ │ Features and Redundancy │ │ │ │ │ │ │
│ │ Protocols │ │ │ │ │ │ │
├─────────────────────────────┼──────────────────────────────┼─────────────────────────────┼──────────────────────────────┼─────┼────────┼─────────┼───────┤
│ The primary architecture │ Each message is processed │ Historical data indicates a │ A multi-layered defense │ INF │ Active │ v2.4 │ J. │
│ utilizes a decoupled │ through a series of │ significant reduction in │ strategy incorporates │ │ │ │ Doe │
│ microservices approach, │ specialized workers that │ tail latency when utilizing │ content security policies, │ │ │ │ │
│ leveraging container │ handle data transformation, │ edge computing nodes closer │ input sanitization │ │ │ │ │
│ orchestration for │ validation, and persistent │ to the geographic location │ libraries, and regular │ │ │ │ │
│ scalability and fault │ storage using a persistent │ of the end-user base. │ automated penetration │ │ │ │ │
│ tolerance in high-load │ queue. │ │ testing routines. │ │ │ │ │
│ scenarios. │ │ Monitoring tools have │ │ │ │ │ │
│ │ The pipeline features │ captured a steady increase │ Developers are required to │ │ │ │ │
│ This layer provides the │ built-in retry mechanisms │ in throughput efficiency │ undergo mandatory security │ │ │ │ │
│ fundamental building blocks │ with exponential backoff to │ since the introduction of │ training focusing on the │ │ │ │ │
│ for service discovery, load │ ensure message delivery │ the vectorized query engine │ OWASP Top Ten to ensure that │ │ │ │ │
│ balancing, and │ integrity even during │ in the primary data │ security is integrated into │ │ │ │ │
│ inter-service communication │ transient network or service │ warehouse. │ the initial design phase. │ │ │ │ │
│ via highly efficient │ failures. │ │ │ │ │ │ │
│ protocol buffers. │ │ Resource utilization │ The implementation of a │ │ │ │ │
│ │ Horizontal autoscaling is │ metrics demonstrate that │ robust Identity and Access │ │ │ │ │
│ Advanced telemetry and │ triggered automatically │ the transition to │ Management system ensures │ │ │ │ │
│ logging integrations allow │ based on the depth of the │ serverless compute for │ that the principle of least │ │ │ │ │
│ for real-time monitoring of │ processing queue, ensuring │ intermittent tasks has │ privilege is strictly │ │ │ │ │
│ system health and rapid │ consistent performance │ resulted in a thirty │ enforced across all │ │ │ │ │
│ identification of │ during unexpected traffic │ percent cost optimization. │ environments. │ │ │ │ │
│ bottlenecks within the │ spikes. │ │ │ │ │ │ │
│ service mesh. │ │ │ │ │ │ │ │
└─────────────────────────────┴──────────────────────────────┴─────────────────────────────┴──────────────────────────────┴─────┴────────┴─────────┴───────┘
"
`;
exports[`TableRenderer > renders a table with long headers and 4 columns correctly 1`] = `
"
┌───────────────┬───────────────┬──────────────────┬──────────────────┐
│ Very Long │ Very Long │ Very Long Column │ Very Long Column │
│ Column Header │ Column Header │ Header Three │ Header Four │
│ One │ Two │ │ │
├───────────────┼───────────────┼──────────────────┼──────────────────┤
│ Data 1.1 │ Data 1.2 │ Data 1.3 │ Data 1.4 │
│ Data 2.1 │ Data 2.2 │ Data 2.3 │ Data 2.4 │
│ Data 3.1 │ Data 3.2 │ Data 3.3 │ Data 3.4 │
└───────────────┴───────────────┴──────────────────┴──────────────────┘
"
`;
exports[`TableRenderer > strips bold markers from headers and renders them correctly 1`] = `
"
┌─────────────┬───────────────┬──────────────┐
│ Bold Header │ Normal Header │ Another Bold │
├─────────────┼───────────────┼──────────────┤
│ Data 1 │ Data 2 │ Data 3 │
└─────────────┴───────────────┴──────────────┘
"
`;
exports[`TableRenderer > wraps all long columns correctly 1`] = `
"
┌────────────────┬────────────────┬─────────────────┐
│ Col 1 │ Col 2 │ Col 3 │
├────────────────┼────────────────┼─────────────────┤
│ This is a very │ This is also a │ And this is the │
│ long text that │ very long text │ third long text │
│ needs wrapping │ that needs │ that needs │
│ in column 1 │ wrapping in │ wrapping in │
│ │ column 2 │ column 3 │
└────────────────┴────────────────┴─────────────────┘
"
`;
exports[`TableRenderer > wraps columns with punctuation correctly 1`] = `
"
┌───────────────────┬───────────────┬─────────────────┐
│ Punctuation 1 │ Punctuation 2 │ Punctuation 3 │
├───────────────────┼───────────────┼─────────────────┤
│ Start. Stop. │ Semi; colon: │ At@ Hash# │
│ Comma, separated. │ Pipe| Slash/ │ Dollar$ │
│ Exclamation! │ Backslash\\ │ Percent% Caret^ │
│ Question? │ │ Ampersand& │
│ hyphen-ated │ │ Asterisk* │
└───────────────────┴───────────────┴─────────────────┘
"
`;
exports[`TableRenderer > wraps long cell content correctly 1`] = `
"
┌───────┬─────────────────────────────┬───────┐
│ Col 1 │ Col 2 │ Col 3 │
├───────┼─────────────────────────────┼───────┤
│ Short │ This is a very long cell │ Short │
│ │ content that should wrap to │ │
│ │ multiple lines │ │
└───────┴─────────────────────────────┴───────┘
"
`;
exports[`TableRenderer > wraps mixed long and short columns correctly 1`] = `
"
┌───────┬──────────────────────────┬────────┐
│ Short │ Long │ Medium │
├───────┼──────────────────────────┼────────┤
│ Tiny │ This is a very long text │ Not so │
│ │ that definitely needs to │ long │
│ │ wrap to the next line │ │
└───────┴──────────────────────────┴────────┘
"
`;