Repository navigation
feat(models): model the datetimepicker, timezone, rich text, and file view state values - #2045
Merged
Merged
Conversation
… view state values ViewStateValue now takes selected_date_time, timezone, rich_text_value, and files as named attributes, so they read back and serialize instead of landing in additional_attributes and being dropped by to_dict(). Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2045 +/- ##
=======================================
Coverage 84.47% 84.47%
=======================================
Files 118 118
Lines 14035 14039 +4
=======================================
+ Hits 11856 11860 +4
Misses 2179 2179 ☔ View full report in Codecov by Harness. |
WilliamBergamin
marked this pull request as ready for review
November 16, 2026 19:01
WilliamBergamin
enabled auto-merge (squash)
November 16, 2026 19:02
zimeg
approved these changes
Nov 16, 2026
zimeg
left a comment
Member
There was a problem hiding this comment.
🧱 @WilliamBergamin LGTM! Nice to have these four state values reading back and round-tripping through to_dict() now, and the captured view_submission fixture is a great check for it 🧪
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request models the
selected_date_time,timezone,rich_text_value, andfilesview state values onViewStateValue, so they read back and round-trip throughto_dict().View(**view)from crashing on these keys, but they still landed inadditional_attributes, andto_dict()dropped them.selected_option.rich_text_valuetakes a dict or aRichTextBlock, andfileskeeps Slack's file objects as dicts.additional_attributesstill holds keys we don't model, such asvalue_changed. fix(models): accept unknown view state value keys #2042 hasn't been released yet, so these four keys never shipped there.Testing
view_modal_011.jsonis a realview_submissionview captured from a developer sandbox, with IDs and URLs replaced by fakes. To reproduce it:datetimepicker, atimepickerwithtimezoneset, arich_text_input, and afile_input.View(**body["view"]).to_dict()["state"]equalsbody["view"]["state"].The fixture leaves out
max_file_size_byteson thefile_inputelement, whichFileInputElementdoesn't model yet. That fix can land in a separate PR.Category
/docs(Documents)/tutorial(PythOnBoardingBot tutorial)tests/integration_tests(Automated tests for this library)Requirements
python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.shafter making the changes.🤖 Generated with Claude Code