Skip to content

Refactor with architecture and developer documentation#865

Open
macumber wants to merge 27 commits intodevelopfrom
add_documentation
Open

Refactor with architecture and developer documentation#865
macumber wants to merge 27 commits intodevelopfrom
add_documentation

Conversation

@macumber
Copy link
Copy Markdown
Collaborator

@macumber macumber commented Mar 17, 2026

Intent

This PR started off with the goal to add architecture documentation for humans and llms to reference. Instructions were added to prompt llms to review documentation for accuracy and suggest updates in future changes. After reviewing the architecture, I felt compelled to clean it up. I probably should have waited to do that on subsequent PRs but I continued on here to:

  • Remove dead code: with separation of the OS Application and SketchUp Plug-in, the SWIG bindings to OS Application widgets are no longer needed. These are not used by any other developer or application that I know of. InspectorDialog and several of its widgets were only used in the SketchUp Plug-in and not needed in the OS Application. The *API headers were needed for linking shared libraries on Windows. However, all libraries in the OS Application are compiled as static libraries. There were also some stray Jenkins based CI actions that are no longer needed. Removing all this dead code simplifies the build system and makes it more maintainable.
  • Architectural restructuring: shared_gui_components was not a real library. Its .cpp files were listed directly in openstudio_lib's CMakeLists.txt as sources, meaning they were compiled into openstudio_lib but physically lived in a separate directory for no particular reason. There was no enforced boundary, so any file in the project could include anything else, and over time files that should have been small, reusable widgets were not due to dependencies on application-level code. I wanted to define a proper library structure with rational libraries with correct dependency ordering. This required factoring out a new openstudio_qt_utils library for base classes and utilities that were needed across higher level libraries. A next step would be to break up openstudio_lib into smaller domain specific libraries but I did at least catch myself before doing that. I also want to remove BIMServer as well, but again have at least some common sense to not do that in this PR.
  • Mechancal/style updates: now that we have a nice architectural separation of libraries I wanted to show it off by organizing include paths to be in order based on the libraries used. A lot of includes had to be adjusted anyway due to files moving around so I figured we should reorder includes while were making those changes anyway.

Changes

Architecture / build system

  • New openstudio_qt_utils static library: extracts Application, OSProgressBar, QMetaTypes, PathWatcher, Utilities from model_editor
  • New openstudio_shared_gui static library: separates shared_gui_components from openstudio_lib, eliminating the upward dependency
  • QRC resources split between static libraries.
  • OSItemId moved to shared_gui_components - the concrete seam that breaks the upward reference
  • Strict link order enforced: OpenStudioApp -> openstudio_lib -> openstudio_shared_gui -> openstudio_qt_utils -> openstudioapp_utilities
  • Removed Jenkinsfiles; CI fully on GitHub Actions
  • Qt 6.11 locked as required version; Qt6QmlMeta and Qt6QmlWorkerScript promoted to REQUIRED

Dead code removed

  • InspectorDialog class and test deleted (~1100 lines)
  • TreeView, ModelObjectTreeWidget, ModelEditor.rc/.xml deleted
  • Removed SWIG binding files (BIMServer.i, ModelEditor.i, Qt.i) and all *API.hpp export-macro headers which are not needed for a static build

Developer documentation added

  • architecture.md - C4 diagrams, dependency graph, patterns, build guide, CI overview
  • Per-library reference docs for all 7 targets
  • llms.txt, PR review instructions, code refactor instructions, and doc-update prompt template

This is a large PR, most of the changes are file moves and small changes. The main goal was to clean up the dependency graph:
image

New library openstudio_qt_utils: move Application, OSProgressBar,
QMetaTypes, Utilities out of model_editor; add OpenStudioQtUtilsAPI.hpp.

shared_gui_components now has its own CMakeLists (openstudio_shared_gui):
- Move IconLibrary, OSVectorController, UserSettings out of openstudio_lib/model_editor
- Add OSItemId.hpp (extracted from OSItem.hpp) and OpenStudioSharedGuiAPI.hpp
- Fix missing OSVectorController.hpp in qt6_wrap_cpp (caused LNK2001 on all
  Qt meta-object/signal symbols)
- Register OSItemId metatypes in OSGridController

Add BaseApp::mouseOverInspectorView() pure virtual; implement in OSAppBase;
use it in OSLineEdit2::focusOutEvent instead of inline 3-level chain.

All include paths updated; no circular shared_gui→openstudio_lib dependency.
…to add_documentation

# Conflicts:
#	src/model_editor/ModelEditorAPI.hpp
#	src/openstudio_qt_utils/Application.hpp
#	src/openstudio_qt_utils/Utilities.hpp
#	src/shared_gui_components/IconLibrary.hpp
#	src/shared_gui_components/MeasureManager.hpp
#	src/utilities/CMakeLists.txt
@macumber macumber requested a review from Copilot April 26, 2026 21:21
@macumber macumber changed the title Add architecture and developer documentation Refactor with architecture and developer documentation Apr 26, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new openstudio_qt_utils library and a new openstudio_shared_gui library, refactors existing modules to depend on these shared utilities/components (moving many includes away from model_editor), and adds substantial developer/architecture documentation for the codebase and CI workflows.

Changes:

  • Create new openstudio_qt_utils + openstudio_shared_gui CMake targets and migrate shared Qt helpers and GUI components into them.
  • Refactor include paths and type ownership (eg OSItemId, OSVectorController) across openstudio_lib, openstudio_app, model_editor, and bimserver.
  • Add developer documentation describing libraries, classes, and CI workflows.

Reviewed changes

Copilot reviewed 203 out of 206 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/utilities/OpenStudioApplicationUtilitiesAPI.hpp Removed Windows export-macro header for utilities
src/utilities/OpenStudioApplicationPathHelpers.hpp Removed export macro usage from utilities API declarations
src/utilities/CMakeLists.txt Changed link interface to PUBLIC; removed NINJA define block
src/shared_gui_components/WorkflowController.cpp Updated Utilities include path to openstudio_qt_utils
src/shared_gui_components/UserSettings.hpp Renamed include guards for shared module naming
src/shared_gui_components/UserSettings.cpp Updated Utilities include path to openstudio_qt_utils
src/shared_gui_components/ProcessEventsProgressBar.hpp Updated OSProgressBar include to openstudio_qt_utils
src/shared_gui_components/ProcessEventsProgressBar.cpp Updated Application include to openstudio_qt_utils
src/shared_gui_components/OSVectorController.hpp Include guard rename; OSItemId include + forward decls
src/shared_gui_components/OSVectorController.cpp New implementation of OSVectorController moved into shared module
src/shared_gui_components/OSUnsignedEdit.cpp Updated Utilities include path to openstudio_qt_utils
src/shared_gui_components/OSQuantityEdit.cpp Updated Utilities include path to openstudio_qt_utils
src/shared_gui_components/OSLoadNamePixmapLineEdit.cpp Updated IconLibrary include path to shared component
src/shared_gui_components/OSLineEdit.cpp Updated Utilities include path; simplified inspector mouse-over query
src/shared_gui_components/OSItemId.hpp New shared value type extracted from OSItem.hpp
src/shared_gui_components/OSIntegerEdit.cpp Updated Utilities include path to openstudio_qt_utils
src/shared_gui_components/OSGridView.hpp Switched include dependency to OSItemId
src/shared_gui_components/OSGridView.cpp Updated Application include path to openstudio_qt_utils
src/shared_gui_components/OSGridController.hpp Added OSItemId metatype declarations and new include ordering
src/shared_gui_components/OSGridController.cpp Added OSItemId metatype registrations at startup
src/shared_gui_components/OSDoubleEdit.cpp Updated Utilities include path to openstudio_qt_utils
src/shared_gui_components/NetworkProxyDialog.cpp Updated Application/Utilities include paths to openstudio_qt_utils
src/shared_gui_components/MeasureManager.hpp Removed conditional OPENSTUDIO_API export decoration
src/shared_gui_components/MeasureManager.cpp Updated includes (Application/Utilities/UserSettings) for new module layout
src/shared_gui_components/MeasureDragData.cpp Updated Utilities include path to openstudio_qt_utils
src/shared_gui_components/LocalLibraryController.cpp Updated includes for relocated UserSettings + Utilities
src/shared_gui_components/IconLibrary.hpp Renamed include guards; removed OPENSTUDIO_API export decoration
src/shared_gui_components/EditView.cpp Updated Utilities include path to openstudio_qt_utils
src/shared_gui_components/EditController.cpp Updated Utilities include path to openstudio_qt_utils
src/shared_gui_components/Component.cpp Updated Utilities include path to openstudio_qt_utils
src/shared_gui_components/CMakeLists.txt New CMake target openstudio_shared_gui with moc setup + deps
src/shared_gui_components/BuildingComponentDialogCentralWidget.cpp Updated Application include path to openstudio_qt_utils
src/shared_gui_components/BaseApp.hpp Updated QMetaTypes include; added mouseOverInspectorView() to interface
src/shared_gui_components/BCLMeasureDialog.cpp Updated includes for relocated UserSettings + Utilities
src/openstudio_qt_utils/Utilities.hpp Renamed include guards; removed MODELEDITOR_API; added Path/UUID includes
src/openstudio_qt_utils/Utilities.cpp New implementation file for Qt<->std/UUID/path conversions
src/openstudio_qt_utils/QMetaTypes.hpp Renamed include guards; removed OSItemId metatype declarations from here
src/openstudio_qt_utils/QMetaTypes.cpp Removed OSItemId registrations from central metatype init
src/openstudio_qt_utils/OSProgressBar.hpp Renamed include guards; removed dead/commented protected bits
src/openstudio_qt_utils/OSProgressBar.cpp Removed dead/commented implementation fragments
src/openstudio_qt_utils/CMakeLists.txt New CMake target openstudio_qt_utils and dependencies
src/openstudio_qt_utils/Application.hpp Renamed include guards; removed MODELEDITOR_API include
src/openstudio_qt_utils/Application.cpp Removed dead/commented Qt plugin-search-path block
src/openstudio_lib/test/SpacesSurfaces_Benchmark.cpp Updated Application include path to openstudio_qt_utils
src/openstudio_lib/test/OpenStudioLibFixture.cpp Updated Application include path to openstudio_qt_utils
src/openstudio_lib/test/IconLibrary_GTest.cpp Updated IconLibrary include to shared component
src/openstudio_lib/ZoneChooserView.cpp Updated Utilities include path to openstudio_qt_utils
src/openstudio_lib/YearSettingsWidget.hpp Updated QMetaTypes include path to openstudio_qt_utils
src/openstudio_lib/YearSettingsWidget.cpp Updated Utilities include path to openstudio_qt_utils
src/openstudio_lib/VariablesTabView.hpp Updated QMetaTypes include path to openstudio_qt_utils
src/openstudio_lib/VariablesTabView.cpp Updated Utilities include path to openstudio_qt_utils
src/openstudio_lib/VRFController.cpp Updated Utilities include path to openstudio_qt_utils
src/openstudio_lib/UtilityBillFuelTypeListView.hpp Updated OSVectorController include + QMetaTypes include path
src/openstudio_lib/UtilityBillFuelTypeListView.cpp Updated Utilities include path to openstudio_qt_utils
src/openstudio_lib/SwimmingPoolIndoorFloorSurfaceDialog.cpp Updated Utilities include path to openstudio_qt_utils
src/openstudio_lib/StandardsInformationMaterialWidget.cpp Updated Utilities include path to openstudio_qt_utils
src/openstudio_lib/StandardsInformationConstructionWidget.cpp Updated Utilities include path to openstudio_qt_utils
src/openstudio_lib/StandardOpaqueMaterialInspectorView.cpp Updated Utilities include path to openstudio_qt_utils
src/openstudio_lib/SpacesSubtabGridView.cpp Updated Utilities include path to openstudio_qt_utils
src/openstudio_lib/SpaceTypesGridView.cpp Updated Utilities include path to openstudio_qt_utils
src/openstudio_lib/SpaceLoadInstancesWidget.cpp Updated includes for IconLibrary + OSVectorController to shared component
src/openstudio_lib/ServiceWaterScene.hpp Updated QMetaTypes include path to openstudio_qt_utils
src/openstudio_lib/ServiceWaterGridItems.cpp Updated IconLibrary include to shared component
src/openstudio_lib/ScriptItem.cpp Updated Utilities include path to openstudio_qt_utils
src/openstudio_lib/SchedulesView.hpp Updated QMetaTypes include path to openstudio_qt_utils
src/openstudio_lib/SchedulesView.cpp Updated Utilities include path to openstudio_qt_utils
src/openstudio_lib/ScheduleFileInspectorView.cpp Updated Utilities include path to openstudio_qt_utils
src/openstudio_lib/ScheduleDialog.cpp Updated Utilities include path to openstudio_qt_utils
src/openstudio_lib/ScheduleDayView.cpp Updated Utilities include path to openstudio_qt_utils
src/openstudio_lib/ScheduleCompactInspectorView.cpp Updated Utilities include path to openstudio_qt_utils
src/openstudio_lib/RunTabView.cpp Updated Application/Utilities include paths; formatting tweak
src/openstudio_lib/ResultsTabView.hpp Updated QMetaTypes include path to openstudio_qt_utils
src/openstudio_lib/ResultsTabView.cpp Updated Utilities include path; comment wording tweak
src/openstudio_lib/RefrigerationController.hpp Updated QMetaTypes include path to openstudio_qt_utils
src/openstudio_lib/RefrigerationController.cpp Updated IconLibrary + Utilities includes
src/openstudio_lib/OpenStudioAPI.hpp Removed Windows export-macro header for openstudio_lib
src/openstudio_lib/OSItemSelectorButtons.cpp Updated OSVectorController include to shared component
src/openstudio_lib/OSItemList.cpp Updated OSVectorController include to shared component
src/openstudio_lib/OSItem.hpp Moved OSItemId type to shared header include
src/openstudio_lib/OSItem.cpp Updated IconLibrary + Utilities includes
src/openstudio_lib/OSDropZone.cpp Updated IconLibrary + OSVectorController includes
src/openstudio_lib/OSDocument.hpp Removed OPENSTUDIO_API decoration; updated QMetaTypes include
src/openstudio_lib/OSDocument.cpp Updated UserSettings + Utilities + Application includes for new modules
src/openstudio_lib/OSAppBase.hpp Removed OPENSTUDIO_API; updated QMetaTypes include; added mouse-over method
src/openstudio_lib/OSAppBase.cpp Added mouse-over implementation; updated includes + UserSettings path
src/openstudio_lib/ModelObjectVectorController.hpp Updated OSVectorController include + QMetaTypes include
src/openstudio_lib/ModelObjectTreeWidget.hpp Updated QMetaTypes include path
src/openstudio_lib/ModelObjectTreeItems.cpp Updated IconLibrary + Utilities includes
src/openstudio_lib/ModelObjectListView.hpp Updated OSVectorController include + QMetaTypes include
src/openstudio_lib/ModelObjectListView.cpp Updated Utilities include path
src/openstudio_lib/ModelObjectItem.cpp Updated Utilities include path
src/openstudio_lib/ModelObjectInspectorView.cpp Updated Utilities include path
src/openstudio_lib/MainWindow.cpp Updated Utilities include path
src/openstudio_lib/MainRightColumnController.hpp Included OSItem.hpp; removed forward-decl mismatch
src/openstudio_lib/LoopScene.hpp Updated QMetaTypes include path
src/openstudio_lib/LoopChooserView.cpp Updated Utilities include path
src/openstudio_lib/LocationTabView.cpp Updated Utilities include path
src/openstudio_lib/InspectorView.cpp Updated Utilities include path
src/openstudio_lib/HVACSystemsController.hpp Updated QMetaTypes include path
src/openstudio_lib/HVACSystemsController.cpp Updated Utilities include path
src/openstudio_lib/GroundTemperatureView.cpp Updated Utilities include path
src/openstudio_lib/GridViewSubTab.hpp Included OSItem.hpp
src/openstudio_lib/GridItem.cpp Updated IconLibrary + Utilities includes; minor formatting tweak
src/openstudio_lib/GeometryPreviewView.cpp Updated Application include path
src/openstudio_lib/GeometryEditorView.cpp Updated Utilities include path
src/openstudio_lib/BuildingInspectorView.cpp Updated OSVectorController + Utilities includes
src/openstudio_lib/ApplyMeasureNowDialog.cpp Updated Utilities include path
src/openstudio_lib/AnalyticsHelper.cpp Updated Application + Utilities includes
src/openstudio_app/test/Resources_GTest.cpp Updated Utilities include path
src/openstudio_app/test/OpenStudioAppFixture.cpp Updated Application include path
src/openstudio_app/main.cpp Removed COMPILING_FROM_OSAPP + OpenStudioAPI include; updated utils includes
src/openstudio_app/OpenStudioApp.cpp Updated Utilities include path
src/openstudio_app/LibraryDialog.cpp Updated Utilities include path
src/openstudio_app/ExternalToolsDialog.cpp Updated Utilities include path; added Logger include
src/openstudio_app/CMakeLists.txt Removed NINJA define; stopped compiling shared_gui sources directly; trimmed deps list
src/model_editor/test/Utilities_GTest.cpp Updated Utilities include path to openstudio_qt_utils
src/model_editor/test/QMetaTypes_GTest.cpp Updated QMetaTypes include path
src/model_editor/test/PathWatcher_GTest.cpp Updated Application include path
src/model_editor/test/ModelEditorFixture.cpp Updated Application include path
src/model_editor/test/GithubReleases_GTest.cpp Updated Application include path
src/model_editor/TestButton.hpp Removed MODELEDITOR_API decoration
src/model_editor/TableWidget.hpp Removed MODELEDITOR_API decoration
src/model_editor/TableWidget.cpp Added missing SDK includes
src/model_editor/PathWatcher.hpp Removed MODELEDITOR_API decoration
src/model_editor/PathWatcher.cpp Updated Application/Utilities include paths
src/model_editor/ModelEditorAPI.hpp Removed Windows export-macro header for model_editor
src/model_editor/ModelEditor.i Removed MODELEDITOR_API define; updated Utilities include path
src/model_editor/ModalDialogs.hpp Removed MODELEDITOR_API decorations; updated declarations
src/model_editor/ModalDialogs.cpp Updated Application/Utilities include paths
src/model_editor/InspectorGadget.hpp Removed MODELEDITOR_API decorations
src/model_editor/InspectorGadget.cpp Updated Utilities include path
src/model_editor/InspectorDialog.hpp Removed MODELEDITOR_API decoration
src/model_editor/InspectorDialog.cpp Updated Application/Utilities include paths
src/model_editor/IGSpinBoxes.hpp Removed MODELEDITOR_API decorations
src/model_editor/IGLineEdit.hpp Removed MODELEDITOR_API decoration
src/model_editor/GithubReleases.hpp Removed MODELEDITOR_API decorations
src/model_editor/GithubReleases.cpp Updated Application include path
src/model_editor/CMakeLists.txt Removed moved sources; now depends on openstudio_qt_utils
src/model_editor/BridgeClasses.hpp Removed MODELEDITOR_API decoration
src/model_editor/AccessPolicyStore.hpp Renamed include guards; removed MODELEDITOR_API decorations
src/bimserver/ProjectImporter.hpp Removed BIMSERVER_API decoration and include
src/bimserver/CMakeLists.txt Removed BIMserverAPI header; switched deps to openstudio_qt_utils
src/bimserver/BIMserverConnection.hpp Removed BIMSERVER_API decoration and include
src/bimserver/BIMserverConnection.cpp Updated Application/Utilities include paths
src/bimserver/BIMserverAPI.hpp Removed Windows export-macro header for bimserver
src/bimserver/BIMServer.i Removed BIMSERVER_API define
developer/doc/libraries/utilities.md Added documentation for utilities module (needs updates per review)
developer/doc/libraries/qtwinmigrate.md Added documentation for qtwinmigrate (module not present in repo)
developer/doc/libraries/openstudio_app.md Added documentation for openstudio_app module (dependency text needs updates)
developer/doc/libraries/model_editor.md Added documentation for model_editor module
developer/doc/libraries/bimserver.md Added documentation for bimserver module (dependency text needs updates)
developer/doc/classes/shared_gui_components/OSGridView.md Added class documentation
developer/doc/classes/shared_gui_components/OSGridController.md Added class documentation
developer/doc/classes/shared_gui_components/MeasureManager.md Added class documentation
developer/doc/classes/shared_gui_components/LocalLibraryController.md Added class documentation
developer/doc/classes/shared_gui_components/BuildingComponentDialog.md Added class documentation
developer/doc/classes/shared_gui_components/BaseApp.md Added class documentation
developer/doc/classes/shared_gui_components/BCLMeasureDialog.md Added class documentation
developer/doc/classes/openstudio_lib/ThermalZonesController.md Added class documentation
developer/doc/classes/openstudio_lib/SpaceTypesController.md Added class documentation
developer/doc/classes/openstudio_lib/SchedulesController.md Added class documentation
developer/doc/classes/openstudio_lib/RunTabController.md Added class documentation
developer/doc/classes/openstudio_lib/ResultsTabController.md Added class documentation
developer/doc/classes/openstudio_lib/OSWebEnginePage.md Added class documentation
developer/doc/classes/openstudio_lib/OSVectorController.md Added class documentation
developer/doc/classes/openstudio_lib/OSItem.md Added class documentation
developer/doc/classes/openstudio_lib/OSDropZone.md Added class documentation
developer/doc/classes/openstudio_lib/OSDocument.md Added class documentation
developer/doc/classes/openstudio_lib/OSAppBase.md Added class documentation
developer/doc/classes/openstudio_lib/ModelObjectListView.md Added class documentation
developer/doc/classes/openstudio_lib/MaterialsController.md Added class documentation
developer/doc/classes/openstudio_lib/MainWindow.md Added class documentation
developer/doc/classes/openstudio_lib/MainTabController.md Added class documentation
developer/doc/classes/openstudio_lib/MainRightColumnController.md Added class documentation
developer/doc/classes/openstudio_lib/InspectorController.md Added class documentation
developer/doc/classes/openstudio_lib/HVACSystemsView.md Added class documentation
developer/doc/classes/openstudio_lib/HVACSystemsController.md Added class documentation
developer/doc/classes/openstudio_lib/GeometryEditorController.md Added class documentation
developer/doc/classes/openstudio_lib/ConstructionsController.md Added class documentation
developer/doc/classes/openstudio_app/StartupView.md Added class documentation
developer/doc/classes/openstudio_app/OpenStudioApp.md Added class documentation
developer/doc/classes/model_editor/InspectorGadget.md Added class documentation
developer/doc/classes/model_editor/InspectorDialog.md Added class documentation
developer/doc/classes/model_editor/AccessPolicyStore.md Added class documentation
developer/doc/classes/bimserver/ProjectImporter.md Added class documentation
developer/doc/classes/bimserver/BIMserverConnection.md Added class documentation
developer/doc/ci/workflows/release_notes.md Added CI workflow documentation
developer/doc/ci/workflows/manual_cli_test.md Added CI workflow documentation
developer/doc/ci/workflows/export_standards_data.md Added CI workflow documentation
developer/doc/ci/workflows/cppcheck.md Added CI workflow documentation
developer/doc/ci/workflows/clangformat.md Added CI workflow documentation
developer/doc/ci/workflows/cla.md Added CI workflow documentation
developer/doc/ci/workflows/check_osm_versions.md Added CI workflow documentation
developer/doc/ci/workflows/app_build.md Added CI workflow documentation
developer/doc/ci/scripts.md Added CI helper scripts documentation
developer/doc/ci/jenkins.md Added Jenkins documentation
CMakeLists.txt Added new subdirectories/targets (openstudio_qt_utils, openstudio_shared_gui)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/shared_gui_components/OSGridController.cpp
Comment thread src/utilities/CMakeLists.txt Outdated
Comment thread developer/doc/libraries/utilities.md Outdated
Comment thread developer/doc/libraries/openstudio_app.md
Comment thread developer/doc/libraries/bimserver.md
Comment thread developer/doc/libraries/qtwinmigrate.md Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 204 out of 207 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/openstudio_qt_utils/QMetaTypes.cpp Outdated
macumber added 12 commits April 26, 2026 18:30
Move class level documentation to comments in the classes
…cing openstudio_lib symbols

Fix by extending the BaseApp interface (already in shared_gui_components) with
the handful of methods that were being called through OSAppBase/OSDocument/MainWindow.
OSAppBase overrides them as final, forwarding to the current document. Call sites
in shared_gui_components now go through BaseApp::instance() (a dynamic_cast of qApp)
instead of including openstudio_lib headers directly.
…d move OSItem, OSDropZone, and ModelObjectItem from openstudio_lib into that library, removing the upward dependency. Wire BaseApp::currentDocument() returning BaseDocument* through the hierarchy with a covariant OSDocument* override in OSAppBase/OpenStudioApp, replacing all shared_ptr<OSDocument> local variables and member fields with raw pointers.
@macumber macumber requested a review from Copilot April 27, 2026 14:00
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@macumber
Copy link
Copy Markdown
Collaborator Author

@jmarrec this is a crazy big PR but most of it is just due to moving files into a better dependency graph. I have looked through all the files, I'm not sure if you want to or not. If this is too big I could try to break it up somehow, possibly with https://github.github.com/gh-stack/. I signed up for a preview of that, will see if we get access.

Copy link
Copy Markdown
Collaborator

@jmarrec jmarrec left a comment

Choose a reason for hiding this comment

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

This is obviously hard to review given how big it is

before I delve deeper and waste more than a few hours, @macumber can you please explain what you're trying to solve, why this is better, and do a walkthrough review of your changes (don't need to annotate everything, just one of each major change types).

Comment on lines +1 to +18
# Main build pipeline. Builds the OpenStudio Application on 5 platforms (ubuntu-22.04,
# ubuntu-24.04, windows-2022, macos-15-intel, macos-15 arm64), runs CTest and benchmarks,
# applies code signing on tag pushes, and uploads installers to GitHub Releases.
#
# Two jobs:
# build - matrix over all 5 platforms
# test_package_macos - downloads and verifies the signed macOS DMG (macos-15-intel + arm64)
#
# Caching: three independent caches keyed by OS + Conan profile + CACHE_KEY secret:
# 1. ccache (compiler output cache)
# 2. Conan package cache
# 3. Qt + OpenStudio SDK download cache
# Rotate the CACHE_KEY secret to bust all caches immediately.
#
# Required secrets: MACOS_DEVELOPER_ID_APPLICATION_CERTIFICATE_P12_BASE64,
# MACOS_DEVELOPER_ID_INSTALLER_CERTIFICATE_P12_PASSWORD, MACOS_KEYCHAIN_PASSWORD,
# NOTARIZATION_API_KEY, NOTARIZATION_API_TEAM_ID, NOTARIZATION_API_ISSUER_ID,
# SIGNPATH_CI_TOKEN, ANALYTICS_API_SECRET, ANALYTICS_MEASUREMENT_ID, CACHE_KEY
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is true right now, but will likely fall out of sync. Not sure what value it really provides. You can read the workflow to understand it.

Should the workflow fail for some reason, you'll definitely need to understand it anyways

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I agree that manually maintaining this documentation would quickly become stale. However, my thought was by adding the instruction "CI script added or modified (ci/*.sh, ci/*.py, ci/*.qs) → header comment must accurately describe usage, arguments, and exit codes." in .github\instructions\pr-review.instructions.md that we could rely on the co-pilot reviews to ensure it stays up to date.

Part of the intent of this PR is to add documentation to guide llms in understanding the code and being able to make changes. So, my thought was we could add documentation for llms and then rely on llms to help keep it up to date. I'm open to removing it though.

Comment on lines +31 to +32
add_library(${target_name} STATIC ${${target_name}_src} ${${target_name}_moc_src})
target_link_libraries(${target_name} PUBLIC ${${target_name}_depends})
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't really get why. We've already building a static library

CMake does not define the BUILD_SHARED_LIBS variable by default, meaning without project or user intervention add_library() will produce STATIC libraries.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This change was just to make the static libs more explicit. As part of dead code cleanup, I got rid of the *API header files which were only there in case we wanted to build shared libs. I wanted to remove all of that unused code to make the project simpler and more maintainable.

Comment on lines -37 to -39
if(BUILD_MICRO_PROFILING)
target_link_libraries(${target_name} ${MICRO_PROFILER_LIB} )
endif()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm guessing now that you explicitly link stuff in a flat/serial manner you are only linking OpenStudioApp (or perhaps openstudio_lib) to the micro profiler?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, we only have it linked in at the lowest openstudioapp_utilities level, it is then available to everything else in the project

Comment thread src/openstudio_lib/OSDocument.hpp Outdated
Comment on lines +85 to +86
// TODO: promote to BaseDocument once MainWindow is extracted into an IMainWindow interface
// that lives in shared_gui_components or openstudio_qt_utils (no openstudio_lib dependency).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does the TODO need to be addressed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Updated to this clearer TODO, I figured this PR was too big that I should not add this in now:

// TODO: create a BaseMainWindow interface in shared_gui_components and change this
// to a virtual method BaseMainWindow* mainWindow() in BaseDocument.
// This will allow us to split up openstudio_lib into domain-specific libraries
// (e.g. constructions_gui, hvac_gui, etc.) which need to call mainWindow().

bool modified() const override;
QString savePath() const override;
QString modelTempDir() const override;
model::Model componentLibrary() const override;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We lost the comments / docstrings here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added back

Comment on lines -85 to -86
// Returns the component library associated with this document.
openstudio::model::Model componentLibrary() const;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

here

Comment on lines +35 to +41
/**
* OSGridView is the QWidget that hosts and renders an OSGridController. It manages a QScrollArea
* containing a grid of OSCellWrapper widgets arranged in rows and columns. It handles row
* selection highlighting and forwards keyboard navigation events to the controller. Domain views
* (ThermalZonesGridView, SpaceTypesGridView, etc.) typically subclass OSGridView or compose it
* with filter/search bars.
*/
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ok, that's actually probably helpful

@@ -213,94 +212,4 @@ void RenderingColorWidget2::renderColorButtonClicked() {
}
}

RenderingColorWidget::RenderingColorWidget(QWidget* parent) : QWidget(parent) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I guess the idea is that RenderingColorWidget2 is kept, and RenderingColorWidget was unused and deleted?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah RenderingColorWidget was no longer used

@macumber
Copy link
Copy Markdown
Collaborator Author

macumber commented May 2, 2026

This is obviously hard to review given how big it is

before I delve deeper and waste more than a few hours, @macumber can you please explain what you're trying to solve, why this is better, and do a walkthrough review of your changes (don't need to annotate everything, just one of each major change types).

Thanks @jmarrec sorry this did get pretty big, I updated the PR description at the top to describe the intent of the changes

@macumber
Copy link
Copy Markdown
Collaborator Author

macumber commented May 2, 2026

@jmarrec it looks like the conan.openstudio.net certificate expired on 4/29/26:

Unable to connect to remote nrel-v2=https://conan.openstudio.net/artifactory/api/conan/conan-v2

  1. Make sure the remote is reachable or,
  2. Disable it with 'conan remote disable ' or,
  3. Use the '-nr/--no-remote' argument
    Then try again.. Required by ''

@anchapin
Copy link
Copy Markdown

anchapin commented May 5, 2026

@tijcolem said that he updated the cert. Let me know if it still has issues.

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.

4 participants