sam-datepicker-v2 renders unstyled: .datepicker__* CSS was lost in the 2019 fork
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- angular, playwright, sass, typescript
- 領域
- accessibility, frontend, testing
調査の方向性
まず picker.component.ts、picker.template.html、date-range-v2.component.scss を upstream コンポーネントと比較し、その後 scripts/consumer-deep-imports.json と提案された 3 つのパスを確認します。/datepicker ギャラリーと test-app/e2e/datepicker.spec.ts を実行します。選択した決定が記録され、カレンダーのカスケードとアクセシビリティ設定をテストでき、Playwright のアサーションがパスすれば完了です。
索引モデルが issue の本文から書いたものです。
説明
sam-datepicker-v2 renders with no styling at all. Its template asks for a full set of bespoke .datepicker__* classes that are not defined in any stylesheet — not in this repo, not in sam-styles/, not in @gsa-sam/sam-styles, and not in any node_modules of either workspace.
Measured on the /datepicker gallery route added in #666 (Chromium, real browser):
popup: 684 x 2081 px
.datepicker__calendar position: static (needs absolute)
.datepicker__calendar__month__day display: block, width: 684px
Day cells stack vertically down the page instead of forming a 7-column grid, and the popup is not positioned over the input.
Root cause
sam-datepicker-v2 is a fork of angular2-material-datepicker (MIT). The animation trigger is byte-identical, keyframe offsets and all:
// upstream and SAM, identical
trigger('calendarAnimation', [
transition('* => left', [ animate(180, keyframes([
style({ transform: 'translateX(105%)', offset: 0.5 }),
style({ transform: 'translateX(-130%)', offset: 0.51 }),
style({ transform: 'translateX(0)', offset: 1 }) ]))]),
Upstream carried its CSS inline in styles: [...] — 25 .datepicker__* rules, including the structural ones:
.datepicker { position: relative; display: inline-block; }
.datepicker__calendar { position: absolute; overflow: hidden; z-index: 1000;
top: 1.9em; left: 0; height: 24.25em; width: 20.5em;
background-color: #fff; box-shadow: 0 3px 6px rgba(0,0,0,.16), 0 3px 6px rgba(0,0,0,.23); }
SAM's fork (3ba95ec0, Feb 2019, "PR for adding date range component related to IAE-14621" #263) moved the inline template out to picker.template.html and dropped the styles: block entirely, without re-adding it to either the component or sam-styles/. The class names came along, so the markup still requests CSS that has never existed in this repo. date-range-v2.component.scss has been 0 bytes since that same commit and picker.component.ts has no styleUrls.
Why this went unnoticed for ~7 years
Nothing rendered it. test-app could not render any library component until #665, and the sole tracked consumer does not use this component:
scripts/consumer-deep-imports.jsontracks 3 consumers, all the same app (iae-sam-front-end,-front-end3,-front-end-uat).- Zero occurrences of
sam-datepicker-v2orsam-date-range-v2in that app's source. It uses the stable control instead: 32x<sam-date>, 8x<sam-date-range>. SamUIKitModule->SamExperimentalModuledoes registerSamDateRangeV2Module, so it is compiled into the consumer bundle and available in templates — just never used.- Five other SAM frontends checked (
-search,-admin,-integrity,-systemaccounts,-role-management-service) do not depend onsam-ui-elementsat all.
Contrast with the stable sam-date, which also has no styleUrls but whose markup uses USWDS classes (usa-form-group, usa-form-control) that every consumer already loads globally. That is why sam-date renders fine with no CSS from this library and sam-datepicker-v2 does not.
Decision needed first
Given zero known consumers, "write calendar CSS" may not be the right answer. Pick one:
- Restore the lost upstream CSS as component
styleUrls(matchesexperimental/tabs, which does self-style; Angular's_ngcontentscoping avoids any global-namespace collision). Upstream is MIT — attribute it. - Add it to
sam-styles/themes/sam-gov, matching the library's dominant global-CSS model (that is howiae-sam-front-endstyles the kit:@import '@gsa-sam/sam-ui-elements/sam-styles/themes/sam-gov'). Riskier — global namespace. - Deprecate
date-range-v2. It isexperimental/, forked, unstyled, and unused. Removal is a breaking change for the deep-import contract, so checkscripts/consumer-deep-imports.jsonfirst (it currently lists nodate-range-v2paths).
Two smaller, separable gaps
These are legitimately the consumer's responsibility, but the harness needs them for manual testing either way:
.fa fa-calendar— a SAM addition (upstream had no icon; it clicked the input).@fortawesome/fontawesome-freeis a root peerDependency, so consumers load the webfont CSS.test-apphas onlyfontawesome-svg-core(JS/SVG API), so no glyph renders..sr-only— Bootstrap-era class.@gsa-sam/sam-stylesships only USWDS.usa-sr-only, so nothing defines it and the screen-reader label renders as the visible text "Calendar" next to the input.
Acceptance criteria
- A decision is recorded on options 1/2/3 above
- If styling:
.datepicker,.datepicker__calendar, nav/arrow/chevron,__labels/__label,__month/__month__day, and__cancelall render as a positioned 7-column calendar overlay - If styling: upstream MIT attribution is included alongside the restored rules
-
test-apploads FontAwesome webfont CSS and an.sr-onlyrule so/datepickeris manually testable without DevTools injection - Playwright assertions cover the cascade-level properties jsdom cannot see (
position: absoluteon the popup, popup width, day-cell width ~14.28%) — per AGENTS.md's Vitest/Playwright boundary - The existing open-click guard in
test-app/e2e/datepicker.spec.tsstill fails when thecontains()fix inpicker.component.tsis reverted. It clicks the.sr-onlychild explicitly for exactly this reason; adding an.sr-onlyrule collapses that span to 1x1, and a centre click on.fa-calendarwould pass even with the defect reintroduced. Verify by reverting the fix locally.
Context
Found while manually testing #666, which added the /datepicker gallery route — the first time this component had ever been rendered in a browser in CI or locally. Deliberately kept out of #666 to hold that PR to its two event-handling fixes.
- 主要言語
- TypeScript
- スター
- 8
- フォーク
- 34
- 平均マージ
- 3日 5時間
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
GSA/sam-ui-elements のほかの issue
-
github_actions security
難易度 2/5 半日 初心者へのやさしさ 88/100
GSA/sam-ui-elements#761 ·
メンテナーはふだん 1 日以内に返信
-
tech-debt
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
GSA/sam-ui-elements#708 ·
メンテナーはふだん 1 日以内に返信
-
disablePageTabIndex() sets aria-hidden on the focused calendar button, and enablePageTabIndex() never removes it再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンbugfix
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
GSA/sam-ui-elements#682 ·
メンテナーはふだん 1 日以内に返信
-
Burn down ESLint and Angular lint debt再び着手できるかも @fpigeonjr が 70 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンangular-upgrade maintenance
GSA/sam-ui-elements#580 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
sam-ui-elements pipeline modernization + Angular 19→21 upgrade (SAM Angular upgrade — 4th tracer bullet) — IAEMOD-61187再び着手できるかも @fpigeonjr が 82 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンangular-upgrade maintenance
GSA/sam-ui-elements#562 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
GSA/sam-ui-elements の issue をすべて見る
似ている issue
-
[fullsend] E2E: scorecard — filecheck GitLab entity metrics unavailable due to initialDelay timingオープンe2e-failure ready-to-code
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
redhat-developer/rhdh-plugin-export-overlays#4698 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
devswha/herdr-web-ui#2884 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
b:minor bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
software-mansion/argent#1771 ·
メンテナーはふだん 1 日以内に返信
-
Resources: New palettes of Xiamen対応中かも @rmt-svc が今日担当しました。 オープンresources
難易度 1/5 1〜3時間 初心者へのやさしさ 74/100
railmapgen/rmg-palette#2491 ·
メンテナーはふだん 4 日以内に返信