GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: add tests for the `lazy_then` utility by snipsnipsnip · Pull Request #35 · exteditor/ghostbird

Conversation

@snipsnipsnip

@snipsnipsnip snipsnipsnip commented Oct 8, 2025 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Remove unused awaitable function.
  • Generate a TypeScript snippet which can be used to type checking DI in startup test.

Summary by CodeRabbit

  • New Features

    • None.
  • Style

    • Polished options page form styling for consistent border radii and improved alignment/height for number and reset inputs; progress indicators unchanged.
  • Documentation

    • Added FAQ on type-safety automation and test instructions; updated generated dependency-tree reference and clarified maintainability notes.
  • Tests

    • Restructured tests, added dependency-reporting and case-insensitive sorting utilities, and updated test IO/path handling.
  • Refactor

    • Reworked lazy-init utility API to a cached "lazy then" pattern.
  • Chores

    • CI now includes test results in build artifacts; added a dev dependency for tooling.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-project-automation github-project-automation Bot added this to Ghostbird Issues Oct 8, 2025
@github-project-automation github-project-automation Bot moved this to 📥️Inbox in Ghostbird Issues Oct 8, 2025
@coderabbitai

coderabbitai Bot commented Oct 8, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds test-reporting utilities and refactors test plumbing, introduces a case-insensitive toposort util, changes lazy initialization API, updates test IO paths and CSS nesting, adds a CI step to include test results in artifacts, and adds a devDependency.

Changes

Cohort / File(s) Summary
CI workflow
.github/workflows/build.yml
Adds step "Add test result to artifact": if build/test/ exists, move it to dist/ext/test-result, otherwise warn and continue before uploading artifacts.
Docs
doc/faq-architectural.md
Adds FAQ subsection about automated new and type-safety; updates generated file reference from build/test/dependency_tree.mermaid to build/test/dependency_tree.md; reflows a long bullet into two.
Styles
ext/options.css
Refactors selectors to nested rules: consolidates child border-radius rules, nests input and label ::before rules, and nests progress state pseudo-elements; preserves keyframes/animations.
Dependencies
package.json
Adds devDependency toposort-class@^1.0.1.
Tests — imports & callbacks
src/test/locales.test.ts, src/test/sanity.test.ts, src/test/startup.test.ts
Remove top-level expect import from vitest; test callbacks now accept ({ expect }) => .... Startup tests refactored to use dependency_reporter helpers, emit dependency dumps, and TestRegistry gains a duplicate-registration guard.
Test utilities — IO & paths
src/test/util/io.ts
Adjusts path resolution: loadToml expects an absolute path; loadLocalesToml and loadOptionsCss resolve files via ../../../...; loadSourceTexts glob roots moved up, doc comments updated.
Test utilities — sorting
src/test/util/case_insensitive_toposort.ts
New export caseInsensitiveToposort(deps, casefold?) using toposort-class to perform case-insensitive topological sort and restore original casing.
Test utilities — dependency reporter
src/test/util/dependency_reporter.ts
New module exporting AnyEntry, AnyModules, collectDependencies (generator) and dumpDependencies (produces Mermaid diagram + TypeScript startup code); includes validation, module resolution, and code-generation helpers.
Test utilities — IO writer
src/test/util/io.ts
Adds/adjusts writeText usage for persisting reports (callers updated).
Runtime util
src/util/lazy_then.ts
Replaces awaitable<T> with makeLazyThen<T>(init) returning a LazyThen<T> that caches resolved value and may run continuations synchronously after first resolution; tests updated accordingly.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Tests as Test Suite
  participant Reporter as dependency_reporter
  participant IO as IO util
  participant FS as File System
  participant CI as GitHub Actions

  Note over Tests,Reporter #e6f7ff: dependency collection & report generation
  Tests->>Reporter: collectDependencies(registry)
  Reporter-->>Tests: yields [name, deps]*
  Tests->>Reporter: dumpDependencies(depList, registry, modules)
  Reporter-->>Tests: returns Markdown (Mermaid + startup code)
  Tests->>IO: writeText(dist/ext/test-result/output.md)
  IO-->>FS: create `dist/ext/test-result`
  CI->>FS: bundle artifacts
  CI->>FS: upload artifacts (includes `dist/ext/test-result` if present)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • Show notifications on connection and disconnection #34 — Modifies src/util/lazy_then.ts and related awaitable/makeLazyThen semantics; likely overlaps with the lazy initialization changes here.

"I hopped through tests and tidy trees,
Drew diagrams with quiet ease,
Moved results to where artifacts sleep,
Sorted names that once would leap,
A rabbit's patch — small, snug, and sweet 🐇"

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description does not follow the repository’s required template and is missing key sections such as the license agreement checkbox, the change type selection, “current behavior” and “new behavior” headings, testing steps, and any additional context. Please update the PR description to use the provided template by including the license agreement checkbox, specifying the change type, describing the current and new behavior, listing steps to manually verify the changes, and adding any relevant context or notes.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly and succinctly describes the primary change of adding tests for the lazy_then utility and follows a conventional commit style, making it easy to understand the main focus of the pull request.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6227a12 and aaf6e99.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (11)
  • .github/workflows/build.yml (1 hunks)
  • doc/faq-architectural.md (1 hunks)
  • ext/options.css (1 hunks)
  • package.json (1 hunks)
  • src/test/locales.test.ts (2 hunks)
  • src/test/sanity.test.ts (3 hunks)
  • src/test/startup.test.ts (5 hunks)
  • src/test/util/case_insensitive_toposort.ts (1 hunks)
  • src/test/util/dependency_reporter.ts (1 hunks)
  • src/test/util/io.ts (2 hunks)
  • src/util/lazy_then.ts (1 hunks)

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

coderabbitai[bot]
coderabbitai Bot reviewed Oct 8, 2025
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3f7b2ec and 48fa08e.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (11)
  • .github/workflows/build.yml (1 hunks)
  • doc/faq-architectural.md (1 hunks)
  • ext/options.css (1 hunks)
  • package.json (1 hunks)
  • src/test/locales.test.ts (2 hunks)
  • src/test/sanity.test.ts (3 hunks)
  • src/test/startup.test.ts (5 hunks)
  • src/test/util/case_insensitive_toposort.ts (1 hunks)
  • src/test/util/dependency_reporter.ts (1 hunks)
  • src/test/util/io.ts (2 hunks)
  • src/util/lazy_then.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (5)
src/test/util/io.ts (1)
src/util/types.ts (1)
  • LocalesTomlContent (2-2)
src/test/locales.test.ts (1)
src/test/util/io.ts (1)
  • loadSourceTexts (66-70)
src/test/util/dependency_reporter.ts (3)
src/root/util/wire.ts (1)
  • ResolveQuery (126-130)
src/util/case_folding_set.ts (1)
  • CaseFoldingSet (1-11)
src/test/util/case_insensitive_toposort.ts (1)
  • caseInsensitiveToposort (4-17)
src/test/sanity.test.ts (1)
src/root/startup/startup_background.ts (1)
  • prepareBackgroundRouter (31-38)
src/test/startup.test.ts (3)
src/test/util/dependency_reporter.ts (4)
  • AnyModules (7-7)
  • collectDependencies (30-67)
  • dumpDependencies (9-27)
  • AnyEntry (6-6)
src/root/util/wireless.ts (1)
  • wireless (45-57)
src/test/util/io.ts (1)
  • writeText (19-29)
🔇 Additional comments (16)
doc/faq-architectural.md (2)

13-17: LGTM! Clear explanation of type safety verification.

The new FAQ section effectively explains how type safety is partially verified through tests and provides clear guidance on running them.


25-25: File extension is correct The tests generate dependency_tree.md (see src/test/startup.test.ts:66), so the change from .mermaid to .md is valid.

package.json (1)

77-77: LGTM! Dependency added for test utility.

The toposort-class package is appropriately added as a devDependency to support the new case_insensitive_toposort test utility.

src/test/sanity.test.ts (2)

13-13: LGTM! Adopts Vitest 3.x injection pattern.

Removing the expect import and using the injected parameter aligns with modern Vitest best practices and makes test dependencies explicit.


17-17: LGTM! Consistent test callback signature.

Using the destructured { expect } parameter makes assertions explicit and consistent across the test suite.

src/test/locales.test.ts (2)

1-3: LGTM! Test utilities reorganized and expect injection adopted.

The import path change to ./util/io indicates better organization of test utilities, and removing the expect import aligns with the new injection pattern.


23-23: Narrowed glob pattern safely covers all locale ID usage.

Verified no "src_*" IDs occur outside src/{root,ghosttext-adaptor}, so the updated glob requires no further changes.

src/test/util/io.ts (3)

41-45: LGTM! Clearer path handling with absolute paths.

Changing loadToml to accept an absolute path and updating the documentation improves clarity and reduces ambiguity in path resolution.


66-69: LGTM! Consistent path handling for glob patterns.

The updated path resolution for loadSourceTexts aligns with the other path changes and the documentation correctly describes the glob as relative to package.json.


52-59: Paths resolve correctly The updated relative paths correctly locate locales.toml and ext/options.css at the project root.

src/test/util/case_insensitive_toposort.ts (2)

4-17: LGTM! Correct implementation of case-insensitive topological sort.

The implementation correctly:

  • Normalizes keys and edges to lowercase for sorting
  • Maintains a map from lowercase to original casing
  • Returns results with original casing preserved

The logic is sound and handles the case-insensitive requirement properly.


1-2: Confirmed absence of TypeScript definitions for toposort-class; the // @ts-expect-error directive is justified.

ext/options.css (4)

27-39: LGTM! Modern CSS nesting improves maintainability.

The refactored border-radius rules using nested & selectors maintain the same functionality while improving code organization and readability.


44-50: LGTM! Input type selectors properly nested.

The nested input type selectors maintain the same specificity and functionality while providing better code organization.


52-59: LGTM! Label selectors consolidated with nesting.

The refactored label rules using nesting maintain the same behavior while improving code structure.


60-71: LGTM! Progress state styles properly nested.

The nested .progress selectors maintain the same animations and styling while providing better code organization. The animation timing and colors are preserved correctly.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread .github/workflows/build.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/test/util/dependency_reporter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/util/lazy_then.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

snipsnipsnip added 8 commits October 9, 2025 08:08
@snipsnipsnip
test: add tests for the lazy_then utility
db2f60b
Also, remove unused `awaitable`
@snipsnipsnip
test: sort before dumping dependencies
7a00158
Also, adjusted data shape to use the toposort library added later
@snipsnipsnip
test: rename testutil
85dd40c
@snipsnipsnip
test: add a TypeScript snippet to the dependency tree dump
08aef91
@snipsnipsnip
test: use non-global expect
1ecccd8
@snipsnipsnip
test: split dependency reporting into test/util/
4fddeb6
@snipsnipsnip
refactor: use css nesting
14d2d06
@snipsnipsnip
ci: add test result to build artifacts
aaf6e99
@snipsnipsnip
snipsnipsnip force-pushed the add-util-tests branch from 6227a12 to aaf6e99 Compare October 8, 2025 23:08
@snipsnipsnip
snipsnipsnip added this pull request to the merge queue Oct 8, 2025
Merged via the queue into exteditor:main with commit 5e0365a Oct 8, 2025
@snipsnipsnip
snipsnipsnip deleted the add-util-tests branch October 8, 2025 23:10
@github-project-automation github-project-automation Bot moved this from 📥️Inbox to 🪺Experimental in Ghostbird Issues Oct 8, 2025
@snipsnipsnip snipsnipsnip moved this from 🪺Experimental to ✅Closed in Ghostbird Issues Oct 15, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Oct 16, 2025
Add a context menu to the toolbar button #39
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@coderabbitai coderabbitai[bot] coderabbitai[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

Ghostbird Issues
Archived in project

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@snipsnipsnip
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.