You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "Astro-Han (via GitHub)" <gi...@apache.org> on 2026/09/12 03:21:35 UTC
[PR] fix(desktop): align rail hover fills and put model config before the enable switch [maka]
Astro-Han opened a new pull request, #5212:
URL: https://github.com/apache/maka/pull/5212
## Summary
Two defects reported from the running app, one on the model page and one in the session rail.
**Model rows: 配置参数 and 开启 were reversed.** Each model row rendered its enable `Switch` before the 配置参数 trigger, so the toggle read as the leading control and the editor trigger as the trailing one. `SettingsExpandableRow` now renders the trigger first and its `afterAction` slot (the switch) last, so the enable toggle is the row's trailing control.
**Session rail: project and task hover fills were not left-aligned.** SideNav indents a group's children by 24px by default; the rail overrode that to an 8px nest so task titles line up with the project name. That 8px moved the whole task button — its hover/selected fill included — so the project fill started at x=8 and the task fill at x=16. The nest is now zeroed and the leading status gutter is 1rem, the same box the project row's folder icon occupies: titles still share one x, and both fills now start on the project row's left edge.
## Verification
Measured in the built Storybook with Playwright, `main` before vs this branch after:
- Rail (`Product/Sidebar Session List / ProjectGroups`): task row x − project row x was `8`, now `0`; both fills start at `x=8`; project and task titles stay at `x=40`.
- Model rows (`Product/Settings/Providers / StaticCatalogConnectionDetail`): the row was `[switch 986-1018][配置参数 1026-1106]`, now `[配置参数 986-1066][switch 1074-1106]`.
Checks run:
- `node --test dist/main/__tests__/session-project-hierarchy-contract.test.js` (updated) — pass
- `node --test dist/**/session-history-*.test.js` (`@maka/ui`) — pass
- `npm --workspace @maka/desktop run typecheck` and `typecheck:stories` — pass
- `npm run format`, `npm run lint` — clean
The updated contract test and both story play assertions fail on `main` and pass here.
The images below are the two stories rendered from `main`'s and this branch's `storybook-static` at the same viewport, light/dark, BEFORE left and AFTER right. The provider capture expands the page's internal scroller so the whole page is in frame.




## AI use
- [x] Generative tooling made a substantive contribution
Tool(s) and scope: Maka wrote the code changes, the test/story assertions, and the verification; the commits carry `Generated-by: Maka` trailers.
## Checklist
- [x] Tests cover the change and fail without it
- [x] Lint, format, typecheck and the affected suites pass locally
Does this PR entail a change in behavior?
- [x] Yes — described under Summary above
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] fix(desktop): align rail hover fills and put model config before the enable switch [maka]
Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han commented on code in PR #5212:
URL: https://github.com/apache/maka/pull/5212#discussion_r3995169553
##########
apps/desktop/src/main/__tests__/session-project-hierarchy-contract.test.ts:
##########
@@ -31,18 +31,30 @@ if (!sidebarCssUrl) throw new Error('Could not locate renderer/styles/sidebar.cs
const sidebarCss = readFileSync(sidebarCssUrl, 'utf8');
describe('project-grouped session hierarchy', () => {
- it('aligns session titles with the project name', () => {
+ it('shares the project row left edge with its sessions', () => {
const projectChildrenRule = sidebarCss.match(
/\.maka-project-row\s*>\s*div\s*>\s*\[role=["']group["']\]\s*>\s*div\s*\{([^}]*)\}/,
);
assert.ok(projectChildrenRule, 'project children must have an explicit hierarchy rule');
- // Product contract: 8px nest so session titles share the project title's x.
- // SideNav's default spacing-6 is a fixed child inset, not that alignment.
+ // Product contract: session rows sit on the project row's left edge, so
+ // the two hover/selected fills start on the same x rather than the 8px
+ // nest that used to offset only the session rows. SideNav's default
+ // spacing-6 is a fixed child inset, not that alignment.
assert.match(
projectChildrenRule[1] ?? '',
- /padding-inline-start:\s*var\(--spacing-2\)\s*!important;/,
- 'project sessions must keep an 8px hierarchical nest',
+ /padding-inline-start:\s*0\s*!important;/,
+ 'project sessions must not be inset from the project row',
+ );
+
+ // The gutter that replaces the nest: the same 1rem box as the project
+ // folder icon, so titles still share one x.
+ const signalRule = sidebarCss.match(/\.maka-session-row-signal\s*\{([^}]*)\}/);
Review Comment:
Done in da45102cd. The contract now names the `ProjectGroups` play that owns the rendered half (session inset within 1px, title x within 2px). I kept the CSS-text assertions — as you note, they pin the edit that is actually likely and run without a browser; this just stops a green contract from being read as geometry coverage it does not have.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] fix(desktop): align rail hover fills and put model config before the enable switch [maka]
Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han commented on PR #5212:
URL: https://github.com/apache/maka/pull/5212#issuecomment-5643593147
On the `model-dark` screenshot in the description: I re-checked all four `user-attachments` URLs in the current body — each returns `200 image/png` and is byte-identical to the local file (provider-dark is `c22f0a11…`, i.e. the provider dark comparison). Looks like the asset fetch failed transiently at review time; nothing to re-upload as it stands, but I will replace that attachment if it recurs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] fix(desktop): align rail hover fills and put model config before the enable switch [maka]
Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han merged PR #5212:
URL: https://github.com/apache/maka/pull/5212
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] fix(desktop): align rail hover fills and put model config before the enable switch [maka]
Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener commented on code in PR #5212:
URL: https://github.com/apache/maka/pull/5212#discussion_r3995035451
##########
apps/desktop/src/main/__tests__/session-project-hierarchy-contract.test.ts:
##########
@@ -31,18 +31,30 @@ if (!sidebarCssUrl) throw new Error('Could not locate renderer/styles/sidebar.cs
const sidebarCss = readFileSync(sidebarCssUrl, 'utf8');
describe('project-grouped session hierarchy', () => {
- it('aligns session titles with the project name', () => {
+ it('shares the project row left edge with its sessions', () => {
const projectChildrenRule = sidebarCss.match(
/\.maka-project-row\s*>\s*div\s*>\s*\[role=["']group["']\]\s*>\s*div\s*\{([^}]*)\}/,
);
assert.ok(projectChildrenRule, 'project children must have an explicit hierarchy rule');
- // Product contract: 8px nest so session titles share the project title's x.
- // SideNav's default spacing-6 is a fixed child inset, not that alignment.
+ // Product contract: session rows sit on the project row's left edge, so
+ // the two hover/selected fills start on the same x rather than the 8px
+ // nest that used to offset only the session rows. SideNav's default
+ // spacing-6 is a fixed child inset, not that alignment.
assert.match(
projectChildrenRule[1] ?? '',
- /padding-inline-start:\s*var\(--spacing-2\)\s*!important;/,
- 'project sessions must keep an 8px hierarchical nest',
+ /padding-inline-start:\s*0\s*!important;/,
+ 'project sessions must not be inset from the project row',
+ );
+
+ // The gutter that replaces the nest: the same 1rem box as the project
+ // folder icon, so titles still share one x.
+ const signalRule = sidebarCss.match(/\.maka-session-row-signal\s*\{([^}]*)\}/);
Review Comment:
**[P3] This contract pins the CSS declarations, not the geometry they are meant to guarantee.**
Both assertions match text in `sidebar.css`: `padding-inline-start: 0 !important` on the group inset, and `width: 1rem` on `.maka-session-row-signal`. That is the right pair to pin — they are exactly the two values that let the session fill start on the project row's left edge while the titles stay on one x, and changing either one turns this red. A second lane confirmed it is not vacuous by swapping in `main`'s `sidebar.css` and watching it fail with `project sessions must not be inset`, then passing again on this branch.
What it cannot see is whether those declarations still *win*. A StyleX default that changes shape, a later rule with equal-or-higher specificity, or a renamed wrapper class would all leave this regex satisfied while the rail drifts apart again — which is the failure this file exists to prevent, and the reason the `!important` and the child-combinator comment are there in the first place.
Not a defect, and not a request to replace the test: a text contract is cheap, runs without a browser, and catches the edit that is actually likely (someone tuning the inset). The gap is that nothing in ordinary CI asserts the resulting geometry. The `ProjectGroups` story does assert `sessionInset |Δ| ≤ 1px` and title x within 2px, so the coverage exists — it just lives in the Storybook lane rather than beside this contract, and the comment here does not say so.
**Minimal fix:** one line in this test pointing at the story that owns the rendered-geometry half, so a future reader who sees a green contract knows what it did and did not establish.
> **Automated review notice:** This comment was posted by an automated review agent operated by jackwener (seat: kabi-opus, synthesising a second independent lane run by seat Ox-Qronos). It is not an independent human review and does not replace one.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org