Skip to content

Conversation

@josefinalliende
Copy link
Collaborator

@josefinalliende josefinalliende commented Jan 23, 2026

Description

Setup widget book with colors story

Screen.Recording.2026-01-23.at.5.29.01.PM.mov

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore
  • 🧪 Tests

Checklist

  • Run just precommit to ensure that formatting and linting are correct
  • Updated the CHANGELOG.md file with your changes (if they affect the user experience)

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Widgetbook integration for interactive component documentation and design system exploration across iOS, Android, macOS, Windows, and Linux.
    • Added URL Launcher plugin support for opening URLs across all platforms.
  • Tests

    • Added comprehensive test coverage for message menu hook functionality.
  • Chores

    • Updated build configurations and version control ignores for all platforms.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

Walkthrough

The pull request introduces Widgetbook integration for component documentation and testing, adds URL Launcher plugin support across multiple platforms (Linux, macOS, Windows), includes a new test file for the useMessageMenu hook, and establishes complete Widgetbook Flutter application scaffolding with native platform configurations for Android, iOS, and macOS.

Changes

Cohort / File(s) Summary
Root Configuration & Build Recipes
.gitignore, justfile
Updates ignore patterns for Widgetbook artifacts; adds five new Justfile recipes (deps-widgetbook, generate-widgetbook, widgetbook-ios, widgetbook-android, widgetbook-macos) with interdependent execution flow.
URL Launcher Plugin Registration
linux/flutter/generated_plugin_registrant.cc, linux/flutter/generated_plugins.cmake, macos/Flutter/GeneratedPluginRegistrant.swift, windows/flutter/generated_plugin_registrant.cc, windows/flutter/generated_plugins.cmake
Registers UrlLauncher plugin across Linux, macOS, and Windows platforms in auto-generated plugin registrant and CMake/build configuration files.
Main Project Test
test/hooks/use_message_menu_test.dart
Adds widget tests for useMessageMenu hook covering state initialization, emoji picker toggling, and close scenarios (58 lines).
Widgetbook Project Root
widgetbook/.gitignore, widgetbook/.metadata, widgetbook/analysis_options.yaml, widgetbook/pubspec.yaml
Establishes Widgetbook app project configuration including IDE/build artifact ignores, Flutter metadata with migration info, Dart linter rules, and pubspec with dependencies (widgetbook, widgetbook_annotation, widgetbook_generator) and asset/font configurations.
Widgetbook Dart Application
widgetbook/lib/main.dart, widgetbook/lib/main.directories.g.dart, widgetbook/lib/stories/colors.dart
Creates Widgetbook app entry point with material design theming and device frame addons; generates directory structure wiring component stories; implements ColorsStory widget with light/dark color pair swatches across semantic sections (Background, Fill, Border, Intention, Accent).
Widgetbook Android Platform
widgetbook/android/*
Complete Android app scaffolding including Gradle Kotlin DSL build configuration, Gradle wrapper, settings, app-level manifest/build configs, debug/release/profile manifests, MainActivity activity, and layout/theme resources.
Widgetbook iOS Platform
widgetbook/ios/*
Full iOS project structure with Xcode project file (731 lines), Runner/RunnerTests targets, CocoaPods Podfile, Swift AppDelegate, storyboards, asset catalogs (AppIcon, LaunchImage), plist configurations, scheme definitions, and workspace setup.
Widgetbook macOS Platform
widgetbook/macos/*
Complete macOS app scaffolding featuring Xcode project (801 lines), Runner/RunnerTests targets, CocoaPods Podfile, Swift AppDelegate and MainFlutterWindow, XIB main menu, asset catalogs, Info.plist, entitlements, xcconfig files with warning settings, and workspace configuration.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

This review requires understanding multiple heterogeneous platform configurations (Android Gradle/Kotlin, iOS/macOS Xcode/Swift/CocoaPods), URL Launcher plugin integration patterns, and Widgetbook-specific setup across three platforms. While many changes follow standard Flutter boilerplate, the diversity of build systems, the substantial size of Xcode project files, and careful verification of platform-specific integrations demand detailed attention.

Suggested reviewers

  • untreu2
🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The PR title "Feat/widgetbook" is vague and lacks specificity. While it indicates a feature related to Widgetbook, it doesn't clearly convey the primary change or scope of the pull request, which involves adding comprehensive Widgetbook setup with stories, plugins, and platform configurations. Consider using a more descriptive title such as "Add Widgetbook integration with stories and platform setup" or "Set up Widgetbook with iOS, Android, and macOS support" to better summarize the main changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing touches
  • 📝 Generate docstrings

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

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

🤖 Fix all issues with AI agents
In `@test/hooks/use_message_menu_test.dart`:
- Around line 1-3: Tests import use_message_menu.dart but the hook
implementation is missing; create lib/hooks/use_message_menu.dart and implement
the exported symbols toggleEmojiPicker(), closeEmojiPicker(), and the
showEmojiPicker property (e.g., as a boolean state exposed by the hook) so tests
can run; ensure the hook initializes showEmojiPicker to false, toggles its value
in toggleEmojiPicker(), and sets it false in closeEmojiPicker(), and export the
hook API with the exact names used in the tests (toggleEmojiPicker,
closeEmojiPicker, showEmojiPicker).

In `@widgetbook/analysis_options.yaml`:
- Around line 23-25: The lint rules block in analysis_options.yaml is missing
repository-standard rules; add explicit entries for prefer_const_constructors
and prefer_final_locals under the existing rules: set prefer_const_constructors:
true and prefer_final_locals: true so the analyzer enforces these Dart/Flutter
conventions consistently with the main project (modify the rules mapping shown
in the file where the commented rules live).

In `@widgetbook/android/app/src/main/AndroidManifest.xml`:
- Around line 2-5: Replace the hardcoded android:label in the <application> tag
with a string resource reference (use android:label="@string/app_name") and add
the corresponding app_name entry in res/values/strings.xml; update the
manifest's android:label attribute (android:label="@string/app_name") and create
or modify strings.xml to include <string name="app_name">YourAppName</string> so
the label is localizable and reusable.

In `@widgetbook/android/gradle.properties`:
- Around line 1-2: The repo-wide gradle JVM settings in org.gradle.jvmargs
currently force high memory (e.g., -Xmx8G and -XX:MaxMetaspaceSize=4G) which can
break CI or low-RAM dev machines; change widgetbook/android/gradle.properties to
use conservative defaults (for example -Xmx2G and remove or lower
MaxMetaspaceSize/ReservedCodeCacheSize) and add a comment advising developers to
set higher values in their local ~/.gradle/gradle.properties if needed, ensuring
org.gradle.jvmargs remains overrideable by local gradle configuration.

In `@widgetbook/ios/Podfile`:
- Line 33: Replace the call to File.dirname(File.realpath(__FILE__)) used as the
argument to flutter_install_all_ios_pods with the Ruby built-in __dir__ to get
the current file directory; update the invocation of
flutter_install_all_ios_pods (the line containing flutter_install_all_ios_pods
and File.dirname(File.realpath(__FILE__))) so it passes __dir__ instead, keeping
the same behavior but following RuboCop's Style/Dir and more idiomatic Ruby.

In `@widgetbook/ios/Runner.xcodeproj/project.pbxproj`:
- Around line 474-475: The project file currently hard-codes DEVELOPMENT_TEAM =
NQ6ZND3746 in the Runner build configurations; remove that literal team ID from
the Runner build configs and either (a) delete the DEVELOPMENT_TEAM entries from
project.pbxproj so signing is resolved via each developer's/user .xcconfig or
CI, or (b) replace the literal with a placeholder/variable (e.g.
DEVELOPMENT_TEAM = $(DEVELOPMENT_TEAM)) and add the real value in a
user-specific .xcconfig or CI build settings; make the same change for every
Runner build config where DEVELOPMENT_TEAM appears.

In `@widgetbook/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md`:
- Around line 1-5: Add a single trailing newline to the Markdown file README.md
in LaunchImage.imageset to satisfy markdownlint rule MD047; simply open the
README.md and ensure the file ends with a newline character (no other content
changes).

In `@widgetbook/lib/main.directories.g.dart`:
- Around line 13-14: The generated import
package:sloth_widgetbook/stories/colors.dart fails because the root pubspec.yaml
is missing a path dependency for the local package named sloth_widgetbook; fix
this by adding sloth_widgetbook as a dependency that points to the widgetbook
directory (i.e., under dependencies add sloth_widgetbook with path: widgetbook)
so the import in main.directories.g.dart can be resolved by the generator.

In `@widgetbook/lib/stories/colors.dart`:
- Around line 200-224: The build fails because SemanticColors is missing the
getters borderInfo, borderSuccess, and borderWarning which are referenced by
light.borderInfo, light.borderSuccess, and light.borderWarning in the
_ColorPairItem instances inside colors.dart; fix it by either adding these
getters to the SemanticColors class (in lib/theme.dart) with the correct return
type (e.g., Color) and sensible default/derived values, or remove/comment out
the three _ColorPairItem blocks (semanticName 'Border Info', 'Border Success',
'Border Warning') in widgetbook/lib/stories/colors.dart so the code no longer
references the non-existent properties.

In `@widgetbook/macos/Podfile`:
- Around line 29-36: Replace the long path expression used when invoking
flutter_install_all_macos_pods in the Runner target: locate the call
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) and replace
the File.dirname(File.realpath(__FILE__)) argument with the Ruby idiom __dir__
to simplify path resolution while preserving behavior.

In `@widgetbook/macos/Runner/Configs/AppInfo.xcconfig`:
- Around line 8-12: Replace the placeholder bundle identifier in the macOS app
config: update the PRODUCT_BUNDLE_IDENTIFIER value (currently
"com.example.slothWidgetbook") to your app's real reverse‑DNS identifier that
matches your team/app ID and provisioning profile; ensure PRODUCT_NAME
(sloth_widgetbook) and signing settings remain consistent with the new bundle
identifier to avoid provisioning/signing collisions.

In `@widgetbook/pubspec.yaml`:
- Around line 5-7: The environment SDK constraints in the pubspec's environment
block are incompatible with the specified Flutter version; update the Dart SDK
constraint under the environment keys (sdk: ...) to match Flutter 3.38.4+ by
changing the Dart constraint to ^3.10.0 (or alternatively downgrade the flutter
constraint to a 3.35.x series if you must stay on Dart 3.9.2) so the sdk and
flutter entries are consistent.

Comment on lines +1 to +3
import 'package:flutter_test/flutter_test.dart';
import 'package:sloth/hooks/use_message_menu.dart';
import '../test_helpers.dart';
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# Check if the use_message_menu.dart hook exists
fd "use_message_menu.dart" lib/

Repository: marmot-protocol/sloth

Length of output: 47


🏁 Script executed:

# Also explore the hooks directory structure
git ls-files lib/hooks/

Repository: marmot-protocol/sloth

Length of output: 492


🏁 Script executed:

# Verify the test file exists
git ls-files test/hooks/ | grep use_message_menu

Repository: marmot-protocol/sloth

Length of output: 102


🏁 Script executed:

# Search for any references to useMessageMenu or use_message_menu in the codebase
rg "use_message_menu|useMessageMenu" --type dart

Repository: marmot-protocol/sloth

Length of output: 739


🏁 Script executed:

# Read the test file to understand what hook API is expected
cat test/hooks/use_message_menu_test.dart

Repository: marmot-protocol/sloth

Length of output: 1844


🏁 Script executed:

# Check if there are any recent commits or changes related to message menu
git log --oneline --all -- "*message_menu*" | head -20

Repository: marmot-protocol/sloth

Length of output: 200


🏁 Script executed:

# Search for any implementation related to message menu, emoji picker, etc.
rg "showEmojiPicker|toggleEmojiPicker|closeEmojiPicker" --type dart

Repository: marmot-protocol/sloth

Length of output: 1837


🏁 Script executed:

# Check if there are any message or menu related widgets/files
fd -e dart | xargs rg "message.*menu|menu.*message" -l --type dart | head -20

Repository: marmot-protocol/sloth

Length of output: 205


🏁 Script executed:

# Check the wn_message_menu_test.dart to see if it provides context
cat test/widgets/wn_message_menu_test.dart

Repository: marmot-protocol/sloth

Length of output: 13183


🏁 Script executed:

# Check chat_screen.dart to see if it references the hook
rg "use_message_menu|useMessageMenu" lib/screens/chat_screen.dart

Repository: marmot-protocol/sloth

Length of output: 47


Missing hook implementation—tests cannot run.

The test file imports package:sloth/hooks/use_message_menu.dart, which does not exist in lib/hooks/. Create the hook implementation with methods toggleEmojiPicker() and closeEmojiPicker(), and a property showEmojiPicker, or remove these tests until the hook is implemented.

🧰 Tools
🪛 GitHub Actions: CI

[error] 2-2: Target of URI doesn't exist: 'package:sloth/hooks/use_message_menu.dart'

🤖 Prompt for AI Agents
In `@test/hooks/use_message_menu_test.dart` around lines 1 - 3, Tests import
use_message_menu.dart but the hook implementation is missing; create
lib/hooks/use_message_menu.dart and implement the exported symbols
toggleEmojiPicker(), closeEmojiPicker(), and the showEmojiPicker property (e.g.,
as a boolean state exposed by the hook) so tests can run; ensure the hook
initializes showEmojiPicker to false, toggles its value in toggleEmojiPicker(),
and sets it false in closeEmojiPicker(), and export the hook API with the exact
names used in the tests (toggleEmojiPicker, closeEmojiPicker, showEmojiPicker).

Comment on lines +23 to +25
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider enabling additional lint rules per repository guidelines.

Based on learnings, the repository enforces prefer_const_constructors and prefer_final_locals lint rules for Dart/Flutter code. Consider explicitly enabling these rules to maintain consistency with the main project's coding standards.

♻️ Suggested addition
   rules:
     # avoid_print: false  # Uncomment to disable the `avoid_print` rule
     # prefer_single_quotes: true  # Uncomment to enable the `prefer_single_quotes` rule
+    prefer_const_constructors: true
+    prefer_final_locals: true
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
prefer_const_constructors: true
prefer_final_locals: true
🤖 Prompt for AI Agents
In `@widgetbook/analysis_options.yaml` around lines 23 - 25, The lint rules block
in analysis_options.yaml is missing repository-standard rules; add explicit
entries for prefer_const_constructors and prefer_final_locals under the existing
rules: set prefer_const_constructors: true and prefer_final_locals: true so the
analyzer enforces these Dart/Flutter conventions consistently with the main
project (modify the rules mapping shown in the file where the commented rules
live).

Comment on lines +2 to +5
<application
android:label="sloth_widgetbook"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use a string resource for the app label.
Hardcoded labels hinder localization and reuse; prefer @string/app_name and define it in res/values/strings.xml.

💡 Proposed fix
-    <application
-        android:label="sloth_widgetbook"
+    <application
+        android:label="@string/app_name"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<application
android:label="sloth_widgetbook"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<application
android:label="@string/app_name"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
🤖 Prompt for AI Agents
In `@widgetbook/android/app/src/main/AndroidManifest.xml` around lines 2 - 5,
Replace the hardcoded android:label in the <application> tag with a string
resource reference (use android:label="@string/app_name") and add the
corresponding app_name entry in res/values/strings.xml; update the manifest's
android:label attribute (android:label="@string/app_name") and create or modify
strings.xml to include <string name="app_name">YourAppName</string> so the label
is localizable and reusable.

Comment on lines +1 to +2
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Avoid repo-wide 8G/4G Gradle defaults.

These JVM settings can prevent Gradle from starting on CI or dev machines with <8 GB RAM. Prefer conservative defaults and allow local overrides (e.g., ~/.gradle/gradle.properties).

🔧 Proposed adjustment
-org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
+org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=1G -XX:ReservedCodeCacheSize=256m -XX:+HeapDumpOnOutOfMemoryError
 android.useAndroidX=true
🤖 Prompt for AI Agents
In `@widgetbook/android/gradle.properties` around lines 1 - 2, The repo-wide
gradle JVM settings in org.gradle.jvmargs currently force high memory (e.g.,
-Xmx8G and -XX:MaxMetaspaceSize=4G) which can break CI or low-RAM dev machines;
change widgetbook/android/gradle.properties to use conservative defaults (for
example -Xmx2G and remove or lower MaxMetaspaceSize/ReservedCodeCacheSize) and
add a comment advising developers to set higher values in their local
~/.gradle/gradle.properties if needed, ensuring org.gradle.jvmargs remains
overrideable by local gradle configuration.

target 'Runner' do
use_frameworks!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

🧩 Analysis chain

🌐 Web query:

RuboCop Style/Dir Ruby __dir__ guidance

💡 Result:

RuboCop’s Style/Dir cop enforces using Ruby’s __dir__ instead of more complex ways of getting “the directory of the current file” (typically File.dirname(__FILE__) wrapped in File.expand_path, File.realpath, etc.). It’s enabled by default and applies when targeting Ruby 2.0+. [1]

What to do

  • Replace patterns like:
    File.expand_path(File.dirname(__FILE__))
    # or
    File.dirname(File.realpath(__FILE__))
    with:
    __dir__
    because __dir__ already provides an absolute (canonicalized) path to the current file’s directory. [1][2]

Common “good” usage

File.join(__dir__, "data", "config.yml")

If you can’t use __dir__

If your project targets Ruby < 2.0, you’ll need to disable the cop (or raise your TargetRubyVersion). [1]

Sources: RuboCop cop docs for Style/Dir. [1][2]


🌐 Web query:

Ruby __dir__ vs File.dirname File.realpath __FILE__ equivalent

💡 Result:

In Ruby (>= 2.0), __dir__ is the direct equivalent of:

File.dirname(File.realpath(__FILE__))

It returns the canonicalized absolute directory of the file where it’s called (i.e., symlinks are resolved), and Ruby’s docs explicitly state the equivalence to File.dirname(File.realpath(__FILE__)). [1]

How the common options differ

  • File.dirname(__FILE__)
    Returns the directory name of whatever string __FILE__ contains—often relative (e.g. "."), depending on how the file was loaded/invoked. [2]

  • File.expand_path(File.dirname(__FILE__))
    Gives an absolute path, but does not inherently resolve symlinks the way realpath does (it expands, but doesn’t “dereference” symlinks). [3]

  • File.dirname(File.realpath(__FILE__)) / __dir__
    Gives an absolute, symlink-resolved directory, but note File.realpath requires the path’s components to exist. [1][4]

Practical recommendation

Use __dir__ when you want a stable “directory of this source file” (especially when symlinks may be involved). [1][3]

Sources: [1] [2] [3] [4]


🌐 Web query:

Podfile Ruby version support __dir__

💡 Result:

__dir__ is available starting in Ruby 2.0.0 (it was added as Kernel#__dir__).[1]

So a Podfile can use __dir__ as long as CocoaPods is running on Ruby >= 2.0—and in practice it’s almost always safe because CocoaPods has required newer Rubies for years (e.g., CocoaPods 1.11 raised the minimum Ruby to 2.6).[2] On many modern installs, you may effectively need Ruby >= 2.7.4 due to current CocoaPods dependencies like cocoapods-downloader.[3]

If you must support older Ruby (< 2.0), use:

File.expand_path(File.dirname(__FILE__))

Sources: [1] [2] [3]


Prefer __dir__ for current directory resolution.

This aligns with RuboCop's Style/Dir cop and provides the same functionality as File.dirname(File.realpath(__FILE__)) with cleaner, more idiomatic syntax.

♻️ Proposed change
-  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
+  flutter_install_all_ios_pods __dir__
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
flutter_install_all_ios_pods __dir__
🧰 Tools
🪛 RuboCop (1.82.1)

[convention] 33-33: Use __dir__ to get an absolute path to the current file's directory.

(Style/Dir)

🤖 Prompt for AI Agents
In `@widgetbook/ios/Podfile` at line 33, Replace the call to
File.dirname(File.realpath(__FILE__)) used as the argument to
flutter_install_all_ios_pods with the Ruby built-in __dir__ to get the current
file directory; update the invocation of flutter_install_all_ios_pods (the line
containing flutter_install_all_ios_pods and
File.dirname(File.realpath(__FILE__))) so it passes __dir__ instead, keeping the
same behavior but following RuboCop's Style/Dir and more idiomatic Ruby.

Comment on lines +13 to +14
import 'package:sloth_widgetbook/stories/colors.dart'
as _sloth_widgetbook_stories_colors;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# Check the package name in widgetbook/pubspec.yaml
echo "=== Package name in pubspec.yaml ==="
if [ -f "widgetbook/pubspec.yaml" ]; then
    grep -E "^name:" widgetbook/pubspec.yaml
else
    echo "widgetbook/pubspec.yaml not found"
fi

echo ""
echo "=== Directory structure of widgetbook/lib ==="
if [ -d "widgetbook/lib" ]; then
    find widgetbook/lib -type f -name "*.dart" | head -20
else
    echo "widgetbook/lib directory not found"
fi

echo ""
echo "=== Searching for colors.dart ==="
fd -t f "colors.dart" widgetbook/ 2>/dev/null || find widgetbook -name "colors.dart" 2>/dev/null

echo ""
echo "=== Checking for stories directory ==="
fd -t d "stories" widgetbook/ 2>/dev/null || find widgetbook -type d -name "stories" 2>/dev/null

echo ""
echo "=== Main project root files ==="
ls -la | grep -E "pubspec|\.yaml"

Repository: marmot-protocol/sloth

Length of output: 852


🏁 Script executed:

#!/bin/bash

echo "=== Root pubspec.yaml dependencies section ==="
grep -A 50 "^dependencies:" pubspec.yaml | head -60

echo ""
echo "=== Check for widgetbook in dependencies ==="
grep -E "widgetbook|sloth_widgetbook" pubspec.yaml

echo ""
echo "=== Checking main.directories.g.dart imports ==="
head -20 widgetbook/lib/main.directories.g.dart

Repository: marmot-protocol/sloth

Length of output: 2501


Add sloth_widgetbook as a path dependency to the root pubspec.yaml.

The generated import package:sloth_widgetbook/stories/colors.dart fails because the local widgetbook/ package is not configured as a dependency. While widgetbook/pubspec.yaml correctly defines name: sloth_widgetbook and stories/colors.dart exists, the root pubspec.yaml must list it as a path dependency:

dependencies:
  sloth_widgetbook:
    path: widgetbook

This generated file cannot be modified directly, but adding this dependency will allow the generator to correctly resolve the import path.

🧰 Tools
🪛 GitHub Actions: CI

[error] 13-13: Target of URI doesn't exist: 'package:sloth_widgetbook/stories/colors.dart'

🤖 Prompt for AI Agents
In `@widgetbook/lib/main.directories.g.dart` around lines 13 - 14, The generated
import package:sloth_widgetbook/stories/colors.dart fails because the root
pubspec.yaml is missing a path dependency for the local package named
sloth_widgetbook; fix this by adding sloth_widgetbook as a dependency that
points to the widgetbook directory (i.e., under dependencies add
sloth_widgetbook with path: widgetbook) so the import in main.directories.g.dart
can be resolved by the generator.

Comment on lines +200 to +224
// Info
_ColorPairItem(
semanticName: 'Border Info',
lightColor: light.borderInfo,
darkColor: dark.borderInfo,
),
// Success
_ColorPairItem(
semanticName: 'Border Success',
lightColor: light.borderSuccess,
darkColor: dark.borderSuccess,
),
// Warning
_ColorPairItem(
semanticName: 'Border Warning',
lightColor: light.borderWarning,
darkColor: dark.borderWarning,
),
// Shadow
_ColorPairItem(
semanticName: 'Shadow',
lightColor: light.shadow,
darkColor: dark.shadow,
),
]),
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Build failure: Missing getters on SemanticColors.

The pipeline reports that borderInfo, borderSuccess, and borderWarning getters are not defined on SemanticColors. This causes compilation errors.

Either add these properties to the SemanticColors class in lib/theme.dart, or remove/comment out these color pair items until the theme is updated.

🐛 Proposed fix to remove non-existent properties
         // Intention
         _buildPairSection('Intention', [
           // Error
           _ColorPairItem(
             semanticName: 'Fill Destructive',
             lightColor: light.fillDestructive,
             darkColor: dark.fillDestructive,
           ),
           _ColorPairItem(
             semanticName: 'Fill Destructive Hover',
             lightColor: light.fillDestructiveHover,
             darkColor: dark.fillDestructiveHover,
           ),
           _ColorPairItem(
             semanticName: 'Fill Destructive Active',
             lightColor: light.fillDestructiveActive,
             darkColor: dark.fillDestructiveActive,
           ),
-          // Info
-          _ColorPairItem(
-            semanticName: 'Border Info',
-            lightColor: light.borderInfo,
-            darkColor: dark.borderInfo,
-          ),
-          // Success
-          _ColorPairItem(
-            semanticName: 'Border Success',
-            lightColor: light.borderSuccess,
-            darkColor: dark.borderSuccess,
-          ),
-          // Warning
-          _ColorPairItem(
-            semanticName: 'Border Warning',
-            lightColor: light.borderWarning,
-            darkColor: dark.borderWarning,
-          ),
           // Shadow
           _ColorPairItem(
             semanticName: 'Shadow',
             lightColor: light.shadow,
             darkColor: dark.shadow,
           ),
         ]),
🧰 Tools
🪛 GitHub Actions: CI

[error] 203-203: The getter 'borderInfo' isn't defined for the type 'SemanticColors'


[error] 204-204: The getter 'borderInfo' isn't defined for the type 'SemanticColors'


[error] 209-209: The getter 'borderSuccess' isn't defined for the type 'SemanticColors'


[error] 210-210: The getter 'borderSuccess' isn't defined for the type 'SemanticColors'


[error] 215-215: The getter 'borderWarning' isn't defined for the type 'SemanticColors'


[error] 216-216: The getter 'borderWarning' isn't defined for the type 'SemanticColors'

🤖 Prompt for AI Agents
In `@widgetbook/lib/stories/colors.dart` around lines 200 - 224, The build fails
because SemanticColors is missing the getters borderInfo, borderSuccess, and
borderWarning which are referenced by light.borderInfo, light.borderSuccess, and
light.borderWarning in the _ColorPairItem instances inside colors.dart; fix it
by either adding these getters to the SemanticColors class (in lib/theme.dart)
with the correct return type (e.g., Color) and sensible default/derived values,
or remove/comment out the three _ColorPairItem blocks (semanticName 'Border
Info', 'Border Success', 'Border Warning') in widgetbook/lib/stories/colors.dart
so the code no longer references the non-existent properties.

Comment on lines +29 to +36
target 'Runner' do
use_frameworks!

flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider using __dir__ for cleaner path resolution.

The static analysis suggests replacing File.dirname(File.realpath(__FILE__)) with __dir__ for a more idiomatic Ruby approach.

♻️ Proposed fix
 target 'Runner' do
   use_frameworks!

-  flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
+  flutter_install_all_macos_pods __dir__
   target 'RunnerTests' do
     inherit! :search_paths
   end
 end

Note: This matches Flutter's default template, so keeping as-is is also acceptable for consistency with generated code.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
target 'Runner' do
use_frameworks!
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end
target 'Runner' do
use_frameworks!
flutter_install_all_macos_pods __dir__
target 'RunnerTests' do
inherit! :search_paths
end
end
🧰 Tools
🪛 RuboCop (1.82.1)

[convention] 32-32: Use __dir__ to get an absolute path to the current file's directory.

(Style/Dir)

🤖 Prompt for AI Agents
In `@widgetbook/macos/Podfile` around lines 29 - 36, Replace the long path
expression used when invoking flutter_install_all_macos_pods in the Runner
target: locate the call flutter_install_all_macos_pods
File.dirname(File.realpath(__FILE__)) and replace the
File.dirname(File.realpath(__FILE__)) argument with the Ruby idiom __dir__ to
simplify path resolution while preserving behavior.

Comment on lines +8 to +12
PRODUCT_NAME = sloth_widgetbook

// The application's bundle identifier
PRODUCT_BUNDLE_IDENTIFIER = com.example.slothWidgetbook

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Replace the placeholder bundle identifier before distribution.

com.example.slothWidgetbook is the template default and can cause signing/provisioning mismatches or collisions if this app is installed alongside other builds. Please set a real reverse‑DNS identifier aligned with your team/app ID.

🤖 Prompt for AI Agents
In `@widgetbook/macos/Runner/Configs/AppInfo.xcconfig` around lines 8 - 12,
Replace the placeholder bundle identifier in the macOS app config: update the
PRODUCT_BUNDLE_IDENTIFIER value (currently "com.example.slothWidgetbook") to
your app's real reverse‑DNS identifier that matches your team/app ID and
provisioning profile; ensure PRODUCT_NAME (sloth_widgetbook) and signing
settings remain consistent with the new bundle identifier to avoid
provisioning/signing collisions.

Comment on lines +5 to +7
environment:
sdk: ^3.9.2
flutter: ">=3.38.4 <4.0.0"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# Check if Flutter 3.38.4 and Dart 3.9.2 are real versions by searching for release information
python3 << 'EOF'
import json
import urllib.request
import urllib.error

# Try to get Flutter releases
try:
    with urllib.request.urlopen('https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json', timeout=5) as response:
        data = json.loads(response.read().decode())
        releases = data.get('releases', [])
        
        # Find specific versions
        version_3_38 = [r for r in releases if r.get('version', '').startswith('3.38')]
        version_3_27 = [r for r in releases if r.get('version', '').startswith('3.27')]
        version_3_9 = [r for r in releases if r.get('dart_sdk_version', '').startswith('3.9')]
        
        print("=== Flutter 3.38.x releases ===")
        for r in version_3_38[:3]:
            print(f"  Version: {r.get('version')}, Dart: {r.get('dart_sdk_version')}, Date: {r.get('release_date')}")
        
        print("\n=== Flutter 3.27.x releases ===")
        for r in version_3_27[:3]:
            print(f"  Version: {r.get('version')}, Dart: {r.get('dart_sdk_version')}, Date: {r.get('release_date')}")
        
        print("\n=== Latest releases (Dart 3.9.x) ===")
        for r in version_3_9[:3]:
            print(f"  Version: {r.get('version')}, Dart: {r.get('dart_sdk_version')}, Date: {r.get('release_date')}")
        
        # Get overall latest
        if releases:
            latest = releases[0]
            print(f"\n=== Latest release ===")
            print(f"  Flutter: {latest.get('version')}, Dart: {latest.get('dart_sdk_version')}, Date: {latest.get('release_date')}")
            
except Exception as e:
    print(f"Error fetching Flutter releases: {e}")
EOF

Repository: marmot-protocol/sloth

Length of output: 225


🌐 Web query:

Flutter SDK version 3.38.4 release date Dart 3.9.2

💡 Result:

  • Flutter SDK 3.38.4 (stable hotfix) was released on December 5, 2025. [1]
  • Flutter 3.38.4 includes Dart 3.10.3 (not Dart 3.9.2). [2]
  • If you meant the Flutter stable line that ships with Dart 3.9.2, that corresponds to Flutter 3.35.x (for example, Flutter 3.35.4, released September 17, 2025). [3]
  • The Dart 3.9 line was released on August 13, 2025 (Dart 3.9.2 is a patch within that line). [4]

Sources: [1] [2] [3] [4]


Fix incompatible SDK version constraints.

The Flutter and Dart SDK constraints are incompatible. Flutter 3.38.4 ships with Dart 3.10.3, not Dart 3.9.2. Either use Flutter 3.35.x with Dart 3.9.2 (if 3.35 compatibility is needed), or update the Dart constraint to ^3.10.0 to match Flutter 3.38.4+.

🤖 Prompt for AI Agents
In `@widgetbook/pubspec.yaml` around lines 5 - 7, The environment SDK constraints
in the pubspec's environment block are incompatible with the specified Flutter
version; update the Dart SDK constraint under the environment keys (sdk: ...) to
match Flutter 3.38.4+ by changing the Dart constraint to ^3.10.0 (or
alternatively downgrade the flutter constraint to a 3.35.x series if you must
stay on Dart 3.9.2) so the sdk and flutter entries are consistent.

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.

2 participants