Skip to content

refactor(compositor): rename input namespace to compositor#135

Merged
K1ngst0m merged 1 commit into
mainfrom
dev/rename-namespace
Mar 19, 2026
Merged

refactor(compositor): rename input namespace to compositor#135
K1ngst0m merged 1 commit into
mainfrom
dev/rename-namespace

Conversation

@K1ngst0m
Copy link
Copy Markdown
Collaborator

@K1ngst0m K1ngst0m commented Mar 19, 2026

  • Rename all src/compositor/ namespace declarations to goggles::compositor
  • Update app, UI, and test references to CompositorServer and surface types
  • Remove staged uses of goggles::input from source and test code
  • Stage OpenSpec artifacts describing scope, verification, and task breakdown

Summary by CodeRabbit

Release Notes

  • Documentation

    • Added comprehensive technical specifications and implementation documentation for architectural improvements, including design rationales, detailed specifications, and verification task lists.
  • Refactor

    • Internal code reorganization and structural improvements across compositor modules, application components, and test infrastructure to enhance maintainability. Type signatures and component interactions have been updated for consistency. All changes are structural with no impact on user-visible features.

- Rename all src/compositor/ namespace declarations to goggles::compositor
- Update app, UI, and test references to CompositorServer and surface types
- Remove staged uses of goggles::input from source and test code
- Stage OpenSpec artifacts describing scope, verification, and task breakdown
@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Rename compositor namespace from goggles::input to goggles::compositor

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Rename goggles::input namespace to goggles::compositor across 18 files
• Update compositor module declarations and all qualified references
• Enforce project-wide namespace convention matching directory structure
• Add comprehensive OpenSpec documentation for design and verification
Diagram
flowchart LR
  A["goggles::input namespace<br/>14 compositor files"] -->|rename| B["goggles::compositor namespace<br/>14 compositor files"]
  C["UI forward declaration<br/>imgui_layer.hpp"] -->|update| D["compositor::SurfaceInfo<br/>forward declaration"]
  E["Test qualified references<br/>3 test files"] -->|update| F["goggles::compositor::<br/>qualified names"]
  B --> G["Namespace convention<br/>enforced uniformly"]
  D --> G
  F --> G
Loading

Grey Divider

File Changes

1. src/app/application.cpp Refactoring +5/-5

Update compositor namespace references in application

src/app/application.cpp


2. src/app/application.hpp Refactoring +3/-3

Update compositor namespace in method signatures

src/app/application.hpp


3. src/compositor/compositor_core.cpp Refactoring +2/-2

Rename namespace declaration to compositor

src/compositor/compositor_core.cpp


View more (22)
4. src/compositor/compositor_cursor.cpp Refactoring +2/-2

Rename namespace declaration to compositor

src/compositor/compositor_cursor.cpp


5. src/compositor/compositor_focus.cpp Refactoring +2/-2

Rename namespace declaration to compositor

src/compositor/compositor_focus.cpp


6. src/compositor/compositor_input.cpp Refactoring +2/-2

Rename namespace declaration to compositor

src/compositor/compositor_input.cpp


7. src/compositor/compositor_layer_shell.cpp Refactoring +2/-2

Rename namespace declaration to compositor

src/compositor/compositor_layer_shell.cpp


8. src/compositor/compositor_present.cpp Refactoring +2/-2

Rename namespace declaration to compositor

src/compositor/compositor_present.cpp


9. src/compositor/compositor_protocol_hooks.hpp Refactoring +2/-2

Rename namespace declaration to compositor

src/compositor/compositor_protocol_hooks.hpp


10. src/compositor/compositor_runtime_metrics.hpp Refactoring +2/-2

Rename namespace declaration to compositor

src/compositor/compositor_runtime_metrics.hpp


11. src/compositor/compositor_server.cpp Refactoring +2/-2

Rename namespace declaration to compositor

src/compositor/compositor_server.cpp


12. src/compositor/compositor_server.hpp Refactoring +2/-2

Rename namespace declaration to compositor

src/compositor/compositor_server.hpp


13. src/compositor/compositor_state.hpp Refactoring +2/-2

Rename namespace declaration to compositor

src/compositor/compositor_state.hpp


14. src/compositor/compositor_targets.hpp Refactoring +2/-2

Rename namespace declaration to compositor

src/compositor/compositor_targets.hpp


15. src/compositor/compositor_xdg.cpp Refactoring +2/-2

Rename namespace declaration to compositor

src/compositor/compositor_xdg.cpp


16. src/compositor/compositor_xwayland.cpp Refactoring +2/-2

Rename namespace declaration to compositor

src/compositor/compositor_xwayland.cpp


17. src/ui/imgui_layer.cpp Refactoring +1/-1

Update compositor namespace in method implementation

src/ui/imgui_layer.cpp


18. src/ui/imgui_layer.hpp Refactoring +3/-3

Update forward declaration to compositor namespace

src/ui/imgui_layer.hpp


19. tests/input/auto_input_forwarding_wayland.cpp Refactoring +1/-1

Update qualified compositor namespace reference

tests/input/auto_input_forwarding_wayland.cpp


20. tests/input/auto_input_forwarding_x11.cpp Refactoring +1/-1

Update qualified compositor namespace reference

tests/input/auto_input_forwarding_x11.cpp


21. tests/render/test_filter_boundary_contracts.cpp Refactoring +3/-3

Update qualified compositor namespace references

tests/render/test_filter_boundary_contracts.cpp


22. openspec/changes/archive/2026-03-19-rename-compositor-namespace/design.md 📝 Documentation +114/-0

Add design document for namespace rename

openspec/changes/archive/2026-03-19-rename-compositor-namespace/design.md


23. openspec/changes/archive/2026-03-19-rename-compositor-namespace/proposal.md 📝 Documentation +133/-0

Add proposal document for namespace rename

openspec/changes/archive/2026-03-19-rename-compositor-namespace/proposal.md


24. openspec/changes/archive/2026-03-19-rename-compositor-namespace/spec.md 📝 Documentation +143/-0

Add specification document for namespace rename

openspec/changes/archive/2026-03-19-rename-compositor-namespace/spec.md


25. openspec/changes/archive/2026-03-19-rename-compositor-namespace/tasks.md 📝 Documentation +36/-0

Add task breakdown for namespace rename

openspec/changes/archive/2026-03-19-rename-compositor-namespace/tasks.md


Grey Divider

Qodo Logo

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 19, 2026

📝 Walkthrough

Walkthrough

A mechanical namespace rename from goggles::input to goggles::compositor across the compositor module (14 source/header files), UI layer forward declarations, and three test files. Accompanying design documentation defines scope, verification, and rollout strategy. No behavioral or logic changes.

Changes

Cohort / File(s) Summary
Compositor implementation files
src/compositor/compositor_core.cpp, src/compositor/compositor_cursor.cpp, src/compositor/compositor_focus.cpp, src/compositor/compositor_input.cpp, src/compositor/compositor_layer_shell.cpp, src/compositor/compositor_present.cpp, src/compositor/compositor_xdg.cpp, src/compositor/compositor_xwayland.cpp
Namespace declaration updated from goggles::input to goggles::compositor in each translation unit. No logic or control flow changes.
Compositor header files
src/compositor/compositor_protocol_hooks.hpp, src/compositor/compositor_runtime_metrics.hpp, src/compositor/compositor_server.hpp, src/compositor/compositor_state.hpp, src/compositor/compositor_targets.hpp
Namespace scope changed from goggles::input to goggles::compositor for all exported declarations (e.g., CompositorServer, SurfaceInfo, RuntimeMetricsState, struct hooks, and free functions).
Compositor server implementation
src/compositor/compositor_server.cpp
Namespace changed from goggles::input to goggles::compositor; all CompositorServer method definitions now qualified under new namespace.
UI layer files
src/ui/imgui_layer.hpp, src/ui/imgui_layer.cpp
Surface info type parameter and member updated from input::SurfaceInfo to compositor::SurfaceInfo in set_surfaces() signature and internal storage; forward declaration namespace updated.
Application integration
src/app/application.hpp, src/app/application.cpp
Method signatures and member type updated: sync_surface_filters() and update_surface_resize_for_surfaces() now accept compositor::SurfaceInfo; m_compositor_server retyped to std::unique_ptr<compositor::CompositorServer>. Factory call updated to compositor::CompositorServer::create().
Test files
tests/input/auto_input_forwarding_wayland.cpp, tests/input/auto_input_forwarding_x11.cpp, tests/render/test_filter_boundary_contracts.cpp
Compositor server factory calls and type aliases updated to use compositor:: namespace (e.g., CompositorServer::create(), RuntimeMetricsState type alias).
Design documentation
openspec/changes/archive/2026-03-19-rename-compositor-namespace/design.md, openspec/changes/archive/2026-03-19-rename-compositor-namespace/proposal.md, openspec/changes/archive/2026-03-19-rename-compositor-namespace/spec.md, openspec/changes/archive/2026-03-19-rename-compositor-namespace/tasks.md
New design, proposal, specification, and tasks documents added to openspec archive, detailing scope (18 files affected), verification strategy (full CI run), rollout approach (atomic commit), and success criteria (zero remaining goggles::input references in compositor/tests).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • goggles-dev/Goggles#64 — Likely introduced the original CompositorServer and SurfaceInfo symbols under goggles::input namespace that this PR renames.
  • goggles-dev/Goggles#117 — Directly affects the same compositor types and symbols (e.g., RuntimeMetricsState in compositor_runtime_metrics.hpp) being renamed.
  • goggles-dev/Goggles#116 — Modifies the same compositor and UI classes (CompositorServer, CompositorState, ImGuiLayer) whose namespace this rename updates.

Suggested labels

mechanical-refactoring, namespace-rename, compositor-module

Poem

🐰 A rabbit hops with glee so bright,
From input to compositor—what a sight!
Eighteen files dance in harmony true,
Namespaces renamed, all fresh and new!
No logic bent, just labels bright—
The refactor's done! All systems right! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.54% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'refactor(compositor): rename input namespace to compositor' clearly and concisely summarizes the main change: renaming the C++ namespace from goggles::input to goggles::compositor throughout the compositor module and dependent code.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev/rename-namespace
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can disable poems in the walkthrough.

Disable the reviews.poem setting to disable the poems in the walkthrough.

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented Mar 19, 2026

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 📐 Spec deviations (0)

Grey Divider


Remediation recommended

1. Incorrect file-count spec 🐞 Bug ⚙ Maintainability
Description
The new OpenSpec spec.md asserts that zero files are created/deleted and exactly 18 files are
modified, but this change itself adds new OpenSpec files, making the statement misleading/incorrect
unless explicitly scoped to non-OpenSpec code files.
Code

openspec/changes/archive/2026-03-19-rename-compositor-namespace/spec.md[R137-143]

+### Scenario: No files created or deleted
+
+- **GIVEN** the set of files modified by this change
+- **WHEN** the changeset is inspected
+- **THEN** zero files SHALL be created
+- **AND** zero files SHALL be deleted
+- **AND** exactly 18 files SHALL be modified (14 compositor module files, 1 UI forward declaration, 3 test files)
Evidence
The spec explicitly requires zero created/deleted files and exactly 18 modified files, while other
OpenSpec docs in the same change also restate the same totals; however, these OpenSpec documents are
newly introduced as part of the change, so the file-count claim is inaccurate unless it explicitly
excludes OpenSpec artifacts from the count.

openspec/changes/archive/2026-03-19-rename-compositor-namespace/spec.md[137-143]
openspec/changes/archive/2026-03-19-rename-compositor-namespace/design.md[7-14]
openspec/changes/archive/2026-03-19-rename-compositor-namespace/proposal.md[80-87]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`openspec/.../spec.md` claims the changeset creates/deletes zero files and modifies exactly 18 files. This is misleading because the changeset includes newly added OpenSpec artifacts (including this `spec.md` itself).

### Issue Context
These counts may be intended to apply only to non-OpenSpec code files, but the documents currently state them without that scope, which can confuse reviewers and future readers.

### Fix Focus Areas
- openspec/changes/archive/2026-03-19-rename-compositor-namespace/spec.md[137-143]
- openspec/changes/archive/2026-03-19-rename-compositor-namespace/design.md[7-14]
- openspec/changes/archive/2026-03-19-rename-compositor-namespace/proposal.md[86-87]

### Suggested change
Update the wording to either:
- explicitly scope counts to `src/` + `tests/` only (excluding OpenSpec artifacts), or
- update the counts to reflect the full changeset including the OpenSpec files.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Copy link
Copy Markdown

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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@openspec/changes/archive/2026-03-19-rename-compositor-namespace/spec.md`:
- Around line 137-143: The spec currently contains contradictory and brittle
assertions in the "Scenario: No files created or deleted" section: the lines
asserting "zero files SHALL be created" and "zero files SHALL be deleted"
conflict with this spec file being newly added, and the hardcoded "exactly 18
files SHALL be modified" is brittle. Update that scenario by removing or
relaxing the absolute zero-create/zero-delete claims (or explicitly exempt the
new spec file), and replace the hardcoded "exactly 18 files SHALL be modified"
with a non-brittle description (e.g., "the expected set of files for this
changeset are modified" or parameterized count), editing the section title
"Scenario: No files created or deleted" and the three assertions "zero files
SHALL be created", "zero files SHALL be deleted", and "exactly 18 files SHALL be
modified" accordingly so the statements are consistent and no longer rely on a
fragile fixed number.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5905efb7-fe22-4c3c-8889-4874744febce

📥 Commits

Reviewing files that changed from the base of the PR and between 50993d3 and 2347b6f.

📒 Files selected for processing (25)
  • openspec/changes/archive/2026-03-19-rename-compositor-namespace/design.md
  • openspec/changes/archive/2026-03-19-rename-compositor-namespace/proposal.md
  • openspec/changes/archive/2026-03-19-rename-compositor-namespace/spec.md
  • openspec/changes/archive/2026-03-19-rename-compositor-namespace/tasks.md
  • src/app/application.cpp
  • src/app/application.hpp
  • src/compositor/compositor_core.cpp
  • src/compositor/compositor_cursor.cpp
  • src/compositor/compositor_focus.cpp
  • src/compositor/compositor_input.cpp
  • src/compositor/compositor_layer_shell.cpp
  • src/compositor/compositor_present.cpp
  • src/compositor/compositor_protocol_hooks.hpp
  • src/compositor/compositor_runtime_metrics.hpp
  • src/compositor/compositor_server.cpp
  • src/compositor/compositor_server.hpp
  • src/compositor/compositor_state.hpp
  • src/compositor/compositor_targets.hpp
  • src/compositor/compositor_xdg.cpp
  • src/compositor/compositor_xwayland.cpp
  • src/ui/imgui_layer.cpp
  • src/ui/imgui_layer.hpp
  • tests/input/auto_input_forwarding_wayland.cpp
  • tests/input/auto_input_forwarding_x11.cpp
  • tests/render/test_filter_boundary_contracts.cpp

Comment on lines +137 to +143
### Scenario: No files created or deleted

- **GIVEN** the set of files modified by this change
- **WHEN** the changeset is inspected
- **THEN** zero files SHALL be created
- **AND** zero files SHALL be deleted
- **AND** exactly 18 files SHALL be modified (14 compositor module files, 1 UI forward declaration, 3 test files)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix contradictory file-change assertions in the spec.

Line 141 and Line 142 conflict with this changeset (this spec file is newly added), and the hardcoded “exactly 18 files” count on Line 143 is brittle for archived documentation.

Proposed spec adjustment
 ### Scenario: No files created or deleted
-
-- **GIVEN** the set of files modified by this change
-- **WHEN** the changeset is inspected
-- **THEN** zero files SHALL be created
-- **AND** zero files SHALL be deleted
-- **AND** exactly 18 files SHALL be modified (14 compositor module files, 1 UI forward declaration, 3 test files)
+### Scenario: Expected code-scope footprint
+
+- **GIVEN** the namespace-rename implementation scope under `src/` and `tests/`
+- **WHEN** the changeset is inspected
+- **THEN** modifications SHALL be limited to compositor namespace references and related forward declarations/tests
+- **AND** no unrelated functional code changes SHALL be introduced
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@openspec/changes/archive/2026-03-19-rename-compositor-namespace/spec.md`
around lines 137 - 143, The spec currently contains contradictory and brittle
assertions in the "Scenario: No files created or deleted" section: the lines
asserting "zero files SHALL be created" and "zero files SHALL be deleted"
conflict with this spec file being newly added, and the hardcoded "exactly 18
files SHALL be modified" is brittle. Update that scenario by removing or
relaxing the absolute zero-create/zero-delete claims (or explicitly exempt the
new spec file), and replace the hardcoded "exactly 18 files SHALL be modified"
with a non-brittle description (e.g., "the expected set of files for this
changeset are modified" or parameterized count), editing the section title
"Scenario: No files created or deleted" and the three assertions "zero files
SHALL be created", "zero files SHALL be deleted", and "exactly 18 files SHALL be
modified" accordingly so the statements are consistent and no longer rely on a
fragile fixed number.

@K1ngst0m K1ngst0m merged commit 566924f into main Mar 19, 2026
5 checks passed
@K1ngst0m K1ngst0m deleted the dev/rename-namespace branch March 19, 2026 04:21
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.

1 participant