Skip to content

Reframe layout docs around responsive UI and instructional style#5110

Merged
tig merged 5 commits intodevelopfrom
copilot/update-layout-docs-for-responsiveness
Apr 28, 2026
Merged

Reframe layout docs around responsive UI and instructional style#5110
tig merged 5 commits intodevelopfrom
copilot/update-layout-docs-for-responsiveness

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 28, 2026

Proposed Changes/Todos

Responsive layout is already a core capability of Terminal.Gui, but the docs emphasized mechanics over the mental model. This updates the layout docs and XML API docs to present Pos/Dim as a declarative, responsive layout system first, with internals and edge cases second, and aligns the updated docs with the required instructional sentence style.

  • Reframe the layout guide around responsive composition

    • Add a responsive mental model to docfx/docs/layout.md
    • Lead with relationships (center, fill, anchor, follow another view) instead of low-level taxonomy
    • Rewrite examples to show adaptive form-row style layouts and explain Dim.Fill (to: ...)
  • Align API docs with the same mental model

    • Update XML docs in Pos, Dim, and View.Layout to describe:
      • declarative positioning/sizing
      • Frame as the resolved result of layout
      • Layout / SetRelativeLayout as the step that resolves responsive expressions into concrete coordinates
  • Clean up stale terminology in layout docs

    • Replace outdated Pos.At (0) references with Pos.Absolute (0)
    • Tighten wording so examples read correctly for both axes and match current API names
  • Apply the instructional-sentence rule to the updated docs

    • Rewrite the updated docfx/docs/layout.md prose to use the To [goal], [imperative action]. pattern consistently, including the opening paragraph and mental-model framing
    • Rewrite the related XML API docs in Pos and Dim to use the same instructional pattern
    • Avoid unnecessary When/If you want/need to ... phrasing in the updated reference/how-to text
  • Update AI agent instructions so future agents follow the same docs style

    • Add the terse documentation-style rule to AGENTS.md, CLAUDE.md, .github/copilot-instructions.md, and llms.txt

Example of the framing this PR now emphasizes:

Label nameLabel = new () { Text = "Name:" };
Button okButton = new () { Text = "OK", X = Pos.AnchorEnd () };
TextField nameField = new ()
{
    X = Pos.Right (nameLabel) + 1,
    Y = Pos.Top (nameLabel),
    Width = Dim.Fill (to: okButton)
};

This makes the responsive behavior explicit: the label keeps its content width, the button stays anchored to the end, and the text field expands/contracts between them.

Pull Request checklist:

  • I've named my PR in the form of "Fixes #issue. Terse description."
  • My code follows the style guidelines of Terminal.Gui - if you use Visual Studio, hit CTRL-K-D to automatically reformat your files before committing.
  • My code follows the Terminal.Gui library design guidelines
  • I ran dotnet test before commit
  • I have made corresponding changes to the API documentation (using /// style comments)
  • My changes generate no new warnings
  • I have checked my code and corrected any poor grammar or misspellings
  • I conducted basic QA to assure all features are working

Copilot AI changed the title [WIP] Update API docs to emphasize responsive layout for TUI apps Reframe layout docs around responsive UI Apr 28, 2026
Copilot finished work on behalf of tig April 28, 2026 21:37
Copilot AI requested a review from tig April 28, 2026 21:37
@tig
Copy link
Copy Markdown
Collaborator

tig commented Apr 28, 2026

@copilot apply these rules to the docs you updated.

API Documentation Style Rule – Instructional SentencesUse only this pattern for actions/instructions:

  • To [achieve goal], [imperative action].
  • To list users, send GET /v1/users.
  • To create an item, POST /v1/items with JSON body { "name": "..." }.

Strictly forbid these forms in reference/how-to sections:

  • When you want/need to …
  • If you want/need to …
  • Whenever you …
  • To [goal] when you …

Exceptions: Use "when/if" only for real conditions (e.g., rate limits, errors, optional behavior):

  • When rate limit is exceeded, return 429.

Rationale (brief): Infinitive-of-purpose + imperative is concise, scannable, professional, and matches top API docs (Stripe, Twilio, OpenAI, etc.). "When you" adds unnecessary verbosity and conditional framing.

update the ai agent instructions to include the tersest version of this so future agents get it right.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 28, 2026

@copilot apply these rules to the docs you updated.

API Documentation Style Rule – Instructional SentencesUse only this pattern for actions/instructions:
...

Applied in c479753. I updated the layout docs and XML docs to use the To [goal], [imperative action]. pattern where I had added instructional text, and added the terse rule to the AI instruction files (AGENTS.md, CLAUDE.md, .github/copilot-instructions.md, and llms.txt).

Copilot AI changed the title Reframe layout docs around responsive UI Reframe layout docs around responsive UI and instructional style Apr 28, 2026
Copilot finished work on behalf of tig April 28, 2026 21:44
@tig
Copy link
Copy Markdown
Collaborator

tig commented Apr 28, 2026

@copilot you did not follow instructions. Literally the first para of layout.md breaks these rules:

Terminal.Gui layout is declarative and responsive. Instead of hard-coding every Frame, you describe how a View should relate to its SuperView, its content, and sibling views. Terminal.Gui then resolves the final Frame whenever layout runs, including after terminal resizes.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 28, 2026

@copilot you did not follow instructions. Literally the first para of layout.md breaks these rules:

Terminal.Gui layout is declarative and responsive. Instead of hard-coding every Frame, you de...

Fixed in b9dc16b. I rewrote the remaining instructional prose in layout.md and the parallel Pos/Dim XML remarks into the required To [goal], [imperative action]. form, including the opening paragraph you pointed out.

Copilot finished work on behalf of tig April 28, 2026 21:53
@tig tig marked this pull request as ready for review April 28, 2026 22:01
@tig tig merged commit e4388c8 into develop Apr 28, 2026
11 checks passed
@tig tig deleted the copilot/update-layout-docs-for-responsiveness branch April 28, 2026 22:01
tig added a commit that referenced this pull request Apr 28, 2026
* Initial plan

* docs: reframe layout docs around responsive UI

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/a6b913bd-38e5-4d80-ac23-9dc8e6716045

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* docs: polish responsive layout wording

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/a6b913bd-38e5-4d80-ac23-9dc8e6716045

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* docs: tighten instructional sentence style

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/d453216b-6d43-4261-aa23-0dad98805e91

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* docs: fix remaining instructional prose

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/d7be6123-896e-4b95-8e3f-0cee1d6d35d1

Co-authored-by: tig <585482+tig@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
tig added a commit that referenced this pull request Apr 29, 2026
…5115)

* Bump ReportGenerator from 5.5.5 to 5.5.6

---
updated-dependencies:
- dependency-name: ReportGenerator
  dependency-version: 5.5.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update Examples link in README.md (#5104)

* Reframe layout docs around responsive UI and instructional style (#5110)

* Initial plan

* docs: reframe layout docs around responsive UI

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/a6b913bd-38e5-4d80-ac23-9dc8e6716045

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* docs: polish responsive layout wording

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/a6b913bd-38e5-4d80-ac23-9dc8e6716045

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* docs: tighten instructional sentence style

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/d453216b-6d43-4261-aa23-0dad98805e91

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* docs: fix remaining instructional prose

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/d7be6123-896e-4b95-8e3f-0cee1d6d35d1

Co-authored-by: tig <585482+tig@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fixes #5114. Remove main from publish branch triggers; use tags only

Main branch pushes were triggering the publish workflow without a release
tag, causing GitVersion to produce invalid NuGet versions (e.g. 2.0.0-5420).

- Remove main from branches trigger; stable releases now publish only on v* tag push
- Develop branch pushes continue publishing pre-release packages automatically
- Update template dispatch conditions to match tag-based flow

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
tig added a commit that referenced this pull request Apr 29, 2026
* Update Examples link in README.md (#5104)

* Reframe layout docs around responsive UI and instructional style (#5110)

* Initial plan

* docs: reframe layout docs around responsive UI
tig added a commit that referenced this pull request Apr 29, 2026
…5115)

* Bump ReportGenerator from 5.5.5 to 5.5.6

---
updated-dependencies:
- dependency-name: ReportGenerator
  dependency-version: 5.5.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update Examples link in README.md (#5104)

* Reframe layout docs around responsive UI and instructional style (#5110)

* Initial plan

* docs: reframe layout docs around responsive UI

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/a6b913bd-38e5-4d80-ac23-9dc8e6716045

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* docs: polish responsive layout wording

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/a6b913bd-38e5-4d80-ac23-9dc8e6716045

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* docs: tighten instructional sentence style

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/d453216b-6d43-4261-aa23-0dad98805e91

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* docs: fix remaining instructional prose

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/d7be6123-896e-4b95-8e3f-0cee1d6d35d1

Co-authored-by: tig <585482+tig@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fixes #5114. Remove main from publish branch triggers; use tags only

Main branch pushes were triggering the publish workflow without a release
tag, causing GitVersion to produce invalid NuGet versions (e.g. 2.0.0-5420).

- Remove main from branches trigger; stable releases now publish only on v* tag push
- Develop branch pushes continue publishing pre-release packages automatically
- Update template dispatch conditions to match tag-based flow

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
BDisp pushed a commit to BDisp/Terminal.Gui that referenced this pull request Apr 29, 2026
… only (gui-cs#5115)

* Bump ReportGenerator from 5.5.5 to 5.5.6

---
updated-dependencies:
- dependency-name: ReportGenerator
  dependency-version: 5.5.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update Examples link in README.md (gui-cs#5104)

* Reframe layout docs around responsive UI and instructional style (gui-cs#5110)

* Initial plan

* docs: reframe layout docs around responsive UI

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/a6b913bd-38e5-4d80-ac23-9dc8e6716045

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* docs: polish responsive layout wording

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/a6b913bd-38e5-4d80-ac23-9dc8e6716045

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* docs: tighten instructional sentence style

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/d453216b-6d43-4261-aa23-0dad98805e91

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* docs: fix remaining instructional prose

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/d7be6123-896e-4b95-8e3f-0cee1d6d35d1

Co-authored-by: tig <585482+tig@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fixes gui-cs#5114. Remove main from publish branch triggers; use tags only

Main branch pushes were triggering the publish workflow without a release
tag, causing GitVersion to produce invalid NuGet versions (e.g. 2.0.0-5420).

- Remove main from branches trigger; stable releases now publish only on v* tag push
- Develop branch pushes continue publishing pre-release packages automatically
- Update template dispatch conditions to match tag-based flow

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Layout API docs and ./docfx/docs/layout.md needs to be "responsive" centric

2 participants