Repository navigation
feat(app-shell): the left sidebar resizes by its edge and floats as a card; a menu opened from the float keeps it out - #36655
Conversation
… card, and a menu opened from the float keeps it out Claude-Session: https://claude.ai/code/session_01JQwxbWjfzbfpWXFKqr1sFF Co-authored-by: Claude <noreply@anthropic.com>
…menus Claude-Session: https://claude.ai/code/session_01JQwxbWjfzbfpWXFKqr1sFF Co-authored-by: Claude <noreply@anthropic.com>
…mit) Claude-Session: https://claude.ai/code/session_01JQwxbWjfzbfpWXFKqr1sFF Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbWjfzbfpWXFKqr1sFF Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbWjfzbfpWXFKqr1sFF Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Open must-fix: none. Open should-fix: none. Notes: the changeset gloss over-claims the surface (①); no handle cleanup on unmount mid-drag (③); the width is per browser, not per user (③); no below-range or non-number read test (③); the 768 px and 1280 px cost at 350 (③); no Implemented-by: VERDICT: PASS |
… a cancel; the changeset names only the i18n key (#36227) The width handle unmounts mid-drag when ⌘/Ctrl+B folds the sidebar or the window narrows past 768 px. Its unmount now ends the drag as a pointer-cancel does: body cursor and user-select are restored and the preview width is dropped, so the sidebar goes back to the width it had. A test pins both paths. The changeset's Clause-② gloss claimed new exports from the app shell's sidebar module; app-shell is private and re-exports neither, so it now names the one i18n key, as the PR body does. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbWjfzbfpWXFKqr1sFF
|
repo:objectstack#1 · os-warren · session_01JQwxbWjfzbfpWXFKqr1sFF
Once #36656 lands, merging main clears it. No change for it here. Generated by Claude Code |
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj Contract reviewServed-tier: Round 2The delta is one commit, eb24661, on top of eebb750. It touches 3 files and nothing else moved (
① Derived judgments (carried from round 1)
② Semver level (carried)
③ Boundary flags (carried)
④ Design judgment (carried)
Open must-fix: none. Open should-fix: none. Notes still open: no restore of a Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj 维护者速读左侧栏现在可以拖动右边缘调宽(200 到 350 像素),双击恢复默认,宽度记在这台浏览器里。收起后的浮出侧栏改成卡片样式,鼠标移走就收回。 席位核对 — ACCEPT (L1) · repo:objectstack#1 · head
|
objectstack-ai#36657) <!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ89Betg8QPoUPD5NhDenSfS2)_ Fixes objectstack-ai#36364 Clause-②: yes (widening) — three new `@object-ui/i18n` keys (`designMode.menu.newReport`, `designMode.menu.newReportLeft`, `report.builder.addsToMenu`) in all 11 locales; no spec, schema or public export change Metadata-protocol: none repo:objectstack#1 · os-warren · session_01JQwxbXq2Dxb31zZNmSqCtz ## 维护者速读 - 用户能看到什么变化:管理员在设计模式里「添加菜单项 → 报表」,第一行是「新建报表…」,点了会占好菜单位置并打开报表搭建页;选好数据来源和指标、保存后,新报表出现在占好的位置,设计模式里的其他改动一起保存。 - 为什么做:设计模式专题卡的报表这一半,按席位定的方案:报表必须先有数据来源和指标,所以从搭建页新建,而不是只填名字。 - 出错会怎样:菜单保存失败时,刚建的报表会被删掉,设计模式和搭建页都保持打开;中途关闭搭建页或离开它,什么都不写、占位消失;可以直接撤回本次合并。 - 要你做什么:不用做什么。 ## What changes The report half of objectstack-ai#36364, on top of the report builder (objectstack-ai#36644), per the seat's ruling (option A, comment 7090058961): a report needs `dataset` and `values`, so 「New report…」 opens the builder, and the report and its menu entry are written only when the builder saves. - **Picker** (`DesignModeMenu.tsx`): the Reports list starts with 「New report…」. It holds the place (the dashed row now reads 「New report…」), offers a slot, and navigates to the app's `reports/new`. Nothing is written. - **The slot** (`designModeReportSlot.ts`, new): the menu lives in the sidebar and the builder in the page, with no shared tree, so a module-level store holds one slot `{ path, save, cancel }`. It is keyed by the builder's address, not the app's name, because the console addresses an app by its route segment (the showcase app is `/apps/com.example.showcase`, its name `showcase_app`). This was found on the live run, and a page test pins it. The menu withdraws the slot when the place is dropped and when it unmounts (the design mode ended). Without a slot the builder is the plain new-report page, as before. - **The builder page** (`ReportNewPage.tsx`): when a slot waits on its address, it says 「Saving creates this report and adds it to the menu where you placed it, with your other design changes.」. Its Save hands `(name, label, body)` to the slot and writes nothing itself. A refused save keeps the builder open. Its Close cancels the place and goes back. - **The save** (`designModeMenuCreate.ts`): `NewMenuItem` gains a `report` arm carrying the builder's body. `saveAppMenuWithNewItem` runs the dashboard half's order unchanged: every menu-save check first, then the report saved and published in the menu's own package (`saveAndPublishInPackage`, the package-bound door `saveDashboardInPlace` now shares), then the menu written with the entry in the held place and every other staged edit (`saveWith`). On a refused menu the report is removed again. - **Leaving the builder another way** (a menu link, Back) drops the held place too, so no row waits for a builder that is gone. - **The entry's label**: a report entry with no `label` shows its machine name (only object, view and dashboard entries inherit their target's label, per the cloud#2021 ruling), so the new entry carries the report's label. The live run first showed `hui_kuan_fenxi` in the menu, and this fixes it. ## Tests - `pnpm --dir ui exec vitest run packages/app-shell/src/layout packages/app-shell/src/views/ReportNewPage` at `f3021225`: `Test Files 157 passed (157)`, `Tests 1284 passed (1284)`. `DesignModeMenu-36363.test.tsx` was rerun at head `ecbe0f66` after the label change: `38 passed`. Earlier at `f7737e36`, `packages/i18n` gave `1978 passed`, with the de quote-pairing count raised 128 → 129 for `newReportLeft`'s „{{name}}“. - New pins: - `designModeMenuCreate-36364.test.ts`: 4 report cases. They cover the body, the package write order (ensure → save/publish report → save/publish app), a refused menu resetting the report, and an unlisted package creating nothing. - `DesignModeMenu-36363.test.tsx`: 5 report cases. They cover the picker row holding the place and writing nothing; the builder's Save writing the report, then the menu with the labelled entry and the other staged edit, then leaving the mode; a refused menu; the builder's Close; and leaving the builder. - `ReportNewPage.menuSlot-36364.test.tsx`: 5 cases. They cover Save going through the slot; a refused save staying open; Close cancelling and going back; a route segment other than the app's name; and another app's slot not being used. - Ablations (one-shot, not kept): without the page change, the page file went 3 failed | 1 passed. Without the menu change, all 5 menu report cases were red. - `tsc --noEmit` (app-shell) exit 0. ESLint on the changed files: 0 errors. `check-i18n-call-site-keys` exit 0. ## Screenshots Taken on the live showcase example (fresh backend, console dev server, zh-CN, deviceScaleFactor 2). They are stored with the seat's project files (`issue-36364/`): 1. 「添加菜单项 → 报表」, with 「新建报表…」 first. 2. The builder, with the held 「新建报表…」 row under 数据分析 and the 「adds to the menu」 line. 3. The builder filled: Invoice Metrics, grouped by status, named 回款分析. 4. After Save: the design mode is left, and 「回款分析」 sits in the held place, open. 5. Cancel path: a second 「新建报表…」, closed from the builder. The page goes back, no held row is left, and the mode stays on. Checked through the API after the run: - `report/hui_kuan_fenxi` is stored in `com.example.showcase.custom`, the menu's package (the same item Studio lists), with `_diagnostics.valid: true`. - The app's menu holds `{ id: nav_item_1, type: report, reportName: hui_kuan_fenxi, label: 回款分析 }` under `grp_analytics`. - It is the only `hui_kuan*` report, so the cancelled build left nothing. ## Overlap `overlap-check`: merges cleanly with main, objectstack-ai#36655 and objectstack-ai#36525. With objectstack-ai#36629 it conflicts only in `de-quote-pairing-3876.test.ts`, because both PRs raise the same German quote count. Whichever lands second re-adds 1 to the count. --- _Generated by [Claude Code](https://claude.ai/code)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Warren · project thread
Fixes #36227
Fixes #36471
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
Resize (#36227) —
ui/packages/app-shell/src/layout/SidebarWidthHandle.tsx(new),UnifiedSidebar.tsx,consoleSidebarRail.tsrole="separator"handle: a pointer drag resizes it between 200 and 350 px (Attio's range, the card's numbers), a double-click comes back to 256 (unchanged default), ← → move it 16 px, Home / End go to either end.console.sidebar.width(CONSOLE_SIDEBAR_WIDTH_PREFERENCE, stored{"width":N,"v":1}, read back clamped to the range). Kept on drag end, not mid-drag.--sidebar-widthon the console'sdisplay: contentsframe around the sidebar, so the in-flow gap, the docked panel and the float all take it. While a drag runs the frame turns off the primitive's width transition so the panel follows the pointer. The phone drawer is untouched (it sets its own width), and so is@object-ui/components.The float is a card (#36227 items 2–4) —
RAIL_OVERLAY_PANEL,RAIL_HIDDEN_PANELinconsoleSidebarRail.tsrounded-lg, a border andshadow-xl. Nothing dims or moves the page under it (no backdrop, the gap stays at 0).main(应用侧栏:收起后完全隐藏,不再留一列没有文字的图标;鼠标移到左边缘时浮出完整菜单 #35062 / 外壳(二)去掉顶栏:侧栏常驻可收起;应用名、搜索、头像进侧栏;应用菜单只做换应用;提示条移到内容区顶部 #36112). Unchanged except as below.A menu opened from the float keeps it out (#36471) —
useConsoleSidebarRailPanel…, an entry) stops the clock; and when the clock fires it folds only if no menu or dialog is open and the pointer is not on the float. "On the float" includes the 8 px margin the card now keeps from the window edge, where the pointer that floated it rests.…): the same press path, so the same fix. The account menu and an entry's…were checked in the browser (screenshots 6 and 7).i18n —
sidebar.resize("Resize sidebar", the handle's accessible name) in all 11 locales.Screenshots (1440 × 900, local showcase app, this branch)
…menu from the floatTests
UnifiedSidebar.hiddenCollapse-35062.test.tsx(the shared harness, two new top-leveldescribes, 10 tests):user-select/cursorand the width; collapsed there is no handle, the float takes the kept width with the card classes and the hidden panel the parked card; a phone sets no width.eb24661e2(fromui/,pnpm exec vitest run packages/app-shell/src/layout/__tests__/): Test Files 155 passed (155), Tests 1276 passed (1276).tsc --noEmitof@object-ui/app-shell: exit 0; eslint on the changed files: clean. Ateebb75006the 30dispatch-gates --commandsfamilies ran locally, all exit 0.scripts/ablation-replace.mjs, restored to the HEAD blob each time): removing both halves of the 侧栏收起时从滑出的侧栏点应用名:侧栏收回去,应用菜单留在屏幕最左边被切掉一截 #36471 fix turns the three press/keyboard tests red; removing only the press half turns "a press in the float stops the fold's clock" red; removing only the fire-time check turns the keyboard test red. Each half is pinned by its own test. Dropping the handle's unmount cleanup turns the mid-drag test red.consoleSidebarRail.width-27593.test.tsx: comment only (the 256 it pins is now the default, not a fixed width).Acceptance notes
bg-sidebarwith a backdrop blur (pre-existing). Over page content the card shows a blurred hint of what is under it near its edge (visible in screenshot 3). Attio's card is opaque; not changed here.Verification
Read first, by risk:
consoleSidebarRail.ts(the fold timer andpointerOnFloat),UnifiedSidebar.tsx(the frame's--sidebar-width),SidebarWidthHandle.tsx.Two-minute check: at 1440 wide, drag the sidebar's right edge right, then double-click it; collapse with the sidebar's button, rest the mouse on the window's left edge, and as the card slides in click the app name: the app menu shows whole and the sidebar stays until you press Esc and move away.
Generated by Claude Code