Skip to content

Develop - #4

Merged
FRACerqueira merged 4 commits into
mainfrom
develop
Jul 25, 2026
Merged

Develop#4
FRACerqueira merged 4 commits into
mainfrom
develop

Conversation

@FRACerqueira

Copy link
Copy Markdown
Owner

This pull request updates several ADR (Architecture Decision Record) documents and the advanced API documentation to reflect recent implementation and documentation audits. The main changes include corrections and clarifications to previous ADRs, removal of outdated or incorrect information, and improvements to the advanced API documentation to match the current codebase.

ADR document updates and corrections:

  • Updated ADR index (docs/adr/README.md) to reference new revision numbers and corrected titles for ADR0002, ADR0005, and ADR0015. [1] [2]
  • ADR0002 ("Immutable capability profile") revised to R02: documents the real override path (ConsoleProfile.json), removes a dead API (IProfileSetup) that contradicted the ADR, and clarifies that the only supported override is via a JSON file at startup. [1] [2] [3] [4]
  • ADR0005 ("ANSICON legacy Windows support") revised to R02: corrects the mechanism description from "DLL injection" to the actual "process launch" approach, matching the real implementation. [1] [2] [3] [4]
  • ADR0015 ("Generated API docs are off-limits for manual edits") revised to R02: clarifies that API doc regeneration is gated on the ReleaseDoc build configuration (not Release), and updates the build/project file conditions accordingly. [1] [2] [3]

Advanced API documentation improvements:

  • The EmacsConsoleBuffer now documents a fourth constructor argument (enableEmacsKeys), and example code is updated to include this parameter. [1] [2]
  • Added documentation for new string utility methods: TruncateToDisplayWidth(int maxWidth) and GetRuneWidth() (on Rune).

These changes ensure the documentation accurately reflects the current implementation, clarifies supported behaviors, and removes outdated or misleading information.

Added the <Configurations> property to ConsolePlusFeaturesSamples.csproj, ConsolePlus.csproj, and ConsolePlus.Tests.csproj to specify Debug, Release, and ReleaseDoc build configurations.
…t; audit and correct docs

Three real bugs found during a docs audit:
- ConsolePlusExtends.ClearLine recursed into itself with no base case,
  causing a StackOverflowException on any call.
- AnsiConsoleAdapter/NoAnsiConsoleAdapter's HideCursor/ShowCursor always
  returned a fixed value regardless of whether the native call succeeded,
  contradicting their own documented contract; NoAnsiConsoleAdapter's
  HideCursor was also missing a catch clause ShowCursor already had.
- The two repos' physically-duplicated test driver sources had drifted
  (3 of 8 files); re-synced from PromptPlus's copy.

Removed IProfileSetup, a public interface with zero implementers or
callers that contradicted the profile-immutability decision; the real
override path (ConsoleProfile.json, read before any caching) already
covered everything it promised and is now documented. Fixed the
ReleaseDoc build configuration, which had never actually been wired to
the DefaultDocumentation generator (still gated on Release).

Corrected the rest of the docs audit catalog: wrong method names/arity,
missing constructor parameters, incorrect Color casing, a fictional
Emoji API model, a mostly-wrong markup error-handling table, a
fabricated ANSICON injection mechanism (also in ADR0005), and several
smaller behavioral gaps across reading-input/markup/widgets/advanced-api.

Consolidated ADR0005, and two new ADRs for the IProfileSetup removal and
ReleaseDoc fix, as revisions of the existing ADR0005/ADR0002/ADR0015
records rather than new sequence numbers, per project policy.
Console.CursorVisible throws IOException ("The handle is invalid")
when no real console is attached (headless processes, some test
hosts) rather than PlatformNotSupportedException, so the earlier
success/failure fix didn't cover it. Broadened the catch on both
adapters to match the "Safe" pattern EnvironmentUtil already uses for
the same class of failure.

This was blocking ConsolePlusExtends.* from being unit-tested at all,
since touching any of its methods forces the ConsolePlus singleton to
construct a real console adapter. Restores the ClearLine regression
test that previously crashed the whole run.
ConsolePlusExtendsTests forces ConsolePlusLibrary.ConsolePlus's real
static ctor to run, which populates BaseClassCI's process-wide
environment-variable cache via EnrichersCI(). ProfileExtensionsTests
manages that same cache by hand (reflection reset per test) to
simulate CI providers in isolation, which only worked because nothing
else touched it. With xUnit parallelizing different test classes by
default, the two could race, intermittently stomping the simulated
env-var snapshot with a real one (seen on a macOS CI run: TF_BUILD
detection failed because ChangedColorDepth came back false).

Added GlobalStateCollection (DisableParallelization) and put both
classes in it, matching PromptPlus's SerializedGlobalStateCollection
pattern for the same class of shared-static-state risk.
@FRACerqueira
FRACerqueira merged commit 77da807 into main Jul 25, 2026
9 checks passed
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