-
Notifications
You must be signed in to change notification settings - Fork 553
[ENG-2305] Replace JavaScript resize detection with Tailwind responsive utilities #753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENG-2305] Replace JavaScript resize detection with Tailwind responsive utilities #753
Conversation
…e utilities in ActiveSession Remove state-based responsive layout in favor of pure CSS media queries using Tailwind's lg: breakpoint (1024px). This eliminates resize event listeners, reduces React re-renders, and improves SSR compatibility. Changes: - Remove isWideView state and window resize listener - Use Tailwind's lg:flex-row for responsive layout switching - Apply hidden lg:flex pattern for TodoWidget visibility - Change width from w-[20%] to lg:w-1/5 for consistency
Document Tailwind responsive patterns in CLAUDE.md to guide future development. The pattern eliminates JavaScript resize listeners in favor of pure CSS media queries. Changes: - Add responsive design patterns section to CLAUDE.md - Document breakpoint usage and SessionDetail example - Format code with Prettier (removed extra blank line)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed everything up to 5de891e in 46 seconds. Click for details.
- Reviewed
95lines of code in2files - Skipped
0files when reviewing. - Skipped posting
4draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. humanlayer-wui/CLAUDE.md:63
- Draft comment:
Clear documentation update on using Tailwind responsive utilities for breakpoints. This is helpful for future reference. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
2. humanlayer-wui/src/components/internal/SessionDetail/components/ActiveSession.tsx:239
- Draft comment:
Good removal of JS-based resize detection. Relying on Tailwind's CSS media queries reduces complexity and improves SSR compatibility. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative, praising the removal of JS-based resize detection and the use of Tailwind's CSS media queries. It doesn't provide any actionable feedback or suggestions for improvement.
3. humanlayer-wui/src/components/internal/SessionDetail/components/ActiveSession.tsx:804
- Draft comment:
Replacing conditional class logic with Tailwind's responsive classes ('flex-col lg:flex-row') simplifies the layout logic. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. humanlayer-wui/src/components/internal/SessionDetail/components/ActiveSession.tsx:874
- Draft comment:
Using 'hidden lg:flex lg:w-1/5' for the TodoWidget Card cleanly hides it on smaller screens while displaying it on desktop. Looks appropriate. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
Workflow ID: wflow_UzTXanoynAwRGJng
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
… code" This reverts commit 5de891e.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed d6fed8f in 37 seconds. Click for details.
- Reviewed
51lines of code in2files - Skipped
0files when reviewing. - Skipped posting
2draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. humanlayer-wui/CLAUDE.md:59
- Draft comment:
Removed responsive design documentation: This section provided valuable details (e.g., breakpoints and usage examples) supporting the Tailwind refactoring. Ensure that updated guidance is available elsewhere to aid future developers. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative and suggests ensuring that updated guidance is available elsewhere, which violates the rules. It doesn't provide a specific code suggestion or ask for a specific test to be written.
2. humanlayer-wui/src/components/internal/SessionDetail/components/ActiveSession.tsx:238
- Draft comment:
Unnecessary blank line added; consider removing it to preserve consistent formatting. - Reason this comment was not posted:
Confidence changes required:10%<= threshold50%None
Workflow ID: wflow_pW4gtWmplg0Rwavs
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed 0dc5bb8 in 27 seconds. Click for details.
- Reviewed
12lines of code in1files - Skipped
0files when reviewing. - Skipped posting
1draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. humanlayer-wui/src/components/internal/SessionDetail/components/ActiveSession.tsx:238
- Draft comment:
Removed an unnecessary blank line improves code consistency. This change is stylistic and aligns with Prettier formatting. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
Workflow ID: wflow_5uqCVdtn6jZvA6X8
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
What problem(s) was I solving?
The SessionDetail component (specifically ActiveSession) was using JavaScript-based resize detection to switch between responsive layouts. This approach had several drawbacks:
isWideViewstate initializes tofalseand then updates on mount, potentially causing hydration mismatchesWhat user-facing changes did I ship?
No visible user-facing changes. The responsive behavior remains identical:
How I implemented it
The refactoring involved three main phases:
1. Core Refactoring
isWideViewstate variable and its associated useState hook${isWideView ? 'flex-row' : 'flex-col'}toflex-col lg:flex-row{isWideView && ...}conditional rendering to CSS visibility usinghidden lg:flex lg:w-1/52. Documentation
humanlayer-wui/CLAUDE.md3. Code Quality
How to verify it
Automated Verification
make check test- All checks and tests passManual Testing
To verify the responsive behavior works correctly:
Description for the changelog
refactor: Replace JavaScript resize detection with Tailwind responsive utilities in SessionDetail
Eliminated state-based responsive layout in ActiveSession component in favor of pure CSS media queries using Tailwind's lg: breakpoint (1024px). This removes resize event listeners, reduces React re-renders, and improves SSR compatibility while maintaining identical responsive behavior.
Important
Refactor
ActiveSessionto use Tailwind CSS for responsive design, removing JavaScript resize detection.isWideViewstate and associateduseStatehook inActiveSession.useEffectcleanup logic inActiveSession.ActiveSession.CLAUDE.md.This description was created by
for 0dc5bb8. You can customize this summary. It will automatically update as commits are pushed.