feat(ui): structured available-time window in listing form - #32
Merged
Merged
Conversation
The note placeholder suggested putting availability windows into free
text ("如:工作日 9:00-18:00 可用"), which the backend cannot parse.
Make availability a real structured field: weekday multi-select chips
(周一~周日 + 每天 shortcut) with start/end time inputs; empty = 全天
(all-day). The note is now pure text and no longer carries logic. The
listing shows the window when set (e.g. 周一~周五 09:00-18:00) or
"全天" otherwise. Adds SHARINGS.available mock data, chip styles, and
syncs docs (v1.10: US-8/US-9 AC) and ui/README.md.
Refs: rant 2026-08-17T10:54:48 (上架表单"可用时间段"改为结构化字段,备注只作纯备注)
11 of 12 tasks
argszero
added a commit
that referenced
this pull request
Sep 30, 2026
…-label rule (#329) The generic field-label rule `.form label { display:flex; flex-direction:column }` (specificity 0,1,1) outranked the component layer (0,1,0) for every label that carries a component class, so the layout the class asked for never applied: - `.check-line` — the settings notification checkboxes and the table-density radios rendered stacked (control above its caption, centred). #157 renamed the markup from `class="check"` to the prototype-canonical `.check-line` that #154 introduced, but left the stylesheet's `.form label.check` rule behind; that rule was the only thing turning a checkbox label back into a row, and it stopped matching anything. - `.chip` — the share-form weekday chips were pills; #32 turned them into `<label>`s, and the `display:inline-flex` #154 gave them was overridden. Fix: guard the generic field-label rules with `:not([class])`, so a classed label takes its box from its own class — the component layer wins as intended. Also drop the now-dead `.density-options .check` rule (#157 renamed that markup too) and give `.checkbox, .checkbox-line` back their own `display:flex`, which they used to borrow from the generic rule. Adds `src/layout_gate.rs` (test-only, compiled out of release builds, zero new dependencies) with two derived rules: every class used on a `<label>` in ui/index.html must declare its own `display`, and any rule that targets a bare `label` and imposes a layout must carry a guard excluding classed elements. Measured with jsdom over the whole document on both trees: check-line and chip go from column to row, while the unclassed field labels stay column in both. Co-authored-by: argszero <argszero@users.noreply.github.com>
11 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Make the listing key's availability window a structured field instead of free-text note. The old note placeholder ("如:工作日 9:00-18:00 可用") pushed structured info into text the backend cannot parse/enforce. Now: weekday multi-select chips (周一~周日 + a "每天" shortcut) with start/end time inputs; leaving it empty = 全天 (all-day). The note is pure text again.
Rant reference
Host instruction (rant
2026-08-17T10:54:48, 上架表单"可用时间段"改为结构化字段,备注只作纯备注):Changes
ui/index.html: new "可用时间段" field — weekday chips (#sf-days, 周一~周日 + 每天 shortcut) + 开始/结束时间 (type=time); note placeholder changed to "可填写任意说明,不影响生效规则" (pure text)ui/js/app.js:available: { days, start, end }ornull(no day selected = all-day); note stored as-is, never parsedfmtAvailable()(contiguous days compressed to 周一~周五, gaps joined with/; no window → "全天")ui/js/data.js: mockSHARINGSgainavailable(one 工作日 09:00-18:00, one 周末 10:00-22:00, twonull)ui/css/style.css:.chips/.chipstyles (checked state highlighted via:has)docs/user-stories.md: bumped to v1.10 — US-8 / US-9 AC updated (structured optional field, note = plain text, listing shows window or 全天)ui/README.md: synced sharing sectionVerification
node --check ui/js/app.js/ui/js/data.jspassfmtAvailablelogic tests: 周一周五 09:00-18:00 / 全天 / 周一/周三/周五 / 周六周日 10:00-22:00 — ALL PASScargo testpasses (1 passed)cargo fmt --checkpasses