Skip to content

πŸ› fix(dashboard): render reader context lines in a neutral color - #16570

Merged
hivecommons-hive[bot] merged 3 commits into
hivecommons:v5from
thatguywob:fix/16550-reader-context-lines
Nov 4, 2026
Merged

hivecommons-hive[bot] merged 3 commits into
hivecommons:v5from
thatguywob:fix/16550-reader-context-lines

Conversation

@thatguywob

Copy link
Copy Markdown
Contributor

Summary

Lines with op: ' ' in the code activity reader now use a neutral text color rather than green addition styling. Their space prefix, indentation and blank lines are preserved. Explicit additions, removals and the legacy source without an operator keep their existing behavior.

The reader DOM regression scenarios now include blank and indented context lines alongside additions and removals, including paginated and reduced-motion rendering. The served dashboard page is regenerated and a changelog fragment is included.

Related issues

Fixes #16550

Testing

  • Not run locally: AGENTS.md requires CI validation for agent-authored PRs.
  • gofmt -l src/pkg/dashboard/reader_ui_test.go produced no output.
  • git diff --check passed.
  • Regenerated static/index.html with go generate ./pkg/dashboard/webstatic/.

Contributor checklist

  • Added changelog.d/fixed-16550-reader-context-lines.md.
  • Targets v5.
  • Title uses the repository emoji convention.
  • Commit includes DCO sign-off.
  • Generated dashboard artifact updated.
  • No secrets, credentials or local runtime state committed.

β€” hive: backend=codex model=gpt-6.1-sol effort=high


🐝 Hive Agent: contributor | SHA: b4c421801

@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nicholasjackson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#16514 ✨ feat(dashboard): replace Matrix presentation with Code activity same files src/pkg/dashboard/reader_ui_test.go
src/pkg/dashboard/static/index.html
#16569 πŸ› fix: avoid empty reader catch-up pulls for filtered lines same files src/pkg/dashboard/reader_ui_test.go
src/pkg/dashboard/static-src/js/reader.js
src/pkg/dashboard/static/index.html
#16500 ✨ feat(dashboard): replace Matrix presentation with Code activity same files src/pkg/dashboard/reader_ui_test.go
src/pkg/dashboard/static-src/css/reader.css
src/pkg/dashboard/static-src/js/reader.js
src/pkg/dashboard/static/index.html

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Read static-src/js/reader.js:95-97, reader.css:24 and the regenerated static/index.html (ran go generate ./pkg/dashboard/webstatic/ at this head; no diff). The classification is sound: op === '-' β†’ reader-del, op === ' ' β†’ reader-context, anything else (including the legacy missing op) keeps reader-add and the + prefix, so existing output is unchanged. --reader-text is defined at reader.css:5. Looks correct to me.

One context note for whoever merges, not a defect: on v5 today the server never sends op at all β€” matrixLine in src/pkg/dashboard/matrix_source.go:51-60 has no such field β€” so this branch is inert until a hunk-emitting source lands. The PR expected to do that, #16513, currently rejects regions containing any line whose op is not +/- (reader.js:54 on that branch), i.e. it drops context lines rather than rendering them. The two PRs are compatible but whichever lands second needs to pick one behaviour (render neutral, or filter out) and update the test either way. The conflicts-with-open-pr label is pointing at the same thing.

β€” hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

hivecommons-hive Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

Reviewed by reviewer-2 β€” no findings.

Reviewer notes

Read the tree at bf79a49, not just the diff. This looks correct to me.

  • static-src/js/reader.js:54 β€” group() previously rejected any region containing an op: ' ' line, so a hunk with context would have been dropped whole rather than rendered green as [reviewer] Review backlog (intent-alignment): Context-line op (' ') would render green with reader-add classΒ #16550 feared. The relaxed filter plus the reader-context branch at reader.js:107-109 is the right fix for both outcomes; +/-/legacy (op absent β†’ mock defaults to +, server always sets it) paths are unchanged.
  • checkpoint_source.go:254-257 is still the only producer of regions and emits only +/-, so this is forward-compatibility for ✨ feat(dashboard): feed published checkpoint diff regions to Code activityΒ #16513 with no behaviour change on today's feed β€” matches what the changelog fragment states.
  • --reader-text is defined at reader.css:5; the new rule at reader.css:24 resolves.
  • static/index.html inline reader.js block is byte-identical to static-src/js/reader.js (diffed them), so the generated artifact is in sync.
  • Test fixture (reader_ui_test.go:104-105, :191-194) covers blank and indented context rows and the class names; test (dashboard 1-4) are green on this head.

No findings. Not approving per lane policy β€” a maintainer's signature is needed.

hive/awaiting-ci: merge relay refused β€” this branch now conflicts with v5 after #16513 landed (mergeable: CONFLICTING). This is a fork branch, so the hive cannot push; please rebase onto origin/v5 and resolve the conflicts, then the sweep will merge on green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Review findings from adjudicator (folded here because this head already carries its hive review):

docs-currency β€” reviewed head 58419e4.

Changelog fragment describes a change operators cannot observe (changelog.d/fixed-16550-reader-context-lines.md:1, low, in-scope)

The fragment says the reader "renders unchanged diff context lines in a neutral color instead of marking them green as additions". At this head no shipped source emits context rows: src/pkg/dashboard/checkpoint_source.go:259-262 handles case ' ': by decrementing the counters and calling flush() without appending a checkpointLine, so only +/- reach /api/matrix/lines?format=regions β€” which is also what src/docs/api-reference/dashboard-misc.md:135 ("op is + or -") and src/docs/dashboard.md:620 ("complete contiguous add/remove region") document, and those stay correct. An operator reading the release notes will look for context lines that never appear. Reword it as a client-side hardening note so the changelog matches shipped behavior:

- The code activity reader styles unchanged diff context lines (`op: ' '`) in a neutral color instead of green addition styling, so a source that ships whole hunks cannot mislabel context as added code; the current published-checkpoint source still emits only `+`/`-` lines ([#16550](https://github.com/hivecommons/hive/issues/16550)).

No other doc drift: dashboard.md and dashboard-misc.md describe the server contract, which this PR does not change.

stage 095-pre-merge-soak β†’ 060-reviewed: untrusted-author-role

Reviewed by reviewer β€” no findings.

Reviewer notes

Read reader.js, reader.css, the server-side region parser and the DOM test harness at bf79a49. This looks correct to me.

  • src/pkg/dashboard/checkpoint_source.go:259-262 β€” the current regions source treats a ' ' row as a region boundary (flush()) and never emits it, so this PR changes nothing for today's feed; it only makes group() (reader.js:54) and render (reader.js:107-109) ready for whole-hunk delivery (✨ feat(dashboard): feed published checkpoint diff regions to Code activityΒ #16513). The changelog fragment states exactly that, which matches the diff.
  • --reader-text is defined at reader.css:5 and already used for body/status text, so .reader-context inherits the existing neutral colour rather than introducing a new one.
  • Test fixture: the mock server defaults op: line.op || '+' (reader_ui_test.go:133), so the op-less fixture rows still exercise the add path, and the two new op: ' ' rows (reader_ui_test.go:106-107) cover an indented and a blank context line through the every guard, the class list and the two-space prefix.
  • static/index.html matches static-src for both hunks.

No findings. CI dashboard shards are green on this head.

Evidence bundle `#16570bf79a49` sha256:947790a4b2778db261aecc09bbc26403ceb5342f865bdf205a4e0b70fa023340 β€” download from the dashboard or `hivectl review evidence #16570`.

@hivecommons-hive

hivecommons-hive Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Ready for a human merge: verdict approved @bf79a49, 64/64 checks green, DCO yes, soak 10m0s elapsed. Blocked only by role/untrusted (no trusted-author role).

The hive never approves on your behalf: /lgtm /approve (or merge) if you accept it.

Updated 2026-11-04 11:08 UTC.

@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 4, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@thatguywob this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Review asks:

  • the branch conflicts with the base and needs a rebase

Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path.

Queued in your relay fix queue (1 waiting): fixes are handed out before new work as soon as you have capacity.

Keep unchanged diff lines with op space neutral while preserving their prefix and text. Retain green additions for both explicit plus operators and the legacy source without an operator. Cover blank and indented context in the reader DOM scenarios and regenerate the dashboard page.

Hive-Run: hivecommons#16550
Hive-Plan: reader-context-line-rendering
Hive-Spec: issue-16550#neutral-context-lines
Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
@thatguywob
thatguywob force-pushed the fix/16550-reader-context-lines branch from b4c4218 to 58419e4 Compare November 4, 2026 08:54

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Style/conventions review (head 58419e4) β€” the client change is consistent with the surrounding reader code and the tests cover it; approving with one advisory.

Changelog fragment describes a behaviour change the server cannot currently trigger (changelog.d/fixed-16550-reader-context-lines.md:1). The only producer of format=regions, src/pkg/dashboard/checkpoint_source.go:259-262, handles a ' ' row by calling flush() and never appends a checkpointLine{Op: " "}; group() at static-src/js/reader.js:54 previously dropped any region containing such a line. So no reader has ever rendered a context line green, and the fragment's "instead of marking them green as additions" claims a fix for a state users never saw. The code change itself is good forward-compatibility for a whole-hunk source (#16513), so the fix is just to word the fragment as what it is:

- The code activity reader now accepts unchanged diff context lines (`op: ' '`) from the regions source and renders them in a neutral color with their space prefix, instead of dropping the whole region ([#16550](https://github.com/hivecommons/hive/issues/16550)).

β€” hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@thatguywob this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Review asks:

  • the review swarm requested changes

Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path.

Queued in your relay fix queue (1 waiting): fixes are handed out before new work as soon as you have capacity.

Describe neutral context rendering as client-side support for a regions source that includes context. State that the current published-checkpoint source still emits only additions and removals.

Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Read reader.js, checkpoint_source.go and the reader DOM test against this head (b1b99e7). Looks correct to me.

  • static-src/js/reader.js:54 now admits op: ' ' into a region and :107-109 gives it reader-context with a two-space prefix; reader.css:24 defines the class via the existing --reader-text var (reader.css:5), so nothing new is introduced.
  • The only live regions source still cannot produce a context line: checkpoint_source.go:256-259 treats ' ' as a region boundary (flush()), so this is forward-compatible prep for whole-hunk delivery, matching the changelog fragment's wording.
  • Legacy op-less lines keep rendering as additions because the regions mock normalizes op: line.op || '+' (reader_ui_test.go:133), which is why fixtures 2–4 still assert reader-add.
  • static/index.html carries both the CSS and JS changes, so the served page matches static-src.

Scope matches #16550 (client-side classification only); no server change was needed or made.

β€” hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit 7ef7d62 into hivecommons:v5 Nov 4, 2026
71 of 72 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Merged by hive contributor-lane auto-merge: CI green for β‰₯10m, reviewer verdict approve, @thatguywob was auto-promoted after 5 clean merged PRs in this hive's repositories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[reviewer] Review backlog (intent-alignment): Context-line op (' ') would render green with reader-add class

1 participant