Skip to content

fix: terminal full-width, flow line fade sync, CONTRIBUTING staleness#45

Merged
johnnichev merged 1 commit intomainfrom
fix/desktop-terminal-flow-contributing
Apr 7, 2026
Merged

fix: terminal full-width, flow line fade sync, CONTRIBUTING staleness#45
johnnichev merged 1 commit intomainfrom
fix/desktop-terminal-flow-contributing

Conversation

@johnnichev
Copy link
Copy Markdown
Owner

Summary

Three small but distinct fixes from the latest review pass.

Issue 1 — pip install terminal full-width on desktop (Image #32)

Problem: The terminal install component was capped at `max-width: 440px`, leaving it visibly narrower than the "Try the Builder" + "Read the Docs" button row directly below it on desktop. The misalignment looked unintentional.

Fix: Removed the `max-width: 440px` constraint. The terminal now spans 100% of the hero-content column. The hero grid (1fr 1fr split until the 1024px breakpoint) constrains the column itself, so the terminal doesn't span the entire viewport on wide screens — it spans the column where the buttons live, which is what aligns them.

```diff
.terminal-install {
width: 100%;

  • max-width: 440px;
    ...
    }
    ```

Issue 2 — SVG flow lines lingering after nodes fade out (Image #33)

Root cause traced through the JS: In the hero flow scene transitions, nodes fade out via the CSS rule `transition: opacity 0.3s` when the JS sets `el.style.opacity = '0'`. Meanwhile, the SVG `` elements (and the `` pulses inside the same SVG) had no fade animation — they stayed fully opaque until the next scene's `buildScene()` cleared the SVG via `svg.textContent = ''`.

The visible result on a typical scene transition:

  • t=0ms: Result toast hides, nodes start fading
  • t=300ms: Nodes fully invisible
  • t=300–400ms: Lines hang in the air alone with no nodes ← the bug
  • t=400ms: `onDone` fires, next scene's buildScene clears the SVG
  • t=400ms+: New scene's nodes and lines fade in

Fix (3 small changes):

  1. Added an opacity transition to `.hf-svg`:
    ```css
    .hf-svg {
    ...existing rules...
    transition: opacity 0.3s var(--ease);
    }
    ```

  2. In `playScene`'s "all done" handler, fade the SVG at the same time as the nodes:
    ```diff
    nodeEls.forEach(function(el) { el.style.opacity = '0'; });
    +svg.style.opacity = '0';
    delay(400, onDone);
    ```

  3. In `buildScene` (called by the next scene), reset SVG opacity to 1 before drawing the new lines:
    ```diff
    nodesEl.textContent = '';
    svg.textContent = '';
    +svg.style.opacity = '1';
    ```

Lines and nodes now fade out together on the same 0.3s curve. No more lingering ghost lines.

Issue 3 — CONTRIBUTING.md staleness pass

The user asked me to "verify the contributing tab and update since I see that at least the version is already outdated." I caught the version stale fact and several others while I was there:

Stale Was Now
Header version `v0.19.2` `v0.20.1`
Header Python `3.9+` `3.9 – 3.13`
Header test status `100%` `95% coverage` (matches reality)
Project structure `24 pre-built tools` `33 pre-built tools`
Project structure `61 numbered examples (01–61)` `88 numbered examples`
Release example `0.5.1` (ancient) `0.20.2` (current minor + 1)
Test command `python tests/test_framework.py` `pytest tests/`
Provider test path `tests/test_framework.py` `tests/providers/test_your_provider.py`
Section header `Adding RAG Features (New in v0.8.0!)` `Adding RAG Features`

Verification of the new numbers:
```bash
$ find examples -maxdepth 1 -name '.py' | wc -l
88
$ grep -c '^@tool' src/selectools/toolbox/
.py | awk -F: '{sum+=$2} END {print sum}'
33
```

The biggest substantive fix: rewrote the "Adding a New Tool" example. The old example used the legacy class-based API:

```python
return Tool(
name="your_tool",
description="...",
parameters=[
ToolParameter(name="param1", param_type=str, required=True),
...
],
function=your_tool_implementation,
)
```

Selectools has used the `@tool()` decorator pattern for many versions now, where the function signature and docstring are introspected automatically. The old example was actively misleading new contributors into using a deprecated API. The new example shows the modern decorator pattern with proper docstring conventions:

```python
from selectools import tool

@tool()
def your_tool(param1: str, param2: int = 10) -> str:
"""One-line description.

Args:
    param1: What this is for.
    param2: Optional. Default 10.

Returns:
    Description of the return value.
"""
return f"Result: {param1} with {param2}"

```

Plus a complete usage example showing how to wire the tool into an Agent.

Test plan

Desktop:

  • pip install terminal aligns with the button row below it (same width)
  • Visit https://selectools.dev and watch the hero flow animation cycle through scenes
  • Verify lines fade out smoothly with the nodes (no lingering ghost lines)
  • Verify lines fade in cleanly with the next scene's nodes

CONTRIBUTING.md:

  • Open https://selectools.dev/CONTRIBUTING/ (or read the file directly)
  • Verify version says v0.20.1
  • Verify tool count says 33
  • Verify example count says 88
  • Verify the "Adding a New Tool" example uses `@tool()` decorator

Regression:

  • Pre-commit hooks pass 14/14
  • HTML structural balance OK
  • `node --check` validates the JS
  • No remaining `24 (tools|pre-built)`, `61 (examples|numbered)`, `v0.[0-9]`, `0.5.1`, `v0.8.0`, or `test_framework` strings in CONTRIBUTING.md (verified via grep)

What's NOT in this PR

  • Full rewrite of the project structure block — only the genuinely stale numeric facts were fixed; the listed file names are still mostly accurate and a full architectural audit is out of scope for "the version is outdated"
  • No CHANGELOG entry — these are doc fixes, not user-facing code
  • No version bump

Three small fixes from the latest review pass.

1. **pip install terminal full-width on desktop** (Image #32):
   Removed `max-width: 440px` from `.terminal-install`. The terminal
   now spans 100% of the hero-content column, matching the width of
   the "Try the Builder" + "Read the Docs" button row directly below
   it. The hero grid (1fr 1fr split until 1024px) still constrains
   the column width itself, so this doesn't span the entire viewport
   on wide screens — it spans the column where the buttons live,
   which is what aligns them.

2. **SVG flow lines lingering after nodes fade out** (Image #33):
   Root cause: in the hero flow scene transitions, nodes fade via
   CSS `transition: opacity 0.3s` when `el.style.opacity = '0'`, but
   the SVG `<line>` elements (and `<circle>` pulses inside the same
   `<svg>`) had no fade animation — they stayed fully opaque until
   the next scene's `buildScene()` cleared the SVG via
   `svg.textContent = ''`. The visible result: nodes vanish at
   t=300ms, lines hang in the air alone for ~100ms, then snap to the
   next scene at t=400ms.

   Fix: added `transition: opacity 0.3s var(--ease)` to `.hf-svg`,
   and in playScene's "all done" handler set `svg.style.opacity = '0'`
   at the same time as `el.style.opacity = '0'` on the nodes. In
   buildScene, reset `svg.style.opacity = '1'` before drawing the
   next scene's lines so the new content fades in cleanly. Lines and
   nodes now vanish on the same curve.

3. **CONTRIBUTING.md stale facts** (user pointed out the version):
   The user noticed v0.19.2 in the header. While I was there I caught
   several other stale items and fixed them in the same pass:

   - Header version: v0.19.2 → v0.20.1 (current)
   - Header Python: "3.9+" → "3.9 – 3.13" (matches actual classifiers)
   - Header test status: "100%" → "95% coverage" (matches reality)
   - Project structure: "24 pre-built tools" → "33 pre-built tools"
     (verified via `grep -c '^@tool' src/selectools/toolbox/*.py`)
   - Project structure: "61 numbered examples (01–61)" → "88 numbered
     examples" (verified via `find examples -maxdepth 1 -name '*.py'
     | wc -l`)
   - Release script examples: 0.5.1 → 0.20.2 (current minor + 1)
   - Test command: `python tests/test_framework.py` → `pytest tests/`
     (the legacy single-file runner doesn't exist anymore)
   - Provider test path: `tests/test_framework.py` → `tests/providers/
     test_your_provider.py` (current convention)
   - Section header: "Adding RAG Features (New in v0.8.0!)" → "Adding
     RAG Features" (v0.8.0 was many releases ago)

   The biggest substantive fix: rewrote the "Adding a New Tool"
   example. The old example used `Tool(name=..., parameters=[
   ToolParameter(...)])`, which is the legacy class-based API.
   Selectools has used the `@tool()` decorator pattern for many
   versions now, where the function signature and docstring are
   introspected automatically. The old example was actively
   misleading new contributors into using a deprecated API. New
   example shows the modern decorator pattern with proper docstring
   conventions.

What's NOT in this PR:

- Full rewrite of the project structure block — only the genuinely
  stale numeric facts (24, 61) were fixed; the listed file names are
  still mostly accurate and a full architectural audit is out of
  scope for "the version is outdated"
- No CHANGELOG entry — these are doc fixes, not user-facing code
- No version bump
@johnnichev johnnichev merged commit e31d31d into main Apr 7, 2026
9 checks passed
@johnnichev johnnichev deleted the fix/desktop-terminal-flow-contributing branch April 8, 2026 03:49
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