Skip to content

refactor: simplify LogEntry component and enhance log message display#446

Merged
akila-i merged 2 commits intoopenchoreo:mainfrom
akila-i:logs-wrap
Mar 19, 2026
Merged

refactor: simplify LogEntry component and enhance log message display#446
akila-i merged 2 commits intoopenchoreo:mainfrom
akila-i:logs-wrap

Conversation

@akila-i
Copy link
Contributor

@akila-i akila-i commented Mar 19, 2026

Purpose

This pull request refactors the log entry component in the runtime logs UI to improve usability and simplify the code. The most significant changes include removing hover logic for the copy button, restructuring the layout for log cells, and updating styles for better log message display.

UI Behavior and Interaction:

Styling and Layout Improvements:

Goals

Describe the solutions that this feature/fix will introduce to resolve the problems described above

Approach

  • Removed unnecessary hover state management from LogEntry component.

  • Updated log message styling to support multiline display with a maximum of three lines.

  • Adjusted layout for log action buttons to improve alignment and user experience.

  • Before:

Screenshot 2026-03-19 at 12 27 05
  • After:
image

User stories

Summary of user stories addressed by this change>

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

Certification

Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

Summary by CodeRabbit

  • New Features

    • Copy button is now always visible on log entries (no hover required).
    • Log messages now display up to three lines before truncation instead of a single line.
  • Style

    • Improved table cell layout and spacing for clearer log message presentation.
    • Theme palette extended with a new "info" color for UI consistency.

- Removed unnecessary hover state management from LogEntry component.
- Updated log message styling to support multiline display with a maximum of three lines.
- Adjusted layout for log action buttons to improve alignment and user experience.

Signed-off-by: Akila-I <akila.99g@gmail.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

📝 Walkthrough

Walkthrough

Removed hover-driven visibility for the copy action on runtime log rows and reworked the log cell layout to a flex-based structure with a fixed action column and multi-line clamped log text (3 lines), plus expanded-style overrides.

Changes

Cohort / File(s) Summary
Log Entry Component
plugins/openchoreo-observability/src/components/RuntimeLogs/LogEntry.tsx
Removed isHovered state and onMouseEnter/onMouseLeave handlers. Moved Tooltip/IconButton into a persistent action column (logActionColumn) and restructured log cell markup to logCellContentlogTextContainer + logActionColumn.
Log Styling
plugins/openchoreo-observability/src/components/RuntimeLogs/styles.ts
Changed logMessage from single-line ellipsis to 3-line WebKit clamp; updated expandedLogMessage to disable clamping when expanded. Replaced logCell truncation with flex layout and added logCellContent, logTextContainer, logActionColumn. Adjusted copyButton spacing.
Theme
packages/design-system/src/theme/openChoreoTheme.ts
Added info color palette (light, main, dark) to the theme colors used by the design system.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • jhivandb
  • sameerajayasoma
  • kaviththiranga

Poem

🐇 I nudged the hover, let buttons stay —
Rows breathe lines that no longer fray,
A little flex, a clipped delight,
Three lines sit snug in morning light,
Copy at hand, the logs feel right.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is partially complete but lacks several required sections, particularly Goals, User Stories, Release Notes, Documentation, and other standard fields. Complete the missing sections: Goals (explain solutions to the problems), User Stories (summarize addressed user stories), Release Notes (brief description for release), Documentation (link to docs or state N/A with explanation), Training (link or N/A), Certification (status or N/A), Marketing (link or N/A), Automation Tests (unit and integration test details), Security Checks (yes/no answers), Samples, Related PRs, Migrations, Test Environment, and Learning sections.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: simplifying the LogEntry component by removing hover logic and enhancing log message display through restructured layout and styling updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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 `@plugins/openchoreo-observability/src/components/RuntimeLogs/LogEntry.tsx`:
- Around line 129-130: The copy action remains hidden because the JSX still
applies classes.hoverActionButton to the element (see LogEntry.tsx where
className is set to `${classes.logActionColumn} ${classes.hoverActionButton}`);
remove the hover-only class so the element uses only classes.logActionColumn (or
another always-visible class) to make the copy button always visible. Update the
className on the element that renders the copy action (reference:
classes.logActionColumn and classes.hoverActionButton) to drop
classes.hoverActionButton and ensure styles reflect the always-visible state.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 82189ed4-e3f7-4457-9a83-378faade37a4

📥 Commits

Reviewing files that changed from the base of the PR and between 70b99f1 and 2a5035e.

📒 Files selected for processing (2)
  • plugins/openchoreo-observability/src/components/RuntimeLogs/LogEntry.tsx
  • plugins/openchoreo-observability/src/components/RuntimeLogs/styles.ts

Comment on lines +129 to 130
className={`${classes.logActionColumn} ${classes.hoverActionButton}`}
>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Remove hover-only class from the always-visible copy action

Line 129 still applies classes.hoverActionButton, which keeps the action hidden by default and only visible on row hover. That conflicts with the stated behavior change (“copy button always visible”).

Suggested fix
-                <Box
-                  className={`${classes.logActionColumn} ${classes.hoverActionButton}`}
-                >
+                <Box className={classes.logActionColumn}>
📝 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.

Suggested change
className={`${classes.logActionColumn} ${classes.hoverActionButton}`}
>
<Box className={classes.logActionColumn}>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/openchoreo-observability/src/components/RuntimeLogs/LogEntry.tsx`
around lines 129 - 130, The copy action remains hidden because the JSX still
applies classes.hoverActionButton to the element (see LogEntry.tsx where
className is set to `${classes.logActionColumn} ${classes.hoverActionButton}`);
remove the hover-only class so the element uses only classes.logActionColumn (or
another always-visible class) to make the copy button always visible. Update the
className on the element that renders the copy action (reference:
classes.logActionColumn and classes.hoverActionButton) to drop
classes.hoverActionButton and ensure styles reflect the always-visible state.

- Introduced a new color palette for info states, including light, main, and dark shades.
- This enhancement improves the theme's versatility for displaying informational messages.

Signed-off-by: Akila-I <akila.99g@gmail.com>
@akila-i akila-i merged commit c89d18a into openchoreo:main Mar 19, 2026
6 checks passed
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.

2 participants