Skip to content

Conversation

@quanru
Copy link
Collaborator

@quanru quanru commented Dec 12, 2025

Summary

This PR improves the dark mode visual experience for the ShinyText component and related UI elements in the visualizer package.

Changes

ShinyText Component (Dark Mode)

  • Replace solid purple text color (#c5b8ff) with a vibrant animated gradient:
    • Colors: #a78bfa#c084fc#e879f9#c084fc
    • Maintains the smooth 8-second gradient animation
  • Replace harsh white shine effect with subtle purple shine:
    • Color: rgba(197, 184, 255, 0.15) (15% opacity)
    • Much softer and more harmonious with the text gradient
    • Preserves the left-to-right sliding animation

PlaygroundResult Component (Dark Mode)

  • Add dark mode styling for loading progress text
  • Add dark mode styling for pre code blocks with proper background and border

Type Safety Improvements

  • Add null/undefined checks in replay-scripts.ts
  • Add type normalization for ExecutionDump handling
  • Improve error handling with console warnings

Visual Comparison

Before: Solid purple text (#c5b8ff) with white shine (40% opacity) - visually jarring in dark mode

After: Vibrant purple-pink gradient with matching purple shine (15% opacity) - harmonious and elegant

Test Plan

  • Run npm run lint - passed with auto-fixes
  • Build packages successfully
  • Verify dark mode styling in browser DevTools
  • Test animation smoothness

Related

Addresses user feedback about harsh white shine effect in dark mode while maintaining the dynamic visual appeal of the component.

- Replace solid purple text color with vibrant gradient (#a78bfa → #c084fc → #e879f9) in dark mode
- Add subtle purple shine effect (15% opacity) instead of harsh white shine
- Maintain animated gradient and shine animations in dark mode
- Add dark mode styling for PlaygroundResult component (loading text and pre blocks)
- Improve type safety in replay-scripts.ts with null checks and type normalization
@netlify
Copy link

netlify bot commented Dec 12, 2025

Deploy Preview for midscene failed. Why did it fail? →

Name Link
🔨 Latest commit 7b6570c
🔍 Latest deploy log https://app.netlify.com/projects/midscene/deploys/693fd73ec24e19000824b5c4

@quanru
Copy link
Collaborator Author

quanru commented Dec 12, 2025

Additional Fix

Added a second commit to fix a bug in resolveAiActionContext that was caught by unit tests:

Issue: The function was incorrectly prioritizing preference.aiActionContext over target.aiActionContext, which contradicted the documented behavior.

Fix: Corrected the resolution order to:

  1. target.aiActionContext (highest priority - per-target override)
  2. preference.aiActionContext (fallback - agent-level preference)
  3. preference.aiActContext (fallback - deprecated alias)

Test: All Puppeteer unit tests now pass (12/12), including the previously failing ai-action-context.test.ts.

@quanru
Copy link
Collaborator Author

quanru commented Dec 12, 2025

Update: aiActionContext Priority Changed

I've updated the aiActionContext resolution logic based on feedback:

New Priority Order (Highest to Lowest)

  1. preference.aiActionContext - Agent-level preference (highest priority)
  2. preference.aiActContext - Deprecated alias (fallback)
  3. target.aiActionContext - Target-level context (lowest priority)

Changes Made

  • ✅ Updated function comments to reflect correct priority
  • ✅ Modified test cases to validate new behavior
  • ✅ Added comprehensive test coverage (5 test cases)
  • ✅ All tests passing

Rationale

This design allows agent-level preferences to override target-level context, providing more flexibility for runtime configuration while maintaining backward compatibility with the deprecated aiActContext alias.

@quanru quanru force-pushed the fix/visualizer-dark-mode-shiny-text branch 2 times, most recently from 081816a to fc69ac9 Compare December 12, 2025 06:40
@quanru
Copy link
Collaborator Author

quanru commented Dec 12, 2025

Correction: aiActionContext Priority

I've corrected the priority order. preference.aiActionContext is the deprecated property, not aiActContext.

Correct Priority Order (Highest to Lowest)

  1. preference.aiActContext - Agent-level preference (recommended, highest priority)
  2. preference.aiActionContext - Agent-level preference (deprecated)
  3. target.aiActionContext - Target-level context (lowest priority)

Changes Made

  • ✅ Updated function comments to correctly identify deprecated property
  • ✅ Modified test cases with accurate naming
  • ✅ All tests passing (5 test cases)

Rationale

This design:

  • Prioritizes the new recommended aiActContext property
  • Maintains backward compatibility with deprecated aiActionContext
  • Allows agent-level preferences to override target-level context
  • Provides flexibility in runtime configuration

Change the resolution priority to prefer agent-level preference over
target-level context:

Priority order (highest to lowest):
1. preference.aiActContext (recommended)
2. preference.aiActionContext (deprecated)
3. target.aiActionContext (target-level fallback)

Updated:
- Function comment to reflect correct priority order
- Test cases to validate new priority behavior
- Added comprehensive test coverage (5 test cases)

This allows agent-level preferences to override target-level context,
providing more flexibility in runtime configuration while maintaining
backward compatibility with the deprecated aiActionContext property.
@quanru quanru force-pushed the fix/visualizer-dark-mode-shiny-text branch from fc69ac9 to 7b6570c Compare December 15, 2025 09:39
@quanru quanru merged commit 17a2a6f into v1 Dec 15, 2025
5 of 9 checks passed
@quanru quanru deleted the fix/visualizer-dark-mode-shiny-text branch December 15, 2025 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants