Repository navigation
feat(fl/fled): typed section accessors + FledScript passive type (#3311 PR2) - #3326
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughAdds Changesfl::Fled subsystem
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
… PR2) PR2 of #3311. Adds the four typed section accessors to fl::Fled plus the new fl::FledScript passive type. Only screenMap() has a real body in PR2; video/channels/script are stubs whose implementations land in later PRs once their supporting deserializers exist. New types: - fl::FledScript (src/fl/fled/fled_script.h) - passive struct carrying ScriptKind enum (Wasm | MicroPy) + shared_ptr to bytes + length. New accessors on fl::Fled: - video() -> shared_ptr<Video> (STUB; PR4 fills in) - screenMap() -> shared_ptr<ScreenMap> (IMPLEMENTED) - channels() -> shared_ptr<MultiChannelConfig> (STUB; PR5 fills in) - script() -> shared_ptr<FledScript> (STUB; v2 bundle work) screenMap() reads the envelope's "map" key, serializes the envelope back to JSON, and hands it to fl::ScreenMap::ParseJson. Multi-strip bundles return only the first segment in PR2; a dedicated multi-segment accessor is a later refactor. All non-object / absent "map" cases return nullptr. Each accessor handles the null-Fled case (mImpl == null -> nullptr). Each accessor's contract: ZERO global side effects per #3311's directive. Tests (6 new cases in tests/fl/fled/fled.cpp): null-Fled returns null for every accessor, missing "map" key returns null, empty "map" returns null, a real strip1 ScreenMap parses to length=3 with correct coords, and the three stub accessors return nullptr for every valid bundle. Refs #3311 (this is the second of seven planned PRs) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/fl/fled/fled_script.h`:
- Around line 14-18: The struct FledScript violates the project's member-field
naming convention. Rename all three member fields in the FledScript struct to
use the mCamelCase prefix as required by the coding guidelines. Change kind to
mKind, bytes to mBytes, and length to mLength. Ensure all references to these
fields throughout the codebase are also updated to use the new naming
convention.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: cb51612c-67a2-462f-9d0b-3b5d9327ac43
📒 Files selected for processing (9)
ci/lint_cpp_rs/src/checkers/unity_build.rssrc/fl/_build.cpp.hppsrc/fl/build/fl.fled+.cppsrc/fl/fled/_build.cpp.hppsrc/fl/fled/fled.cpp.hppsrc/fl/fled/fled.hsrc/fl/fled/fled_impl.hppsrc/fl/fled/fled_script.htests/fl/fled/fled.cpp
3347395 to
a2c8fbf
Compare
|
@coderabbitai re the FledScript field naming: declining. Per the existing convention in src/fl/channels/config.h, struct types use plain field names (pin, timing, encoder, dataPin, clockPin, etc.) rather than mCamelCase. The mCamelCase convention applies to private class members. FledScript is a passive POD struct and follows the same plain-field convention as ClocklessChipset / SpiChipsetConfig / ChannelConfig. Also matches the #3311 spec verbatim. |
|
Tip For best results, initiate chat on the files or code changes.
( ˵ •̀ ᴗ - ˵ ) ✧ ✏️ Learnings added
|
Summary
PR2 of #3311. Adds the four typed section accessors to
fl::Fledplus the newfl::FledScriptpassive type. OnlyscreenMap()has a real body in PR2;video/channels/scriptare stubs whose implementations land in later PRs once their supporting deserializers exist.Per #3311's directive: each accessor touches zero global state (no controller registration, no
EngineEventsbroadcast, no scheduler).What this PR adds
New type —
fl::FledScript(src/fl/fled/fled_script.h):New accessors on
fl::Fled:video()Video::fromBytesfactory)screenMap()ScreenMap::ParseJsonon envelope's"map"keychannels()MultiChannelConfigJSON deserializer)script()screenMap()returns the first segment for multi-strip bundles; a dedicated multi-segment accessor is a later refactor. All non-object / absent"map"cases return nullptr.Tests (6 new cases)
screenMap()returns null on default-constructed FledscreenMap()returns null when envelope has no"map"keyscreenMap()returns null when"map"is an empty objectscreenMap()parses a real strip1 ScreenMap to length=3 with correct coordinatesvideo()/channels()/script()are stubs returning nullptr for a valid bundlevideo()/channels()/script()return null on null FledTest plan
bash test fled --debug— green (1/1 DLL passed; 15 cases inside)bash lint --cpp— greenRefs #3311
🤖 Generated with Claude Code
Summary by CodeRabbit