refactor: standardize command view folder structure#401
Merged
josecelano merged 4 commits intomainfrom Feb 27, 2026
Merged
Conversation
Move json_view.rs and text_view.rs from run/ directly into run/views/, matching the layout of all other 12 command view modules. Add run/views/mod.rs that re-exports JsonView and TextView. Update run/mod.rs to delegate through the views submodule. All public re-exports from run/mod.rs remain unchanged.
Move the private RunCommandOutput<'a> struct out of json_view.rs and into a dedicated view_data/run_details.rs as the public RunDetailsData struct, matching the pattern used by all other command view modules. Changes: - Add run/view_data/run_details.rs with RunDetailsData (owned types) - Add run/view_data/mod.rs - Update run/mod.rs to declare pub mod view_data and re-export RunDetailsData - Update json_view.rs: render(data: &RunDetailsData) instead of 3 params - Update text_view.rs: render(data: &RunDetailsData) instead of 3 params - Update handler: construct RunDetailsData and pass to both views
Create view_data/ subfolder for list and show commands, routing all application-layer type imports through a dedicated view_data/ module instead of importing directly from application::command_handlers in each view file. Changes: - Add list/view_data/list_details.rs re-exporting EnvironmentList, EnvironmentSummary - Add list/view_data/mod.rs - Update list/mod.rs to declare pub mod view_data and re-export EnvironmentList - Update list/views/json_view.rs and text_view.rs imports to use view_data - Add show/view_data/show_details.rs re-exporting EnvironmentInfo, GrafanaInfo, InfrastructureInfo, LocalhostServiceInfo, PrometheusInfo, ServiceInfo, TlsDomainInfo - Add show/view_data/mod.rs - Update show/mod.rs to declare pub mod view_data and re-export EnvironmentInfo - Update show/views/json_view.rs, text_view.rs, grafana.rs, prometheus.rs, infrastructure.rs, tracker_services.rs, https_hint.rs imports to use view_data All 13 command view modules now have a view_data/ subfolder.
…structure plan Update refactor plan to reflect completed status: - Mark all 3 proposals as Completed with commit hashes - Update Progress Tracking: 3/3 complete, 0 not started - Mark all implementation checklist items as done [x] - Update phase summaries to 100% completion - Update Last Updated date and Status to Completed Commits: - Proposal #1: 8e3f8a4 (move run views/ subfolder) - Proposal #2: ff0c6d7 (extract run DTO to view_data/) - Proposal #3: 3d63edc (add view_data/ to list and show)
Member
Author
|
ACK 303c864 |
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
Brings
run,list, andshowcommand view modules into alignment with the canonical folder structure followed by all other 10 command view modules.Implements all 3 proposals from
docs/refactors/plans/standardize-command-view-folder-structure.md.Changes
Proposal #1 — Move
runview files intoviews/subfolder (8e3f8a41)run/json_view.rs→run/views/json_view.rsrun/text_view.rs→run/views/text_view.rsrun/views/mod.rsrun/mod.rsto usemod viewsProposal #2 — Extract
runinline DTO toview_data/(ff0c6d7b)RunCommandOutput<'a>struct inline injson_view.rswith a public ownedRunDetailsDatastruct inrun/view_data/run_details.rsJsonView::renderandTextView::renderto accept&RunDetailsDatarunhandler to constructRunDetailsDataand pass it to both viewsProposal #3 — Add
view_data/tolistandshow(3d63edc6)list/view_data/list_details.rsre-exportingEnvironmentListandEnvironmentSummaryshow/view_data/show_details.rsre-exporting all 7 application-layer types used by show viewslist/views/andshow/views/(9 files) to go throughview_data/instead of directly fromapplication::command_handlersResult
All 13 command view modules now follow the same layout:
Testing
cargo run --bin linter all)Next Step
This unblocks
standardize-json-view-render-api— file paths are now stable for that plan's Proposal #2.