Skip to content

Add Lorem Ipsum placeholder to text tool#4027

Open
Annonnymmousss wants to merge 2 commits intoGraphiteEditor:masterfrom
Annonnymmousss:feat/lorem_ipsum_placeholder
Open

Add Lorem Ipsum placeholder to text tool#4027
Annonnymmousss wants to merge 2 commits intoGraphiteEditor:masterfrom
Annonnymmousss:feat/lorem_ipsum_placeholder

Conversation

@Annonnymmousss
Copy link
Copy Markdown
Contributor

This feature is applicable by default but can be off from file>preference.

Screen.Recording.2026-04-14.at.5.39.50.AM.mov

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 5 files

Confidence score: 2/5

  • There is high merge risk because both findings are high-severity (7–8/10) with high confidence (9/10) and affect active text-editing flows.
  • In editor/src/messages/tool/tool_messages/text_tool.rs, lorem ipsum sizing divides by line_height without a zero guard, which can produce extreme word_count values and trigger expensive allocations during drag updates (performance/stability impact).
  • In editor/src/messages/tool/tool_messages/text_tool.rs, persistent is_lorem_ipsum state when editing existing layers can carry stale behavior across sessions, suppress clipping warnings, and truncate unrelated text on commit (user-visible data correctness risk).
  • Pay close attention to editor/src/messages/tool/tool_messages/text_tool.rs - guard zero line_height math and reset lorem-ipsum state when switching to existing layer edits.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="editor/src/messages/tool/tool_messages/text_tool.rs">

<violation number="1" location="editor/src/messages/tool/tool_messages/text_tool.rs:383">
P1: `is_lorem_ipsum` persists across sessions and is not reset when editing existing layers, so stale state can suppress clipping warnings and incorrectly truncate unrelated text on commit.</violation>

<violation number="2" location="editor/src/messages/tool/tool_messages/text_tool.rs:1097">
P1: Lorem ipsum sizing divides by `line_height` without guarding zero, allowing infinite/huge `word_count` and expensive allocation during drag updates.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements a 'Lorem Ipsum' placeholder feature for the text tool, allowing users to automatically fill new text boxes with placeholder text. It includes a new preference setting, UI components, and logic within the text tool's state machine to estimate and truncate the placeholder text based on the drawn box dimensions. The review feedback highlights several improvement opportunities regarding code maintainability and performance, specifically recommending the use of named constants instead of magic numbers for text estimation and suggesting optimizations to reduce string allocations during text generation and truncation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant