feat: make chat file references clickable and responsive (#587)
* docs: clarify named and quick Cloudflare tunnel usage * feat: make chat file paths openable from rendered responses * perf: speed up chat file-path links and open behavior * fix: open chat file references at mentioned lines * fix: prevent context panel flicker on blocked file opens
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
export const MAX_OPEN_FILE_LINES = 5_000;
|
||||
|
||||
export const countLinesWithLimit = (content: string, limit: number): number => {
|
||||
if (!content) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
let lines = 1;
|
||||
for (let index = 0; index < content.length; index += 1) {
|
||||
if (content.charCodeAt(index) === 10) {
|
||||
lines += 1;
|
||||
if (lines > limit) {
|
||||
return lines;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return lines;
|
||||
};
|
||||
Reference in New Issue
Block a user