Commit e1862da
committed
refactor: consolidate truncate functions to use cortex-common
- Replace local truncate_model_name in billing_client.rs with cortex_common::truncate_model_name
- Replace local truncate_command in permission/prompts.rs with cortex_common::truncate_command
- Replace local truncate_for_display in edit_file.rs with cortex_common::truncate_for_display
- Replace local truncate_string in edit_strategies.rs with cortex_common::truncate_for_display
- Fix test expectations for truncate_model_name (correct max_len calculation)
- Add comment clarifying unicode-aware truncation in text_utils.rs
This reduces code duplication and ensures consistent truncation behavior
across the codebase. All truncation functions now delegate to the centralized
implementations in cortex-common.1 parent 60bba58 commit e1862da
File tree
6 files changed
+21
-24
lines changed- cortex-common/src
- cortex-engine/src
- permission
- tools/handlers
- cortex-tui/src/ui
6 files changed
+21
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
144 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| |||
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
| 214 | + | |
| 215 | + | |
213 | 216 | | |
214 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
215 | 224 | | |
216 | 225 | | |
217 | 226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
| 599 | + | |
604 | 600 | | |
605 | 601 | | |
606 | 602 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
| 217 | + | |
222 | 218 | | |
223 | 219 | | |
224 | 220 | | |
| |||
325 | 321 | | |
326 | 322 | | |
327 | 323 | | |
| 324 | + | |
| 325 | + | |
328 | 326 | | |
329 | 327 | | |
330 | | - | |
| 328 | + | |
331 | 329 | | |
332 | 330 | | |
333 | 331 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
| 317 | + | |
322 | 318 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
984 | 984 | | |
985 | 985 | | |
986 | 986 | | |
987 | | - | |
988 | | - | |
989 | | - | |
990 | | - | |
991 | | - | |
| 987 | + | |
992 | 988 | | |
993 | 989 | | |
994 | 990 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
0 commit comments