Skip to content

feat: Make shell component noscript-compatible#275

Open
PieterjanDeClippel wants to merge 1 commit intomasterfrom
feat/shell-noscript
Open

feat: Make shell component noscript-compatible#275
PieterjanDeClippel wants to merge 1 commit intomasterfrom
feat/shell-noscript

Conversation

@PieterjanDeClippel
Copy link
Copy Markdown
Member

Summary

  • Add a hidden checkbox with bsNoNoscript for sidebar toggle state (indeterminate=auto, checked=show, unchecked=hide)
  • Add noscript-only hamburger (☰) and close (×) labels visible only on narrow screens when JS is disabled
  • CSS :checked sibling selectors override sidebar visibility when checkbox is toggled
  • Expose shellToggleId so consumers can add their own toggle labels elsewhere

How it works

Checkbox state Shell state Set by
Indeterminate auto JS property binding ([indeterminate])
Checked show HTML attribute or noscript label click
Unchecked hide Noscript label click

With JS: Angular manages the state input and CSS classes (.show/.hide). The checkbox [checked] and [indeterminate] bindings keep it in sync.

Without JS: The built-in hamburger/close labels toggle the checkbox. CSS input.noscript.shell-toggle:checked ~ .sidebar-root shows the sidebar on narrow screens.

Test plan

  • Verify sidebar auto behavior works with JavaScript enabled (no regression)
  • Verify sidebar show/hide states work with JavaScript
  • Verify hamburger label appears on narrow screens without JavaScript
  • Verify clicking hamburger opens sidebar without JavaScript
  • Verify clicking close button hides sidebar without JavaScript
  • Verify hamburger/close labels are hidden when JavaScript is enabled
  • Verify hamburger/close labels are hidden on wide screens
  • Verify setSize() still works

🤖 Generated with Claude Code

Add a hidden checkbox (indeterminate=auto, checked=show, unchecked=hide)
with noscript-only hamburger/close labels for sidebar toggling on narrow
screens. CSS :checked sibling selectors override sidebar visibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the bs-shell component by introducing noscript compatibility for its sidebar functionality. The changes enable the sidebar to be toggled using pure CSS and HTML, providing a fallback mechanism for users with JavaScript disabled. This ensures a more robust and accessible user experience across different browsing environments.

Highlights

  • Noscript Compatibility: Implemented a hidden checkbox with bsNoNoscript to manage sidebar toggle state, allowing the component to function without JavaScript.
  • Toggle Labels: Introduced noscript-only hamburger (☰) and close (×) labels that are visible on narrow screens when JavaScript is disabled, enabling users to toggle the sidebar.
  • CSS-driven Toggling: Utilized CSS :checked sibling selectors to control sidebar visibility based on the state of the hidden checkbox, ensuring functionality without JavaScript.
  • Exposed Toggle ID: Exposed shellToggleId to allow consumers of the component to add their own custom toggle labels elsewhere in the application.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • libs/mintplayer-ng-bootstrap/shell/src/shell/shell.component.html
    • Added a hidden checkbox element to control the sidebar's state.
    • Included noscript-specific labels for opening and closing the sidebar.
  • libs/mintplayer-ng-bootstrap/shell/src/shell/shell.component.scss
    • Added styles to hide noscript toggle labels by default.
    • Implemented responsive CSS rules to display noscript toggle labels on narrow screens when JavaScript is disabled.
    • Defined CSS rules to show the sidebar when the noscript toggle checkbox is checked.
  • libs/mintplayer-ng-bootstrap/shell/src/shell/shell.component.ts
    • Imported the BsNoNoscriptDirective to support noscript functionality.
    • Added a static counter and computed property to generate unique IDs for the shell toggle checkbox.
Activity
  • No activity has occurred on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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 introduces a clever solution to make the shell component compatible with environments where JavaScript is disabled. The use of a hidden checkbox controlled by labels and styled with CSS sibling selectors for the noscript case is well-implemented. The overall approach is sound and the code is clean. I have one minor suggestion to improve the SCSS by reducing some code duplication.

Comment on lines +118 to +130
.sidebar-open.noscript {
padding: .25rem .75rem;
font-size: 1.25rem;
line-height: 1;
}

.sidebar-close.noscript {
padding: .25rem .75rem;
font-size: 1.5rem;
line-height: 1;
color: rgba(255, 255, 255, 0.75);
align-self: flex-end;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

There is some style duplication for .sidebar-open.noscript and .sidebar-close.noscript. You can group the common properties (padding and line-height) into a shared rule to make the code more concise and easier to maintain, following the DRY (Don't Repeat Yourself) principle.

.sidebar-open.noscript, .sidebar-close.noscript {
    padding: .25rem .75rem;
    line-height: 1;
}

.sidebar-open.noscript {
    font-size: 1.25rem;
}

.sidebar-close.noscript {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.75);
    align-self: flex-end;
}

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Mar 6, 2026

View your CI Pipeline Execution ↗ for commit 2b26e73

Command Status Duration Result
nx affected --target=test --watch=false --paral... ✅ Succeeded 2m 12s View ↗
nx build --configuration=production ✅ Succeeded 1m 18s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-06 11:40:17 UTC

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