UX: Disable Add Comment toolbar button when no text is selected#401
Draft
Copilot wants to merge 6 commits into
Draft
UX: Disable Add Comment toolbar button when no text is selected#401Copilot wants to merge 6 commits into
Copilot wants to merge 6 commits into
Conversation
- Add `updateAddCommentButtonState(hasSelection)` to EpComments prototype - Call it in `postAceInit` (initial disabled state) and `aceEditEvent` (on every selection change) - Guard the `.addComment` click handler to bail out when disabled - Add `.addComment.disabled` CSS: opacity + cursor + pointer-events on child <a> - Update `clickAddCommentButton` test helper to wait for enabled state - Add five new Playwright tests covering disabled/enabled button behaviour Agent-Logs-Url: https://github.com/ether/ep_comments_page/sessions/05bd6554-0537-4892-b608-28221070422f Co-authored-by: JohnMcLear <220864+JohnMcLear@users.noreply.github.com>
… lookups in aceEditEvent Agent-Logs-Url: https://github.com/ether/ep_comments_page/sessions/05bd6554-0537-4892-b608-28221070422f Co-authored-by: JohnMcLear <220864+JohnMcLear@users.noreply.github.com>
…ceEditEvent Agent-Logs-Url: https://github.com/ether/ep_comments_page/sessions/05bd6554-0537-4892-b608-28221070422f Co-authored-by: JohnMcLear <220864+JohnMcLear@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ether/ep_comments_page/sessions/05bd6554-0537-4892-b608-28221070422f Co-authored-by: JohnMcLear <220864+JohnMcLear@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ether/ep_comments_page/sessions/05bd6554-0537-4892-b608-28221070422f Co-authored-by: JohnMcLear <220864+JohnMcLear@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add disabled state to toolbar button when no text is selected
UX: Disable Add Comment toolbar button when no text is selected
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "Add Comment" toolbar button was always enabled regardless of editor selection state, requiring a toast notification to communicate that no text was selected rather than preventing the action up front.
Changes
postAceInitcallsupdateAddCommentButtonState(false)after plugin init so the button starts disabledaceEditEventhook callsupdateAddCommentButtonState(!checkNoTextSelected(rep))on every selection change, enabling/disabling the button in real time.addCommentclick handler bails out early if the button is disabled (belt-and-suspenders alongside the CSS)this.$addCommentBtnandthis.$addCommentBtnLinkare cached once ininit()to avoid repeated lookups on the hotaceEditEventpath.addComment.disabledappliesopacity: 0.4+cursor: not-allowed;.addComment.disabled > asetspointer-events: noneto block clicks on the anchor without breaking Playwright's ability to interact with the<li>clickAddCommentButtonhelper now polls for enabled state before clicking; five new Playwright specs cover: initial disabled state, enabled on selection, re-disabled on deselection, click-while-disabled does not open form, click-while-enabled opens form