Skip to content

Conversation

@khulnasoft-bot
Copy link
Contributor

@khulnasoft-bot khulnasoft-bot commented Oct 16, 2025

Category:

One of: Bugfix / Feature / Code style update / Refactoring Only / Build related changes / Documentation / Other (please specify)

Overview

Briefly outline your new changes...

Issue Number (if applicable) #00

New Vars (if applicable)

If you've added any new build scripts, environmental variables, config file options, dependency or devDependency, please outline here

Screenshot (if applicable)

If you've introduced any significant UI changes, please include a screenshot

Code Quality Checklist (Please complete)

  • All changes are backwards compatible
  • All lint checks and tests are passing
  • There are no (new) build warnings or errors
  • (If a new config option is added) Attribute is outlined in the schema and documented
  • (If a new dependency is added) Package is essential, and has been checked out for security or performance
  • (If significant change) Bumps version in package.json

Summary by CodeRabbit

  • New Features

    • Added a Chuck Norris joke widget that fetches and displays a random joke with optional category filtering.
    • Updated available widgets list to add new widget types and remove a couple of older ones.
  • Documentation

    • Added user documentation for the Chuck Norris widget (usage, options, and examples); documentation appears in multiple places.
  • Style

    • Added scoped styling for improved readability and visual consistency of the widget.

Signed-off-by: KhulnaSoft bot <43526132+khulnasoft-bot@users.noreply.github.com>
@netlify
Copy link

netlify bot commented Oct 16, 2025

Deploy Preview for shipyard failed.

Name Link
🔨 Latest commit 74cea45
🔍 Latest deploy log https://app.netlify.com/projects/shipyard/deploys/68f19794629ee70008dceb2c

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 16, 2025

Walkthrough

Adds a new Vue widget component that fetches and displays Chuck Norris jokes (optional category filter), registers a new chuckNorris API endpoint, updates widget type mappings in WidgetBase, and adds documentation for the widget.

Changes

Cohort / File(s) Summary
New Widget Component
src/components/Widgets/ChuckNorris.vue
Adds a Vue SFC using WidgetMixin that computes categories and endpoint, fetches data with axios (fetchData), processes response into chuckNorrisLine (processData), reports errors via this.error, calls finishLoading, and includes scoped SCSS and template rendering.
API Endpoint Defaults
src/utils/defaults.js
Adds widgetApiEndpoints.chuckNorris set to https://api.chucknorris.io/jokes/random in the exported defaults object.
Widget type registry
src/components/Widgets/WidgetBase.vue
Updates COMPAT mappings: adds chucknorris -> ChuckNorris, gluetun-status -> GluetunStatus, linkding -> Linkding; removes code-stats and covid-stats.
Documentation
docs/widgets.md
Adds documentation entries for the Chuck Norris widget (inserted into the contents and as a detailed section; appears duplicated in the file).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User as User
  participant Widget as ChuckNorris.vue
  participant Axios as axios
  participant API as ChuckNorris API

  User->>Widget: mount / trigger fetchData()
  activate Widget
  Widget->>Widget: compute categories, build endpoint
  Widget->>Axios: GET endpoint
  activate Axios
  Axios->>API: HTTP GET /jokes/random[?category=...]
  activate API
  API-->>Axios: 200 OK { value }
  deactivate API
  Axios-->>Widget: response.data
  deactivate Axios
  Widget->>Widget: processData -> set chuckNorrisLine
  Widget-->>User: render joke line
  Widget->>Widget: finishLoading()
  deactivate Widget

  alt Error path
    Widget->>Axios: GET endpoint
    Axios-->>Widget: network/error
    Widget->>Widget: this.error(message)
    Widget->>Widget: finishLoading()
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I hop through code with whiskers keen,
A chuckle fetched from Norris' scene—
Categories trimmed, endpoint set,
Axios scurries, line is met.
Finish loading — carrot yet. 🥕🐇

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description contains only the repository's contribution template with all placeholder fields left unfilled. Required sections including Category, Overview, Issue Number, New Vars, and the Code Quality Checklist are not populated with any actual information. The author has not provided context about the changes, justification for the new variables added (such as the chuckNorris API endpoint), or confirmation of the code quality checklist items, leaving reviewers without the essential information needed to understand the PR's intent and scope. The author should complete all required template sections: specify the Category as "Feature", provide an Overview of the changes (new Chuck Norris widget component, API endpoint configuration, and documentation), list New Vars including the widgetApiEndpoints.chuckNorris property, and complete the Code Quality Checklist by checking applicable items or providing relevant notes. At minimum, the Category, Overview, and any applicable New Vars must be filled in to allow proper review of the contribution.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "Add Widget for Chuck Norris quotes" is clear, concise, and directly related to the primary change in the changeset. The title accurately describes that a new Chuck Norris widget component is being added to the project. It is specific enough to convey the main purpose without vague terminology, and a teammate reviewing the commit history would immediately understand that this PR introduces a new widget feature.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chuckNorris

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0e44d90 and 74cea45.

📒 Files selected for processing (1)
  • src/components/Widgets/ChuckNorris.vue (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/Widgets/ChuckNorris.vue

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
Contributor

@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: 2

🧹 Nitpick comments (1)
src/components/Widgets/ChuckNorris.vue (1)

14-14: Consider removing the empty components object.

The empty components: {} object is unnecessary and can be removed to reduce clutter.

Apply this diff:

  mixins: [WidgetMixin],
-  components: {},
  data() {
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7410fa0 and 7e0b197.

📒 Files selected for processing (1)
  • src/components/Widgets/ChuckNorris.vue (1 hunks)

Signed-off-by: KhulnaSoft bot <43526132+khulnasoft-bot@users.noreply.github.com>
Signed-off-by: KhulnaSoft bot <43526132+khulnasoft-bot@users.noreply.github.com>
Signed-off-by: KhulnaSoft bot <43526132+khulnasoft-bot@users.noreply.github.com>
Copy link
Contributor

@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: 0

🧹 Nitpick comments (1)
src/utils/defaults.js (1)

227-227: LGTM! Note naming inconsistency.

The API endpoint addition is correct and follows the existing pattern. However, note that this uses camelCase (chuckNorris) while the widget type in WidgetBase.vue uses all lowercase (chucknorris). While this should work functionally (they're used in different contexts), consider whether consistent naming would improve maintainability.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e0b197 and b3dedb1.

📒 Files selected for processing (2)
  • src/components/Widgets/WidgetBase.vue (2 hunks)
  • src/utils/defaults.js (1 hunks)
🔇 Additional comments (1)
src/components/Widgets/WidgetBase.vue (1)

52-52: Widget component files verified—code changes are correct.

All three widget component files referenced in the mappings (ChuckNorris.vue, GluetunStatus.vue, and Linkding.vue) exist and contain valid Vue component implementations. The mappings in WidgetBase.vue follow the correct pattern and maintain alphabetical ordering.

The code implementation is sound and ready to merge.

Copy link
Contributor

@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: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b3dedb1 and 0e44d90.

📒 Files selected for processing (1)
  • docs/widgets.md (2 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
docs/widgets.md

32-32: Link fragments should be valid

(MD051, link-fragments)


1005-1005: Images should have alternate text (alt text)

(MD045, no-alt-text)


1011-1011: Link text should be descriptive

(MD059, descriptive-link-text)

- [Stock Price History](#stock-price-history)
- [ETH Gas Prices](#eth-gas-prices)
- [Joke of the Day](#joke)
- [Chuck Norris quotes](#chucknorris)
Copy link
Contributor

@coderabbitai coderabbitai bot Oct 16, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix the broken table-of-contents anchor.

The link points to #chucknorris, but the markdown heading renders as #chuck-norris-quotes, so the TOC entry won’t jump to the section. Update the fragment to use #chuck-norris-quotes.

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

32-32: Link fragments should be valid

(MD051, link-fragments)

🤖 Prompt for AI Agents
In docs/widgets.md around line 32, the TOC entry uses the wrong fragment
'#chucknorris' which doesn't match the rendered heading; update the link target
to '#chuck-norris-quotes' so the table-of-contents anchor matches the heading
and navigates correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In docs/widgets.md around line 32, the TOC entry uses the wrong fragment
'#chucknorris' which doesn't match the rendered heading; update the link target
to '#chuck-norris-quotes' so the table-of-contents anchor matches the heading
and navigates correctly.

Copy link
Contributor

Choose a reason for hiding this comment

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

@khulnasoft-bot, you're absolutely right! The table of contents anchor needs to be corrected.

The issue is that markdown heading anchors are generated by converting the heading text to lowercase and replacing spaces with hyphens. So the heading ### Chuck Norris quotes creates the anchor #chuck-norris-quotes, not #chucknorris.

The fix:

Change line 32 from:

  - [Chuck Norris quotes](#chucknorris)

To:

  - [Chuck Norris quotes](#chuck-norris-quotes)

This will ensure the table of contents link correctly navigates to the Chuck Norris quotes widget section.


Renders a Chuck Norris quote. Data is fetched from the [ChuckNorrisAPI](https://api.chucknorris.io/) by @matchilling. All fields are optional.

<p align="center"><img width="400" src="https://tbd" /></p>
Copy link
Contributor

@coderabbitai coderabbitai bot Oct 16, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add meaningful alt text (and avoid placeholder URLs).

The image uses a placeholder URL and lacks an alt attribute, which breaks accessibility guidelines and ships a dead link. Either provide the real screenshot with descriptive alt text or remove the image block until it’s available.

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

1005-1005: Images should have alternate text (alt text)

(MD045, no-alt-text)

🤖 Prompt for AI Agents
In docs/widgets.md around line 1005, the image uses a placeholder URL and has no
alt text; replace the placeholder src with the real screenshot URL (or remove
the entire <p> block until the image is available) and add a meaningful alt
attribute describing the image content (e.g., alt="Screenshot of widget settings
panel showing X, Y, Z") to satisfy accessibility and avoid dead links.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In docs/widgets.md around line 1005, the image uses a placeholder URL and has no
alt text; replace the placeholder src with the real screenshot URL (or remove
the entire

block until the image is available) and add a meaningful alt
attribute describing the image content (e.g., alt="Screenshot of widget settings
panel showing X, Y, Z") to satisfy accessibility and avoid dead links.

Copy link
Contributor

Choose a reason for hiding this comment

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

@khulnasoft-bot, you're right to flag this! The placeholder image should be addressed before merging.

For the Chuck Norris widget documentation, I recommend one of these approaches:

Option 1: Add a real screenshot (preferred)

  1. Take a screenshot of the widget in action showing a Chuck Norris quote
  2. Upload it to i.ibb.co (following the pattern used by other widgets in this file)
  3. Replace the placeholder with the real URL and add descriptive alt text:
<p align="center"><img width="400" src="https://i.ibb.co/[your-image-id]/chuck-norris.png" alt="Chuck Norris widget displaying a quote" /></p>

Option 2: Remove the placeholder (temporary)
If a screenshot isn't ready yet, remove the entire image block for now:

### Chuck Norris quotes

Renders a Chuck Norris quote. Data is fetched from the [ChuckNorrisAPI](https://api.chucknorris.io/) by @matchilling. All fields are optional.

#### Options

This keeps the documentation accessible and avoids dead links until a proper screenshot is available. Looking at other widgets in the file (like the Joke widget just above), they all use properly hosted images with the same hosting service, so following that pattern would maintain consistency.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: fortishield <161459699+FortiShield@users.noreply.github.com>
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.

3 participants