Fix grid textfield not displaying values longer than 633 characters#94
Fix grid textfield not displaying values longer than 633 characters#94MarekMudron wants to merge 1 commit into
Conversation
|
Caution Review failedFailed to post review comments 📝 WalkthroughWalkthroughThe changes address data display issues in the LiteDB Studio UI by implementing fixed column widths and text truncation. Cell data handling is modified to store BSON values in both the Value and Tag properties, while formatted strings exceeding 150 characters are truncated with ellipsis during cell rendering. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@LiteDB.Studio/Forms/MainForm.cs`:
- Around line 819-822: The CellFormatting handler in MainForm.cs is replacing
e.Value with a truncated string (the if block that uses str.Substring(0, 150)),
which prevents the grid from ever showing the full cell content even after
column resize; remove that truncation and leave e.Value unchanged (do not assign
the shortened string), so the grid will clip visually per UIExtensions' fixed
widths; if a hover preview is desired later, populate the cell's ToolTipText or
similar instead of modifying e.Value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1891355e-4b5c-4872-83cb-9e9d51863de5
📒 Files selected for processing (2)
LiteDB.Studio/Classes/UIExtensions.csLiteDB.Studio/Forms/MainForm.cs
| if (e.Value is string str && str.Length > 150) | ||
| { | ||
| e.Value = str.Substring(0, 150) + "..."; | ||
| } |
There was a problem hiding this comment.
Don’t replace the formatted cell value with a truncated preview.
Line 821 makes the grid display only the first 150 characters, so long JSON/text still cannot be fully viewed in the grid after resizing the column. Since UIExtensions now uses fixed initial widths, keep e.Value intact and let the grid clip visually.
🐛 Proposed fix
- if (e.Value is string str && str.Length > 150)
- {
- e.Value = str.Substring(0, 150) + "...";
- }
+ // Keep the full formatted value available in the grid; the fixed
+ // column width clips the visual rendering without losing content.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if (e.Value is string str && str.Length > 150) | |
| { | |
| e.Value = str.Substring(0, 150) + "..."; | |
| } | |
| // Keep the full formatted value available in the grid; the fixed | |
| // column width clips the visual rendering without losing content. |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@LiteDB.Studio/Forms/MainForm.cs` around lines 819 - 822, The CellFormatting
handler in MainForm.cs is replacing e.Value with a truncated string (the if
block that uses str.Substring(0, 150)), which prevents the grid from ever
showing the full cell content even after column resize; remove that truncation
and leave e.Value unchanged (do not assign the shortened string), so the grid
will clip visually per UIExtensions' fixed widths; if a hover preview is desired
later, populate the cell's ToolTipText or similar instead of modifying e.Value.
Fixes #35
Summary by CodeRabbit