-
-
Notifications
You must be signed in to change notification settings - Fork 64
fix: improve Code tab contrast in light mode #207
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -732,28 +732,29 @@ | |||||||||||||||||||||||||||||||||||||||||||
| // --------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| // Resolves a raw container value (string or Element) to a DOM Element, or null if absent/SSR. | ||||||||||||||||||||||||||||||||||||||||||||
| static _resolveContainer(raw) { | ||||||||||||||||||||||||||||||||||||||||||||
| static _resolveContainer(raw, debug) { | ||||||||||||||||||||||||||||||||||||||||||||
| if (!raw) return null; | ||||||||||||||||||||||||||||||||||||||||||||
| if (typeof document === "undefined") return null; | ||||||||||||||||||||||||||||||||||||||||||||
| return typeof raw === "string" ? document.querySelector(raw) : raw; | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| // Returns the cached host container element, or null. | ||||||||||||||||||||||||||||||||||||||||||||
| _getContainer() { | ||||||||||||||||||||||||||||||||||||||||||||
| return this._containerEl || null; | ||||||||||||||||||||||||||||||||||||||||||||
| if (typeof raw !== "string") return raw; | ||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||
| return document.querySelector(raw); | ||||||||||||||||||||||||||||||||||||||||||||
| } catch (error) { | ||||||||||||||||||||||||||||||||||||||||||||
| SocialShareButton._debugWarn(debug, "Invalid container selector:", raw, error); | ||||||||||||||||||||||||||||||||||||||||||||
| return null; | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+735
to
+743
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Pass the debug flag into Line 13 still calls Proposed fix- const containerEl = SocialShareButton._resolveContainer(options.container);
+ const containerEl = SocialShareButton._resolveContainer(
+ options.container,
+ options.debug
+ );🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||||
| * Logs analytics warnings only when debug mode is enabled. | ||||||||||||||||||||||||||||||||||||||||||||
| * @param {string} message - Description of the failed analytics path. | ||||||||||||||||||||||||||||||||||||||||||||
| * @param {Error} err - The caught error instance. | ||||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||||
| * Logs warnings only when debug mode is enabled. | ||||||||||||||||||||||||||||||||||||||||||||
| * @param {boolean} debug - Whether debug mode is on. | ||||||||||||||||||||||||||||||||||||||||||||
| * @param {string} message - Description of the failed path. | ||||||||||||||||||||||||||||||||||||||||||||
| * @param {Error} [err] - The caught error instance, if any. | ||||||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||||||
| _debugWarn(message, err) { | ||||||||||||||||||||||||||||||||||||||||||||
| // _debugWarn: emit analytics warnings only in debug mode for visibility. | ||||||||||||||||||||||||||||||||||||||||||||
| if (!this.options.debug) return; | ||||||||||||||||||||||||||||||||||||||||||||
| // eslint-disable-next-line no-console | ||||||||||||||||||||||||||||||||||||||||||||
| console.warn("[SocialShareButton Analytics]", message, err); | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| static _debugWarn(debug, message, err) { | ||||||||||||||||||||||||||||||||||||||||||||
| if (!debug) return; | ||||||||||||||||||||||||||||||||||||||||||||
| // eslint-disable-next-line no-console | ||||||||||||||||||||||||||||||||||||||||||||
| console.warn("[SocialShareButton]", message, err); | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+746
to
+755
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win Use a concise inline comment for The new JSDoc block violates the Proposed fix-/**
- * Logs warnings only when debug mode is enabled.
- * `@param` {boolean} debug - Whether debug mode is on.
- * `@param` {string} message - Description of the failed path.
- * `@param` {Error} [err] - The caught error instance, if any.
- */
+// Log warnings only when debug mode is enabled.
static _debugWarn(debug, message, err) {As per path instructions, modified methods must use minimal inline comments rather than JSDoc. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: Path instructions |
||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||||
| * Emits an analytics event through all configured delivery paths. | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -814,7 +815,7 @@ | |||||||||||||||||||||||||||||||||||||||||||
| const el = this._getContainer(); | ||||||||||||||||||||||||||||||||||||||||||||
| (el || document).dispatchEvent(domEvent); | ||||||||||||||||||||||||||||||||||||||||||||
| } catch (err) { | ||||||||||||||||||||||||||||||||||||||||||||
| this._debugWarn("DOM event dispatch failed", err); | ||||||||||||||||||||||||||||||||||||||||||||
| SocialShareButton._debugWarn(this.options.debug, message, err); | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -823,7 +824,7 @@ | |||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||
| this.options.onAnalytics(payload); | ||||||||||||||||||||||||||||||||||||||||||||
| } catch (err) { | ||||||||||||||||||||||||||||||||||||||||||||
| this._debugWarn("onAnalytics callback failed", err); | ||||||||||||||||||||||||||||||||||||||||||||
| SocialShareButton._debugWarn(this.options.debug, message, err); | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -834,7 +835,7 @@ | |||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||
| plugin.track(payload); | ||||||||||||||||||||||||||||||||||||||||||||
| } catch (err) { | ||||||||||||||||||||||||||||||||||||||||||||
| this._debugWarn("plugin.track() failed", err); | ||||||||||||||||||||||||||||||||||||||||||||
| SocialShareButton._debugWarn(this.options.debug, message, err); | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
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.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: AOSSIE-Org/SocialShareButton
Length of output: 1033
🏁 Script executed:
Repository: AOSSIE-Org/SocialShareButton
Length of output: 5144
Preserve the caught selector error.
_debugWarn(debug, message, err)logs exactlymessageanderr; passingrawas the third argument logs the selector instead of thequerySelectorexception.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents
Source: Learnings