Skip to content

button "save" feedback#62

Merged
Jason2866 merged 3 commits into
mainfrom
save_feedback
May 18, 2026
Merged

button "save" feedback#62
Jason2866 merged 3 commits into
mainfrom
save_feedback

Conversation

@Jason2866
Copy link
Copy Markdown
Owner

@Jason2866 Jason2866 commented May 18, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Filter save operations now provide visual feedback to users, confirming successful saves with "Saved ✓" messages or displaying error details if an issue occurs.
    • Save button shows a disabled state while processing and displays timed feedback that clearly indicates whether the operation succeeded or failed.
  • Chores

    • Updated configuration to exclude logs directory.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Warning

Rate limit exceeded

@Jason2866 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 48 minutes and 30 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b0ab833c-eaee-449e-ab50-23348a5b9edd

📥 Commits

Reviewing files that changed from the base of the PR and between e238bd5 and 5845944.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • src/webviewPanel.ts
📝 Walkthrough

Walkthrough

A filter persistence feature is added: the backend saves serial filter configuration with error handling, while the webview adds a save button with CSS feedback styling, sends the filter data, receives the response, and displays timed success or error messages to the user.

Changes

Filter Save Persistence and Feedback

Layer / File(s) Summary
Backend filter persistence handler
src/webviewPanel.ts (474–488)
The saveFilters message handler wraps serial filter configuration updates in try/catch, responding with filtersSaved status (ok: true/false) and error detail on failure.
Webview filter save UI and feedback
src/webviewPanel.ts (1321–1330, 2155–2181, 2430–2432)
CSS adds success/error styling for the save button. The button click handler disables the button, posts saveFilters with filter values, and manages feedback timing. The message handler processes filtersSaved responses and renders visual feedback.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Save your filters, don't you fret,
The webview sends a message set,
Backend catches with a try,
Success or error—feedback flies,
Status glows in CSS light! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'button "save" feedback' accurately describes the main change: adding visual feedback to the save button when filters are persisted.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch save_feedback

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
Copy Markdown

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/webviewPanel.ts (1)

2180-2190: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add a safety timeout to re-enable the save button.

If the filtersSaved message never arrives due to an IPC failure, the button remains disabled indefinitely. Consider adding a safety timeout (e.g., 5 seconds) to re-enable the button even if no response is received.

🛡️ Proposed fix to add safety timeout
+    var filterSaveFailsafeTimer = null;
     filterSaveBtn.addEventListener('click', () => {
       filterSaveBtn.disabled = true;
+      // Safety timeout in case the message never arrives
+      if (filterSaveFailsafeTimer) { clearTimeout(filterSaveFailsafeTimer); }
+      filterSaveFailsafeTimer = setTimeout(function() {
+        filterSaveBtn.disabled = false;
+        filterSaveBtn.textContent = filterSaveOriginalLabel;
+        filterSaveFailsafeTimer = null;
+      }, 5000);
       vscode.postMessage({
         type: 'saveFilters',
         timestamp: filterState.timestamp,
         suppressPattern: filterState.suppressPattern,
         highlightPattern: filterState.highlightPattern,
         dedupPattern: filterState.dedupPattern,
         dedupThreshold: filterState.dedupThreshold,
       });
     });

And clear it in showFilterSaveFeedback:

     function showFilterSaveFeedback(ok, errorText) {
+      if (filterSaveFailsafeTimer) {
+        clearTimeout(filterSaveFailsafeTimer);
+        filterSaveFailsafeTimer = null;
+      }
       if (filterSaveFeedbackTimer) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/webviewPanel.ts` around lines 2180 - 2190, When handling filterSaveBtn
click (inside the listener that calls vscode.postMessage), add a safety timeout
(e.g., 5000ms) that will re-enable filterSaveBtn and clear any stored timeout id
if no response arrives; store the timer id in a module-scoped variable (e.g.,
filterSaveTimeout) and clear any existing timer before setting a new one to
avoid duplicates. In showFilterSaveFeedback, clearTimeout(filterSaveTimeout) and
set filterSaveTimeout = undefined so the normal response path cancels the safety
fallback; ensure the re-enable logic mirrors the existing successful-response
behavior so the button state is always reset.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/webviewPanel.ts`:
- Around line 1321-1330: Replace the hardcoded white text color in the CSS rules
for button.feedback-saved and button.feedback-error by using a theme variable
(e.g. var(--btn-fg) or another VS Code button foreground like
var(--vscode-button-foreground)) instead of "`#ffffff`", and remove the color: ...
!important to rely on selector specificity (keep the existing selector
button.feedback-saved / button.feedback-error to increase specificity) so the
theme-controlled variable determines foreground color across light/dark themes.

---

Outside diff comments:
In `@src/webviewPanel.ts`:
- Around line 2180-2190: When handling filterSaveBtn click (inside the listener
that calls vscode.postMessage), add a safety timeout (e.g., 5000ms) that will
re-enable filterSaveBtn and clear any stored timeout id if no response arrives;
store the timer id in a module-scoped variable (e.g., filterSaveTimeout) and
clear any existing timer before setting a new one to avoid duplicates. In
showFilterSaveFeedback, clearTimeout(filterSaveTimeout) and set
filterSaveTimeout = undefined so the normal response path cancels the safety
fallback; ensure the re-enable logic mirrors the existing successful-response
behavior so the button state is always reset.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0493fc98-2b58-445b-81bb-dbf1d50ff146

📥 Commits

Reviewing files that changed from the base of the PR and between 2a24454 and e238bd5.

📒 Files selected for processing (2)
  • .gitignore
  • src/webviewPanel.ts

Comment thread src/webviewPanel.ts
@Jason2866 Jason2866 merged commit a66f4ef into main May 18, 2026
3 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.

1 participant