コミットを比較

..
5 コミット
作成者 SHA1 メッセージ 日付
Codex Night Worker 24ccdae1c9 AI: address review on PR #456 2026-11-14 16:59:10 +09:00
Codex Night Worker 3663af3f48 AI: address review on PR #456 2026-11-14 16:27:36 +09:00
Codex Night Worker 97e44b84f8 AI: address review on PR #456 2026-11-14 16:07:49 +09:00
Codex Night Worker 1627450835 AI: address review on PR #456 2026-11-12 00:26:56 +09:00
Codex Night Worker ab0e28576d AI: address issue #454 2026-11-11 21:48:08 +09:00
5個のファイルの変更、22行の追加、38行の削除
+2 -5
ファイルの表示
@@ -69,11 +69,8 @@ class TagVersionsController < ApplicationController
parent_tags = parent_tags =
build_version_values(cur_parent_tag_ids, prev_parent_tag_ids, key: :tag_id) build_version_values(cur_parent_tag_ids, prev_parent_tag_ids, key: :tag_id)
.filter_map do |h| .map do |h|
parent = parent_json[h[:tag_id]] { tag: parent_json.fetch(h[:tag_id]),
next unless parent
{ tag: parent,
type: h[:type] } type: h[:type] }
end end
-30
ファイルの表示
@@ -215,36 +215,6 @@ RSpec.describe 'TagVersions API', type: :request do
expect(first.fetch('created_at')).to eq(t_v1.iso8601) expect(first.fetch('created_at')).to eq(t_v1.iso8601)
end end
[:parent_shared, :parent_new, :parent_old].each do |parent_key|
it "omits deleted #{ parent_key } from parent diffs" do
deleted_parent = public_send(parent_key)
deleted_parent.tag_names.destroy_all
deleted_parent.destroy!
get '/tags/versions', params: { id: tag.id }
expect(response).to have_http_status(:ok)
expect(json.fetch('count')).to eq(2)
versions = json.fetch('versions')
expect(versions.map { _1.fetch('version_no') }).to eq([2, 1])
expected_parents = [
[parent_shared.id, 'context'],
[parent_new.id, 'added'],
[parent_old.id, 'removed']].reject { _1.first == deleted_parent.id }
expect(versions.first.fetch('parent_tags').map { |entry|
[entry.fetch('tag').fetch('id'), entry.fetch('type')]
}).to eq(expected_parents)
expected_first_parents = [parent_shared.id, parent_old.id]
.reject { _1 == deleted_parent.id }.map { [_1, 'added'] }
expect(versions.second.fetch('parent_tags').map { |entry|
[entry.fetch('tag').fetch('id'), entry.fetch('type')]
}).to eq(expected_first_parents)
end
end
it 'returns empty when the specified tag has no versions' do it 'returns empty when the specified tag has no versions' do
fresh_tag = create(:tag, primary_name: 'no_versions_tag', category: :general) fresh_tag = create(:tag, primary_name: 'no_versions_tag', category: :general)
+10
ファイルの表示
@@ -70,6 +70,16 @@ describe ('SidebarComponent', () => {
vi.spyOn (HTMLElement.prototype, 'hasPointerCapture').mockReturnValue (true) vi.spyOn (HTMLElement.prototype, 'hasPointerCapture').mockReturnValue (true)
}) })
it ('limits sidebar scrolling to desktop to avoid clipping mobile suggestions', () => {
renderSidebar ()
// jsdom has no layout; guard the responsive classes responsible for clipping.
const sidebar = screen.getByText ('Sidebar body')
expect (sidebar).not.toHaveClass ('overflow-y-auto')
expect (sidebar).toHaveClass ('md:overflow-y-auto')
})
it ('uses maxWidth without applying the container main-width reserve twice', async () => { it ('uses maxWidth without applying the container main-width reserve twice', async () => {
localStorage.setItem ('sidebar:test-sidebar:left:width', '700') localStorage.setItem ('sidebar:test-sidebar:left:width', '700')
const onWidthChange = vi.fn () const onWidthChange = vi.fn ()
+1 -1
ファイルの表示
@@ -339,7 +339,7 @@ const SidebarComponent: FC<Props> = ({
</style> </style>
</Helmet> </Helmet>
<div className="h-full overflow-y-auto p-4 sidebar"> <div className="h-full md:overflow-y-auto p-4 sidebar">
{children} {children}
</div> </div>
+9 -2
ファイルの表示
@@ -35,6 +35,10 @@ const renderPage = () =>
describe ('TagDetailPage', () => { describe ('TagDetailPage', () => {
beforeEach (() => { beforeEach (() => {
vi.clearAllMocks () vi.clearAllMocks ()
tagsApi.fetchTag.mockReset ()
api.apiPut.mockReset ()
api.isApiError.mockReset ()
toastApi.toast.mockReset ()
api.isApiError.mockReturnValue (false) api.isApiError.mockReturnValue (false)
}) })
@@ -51,8 +55,11 @@ describe ('TagDetailPage', () => {
}) })
it ('submits edited tag fields', async () => { it ('submits edited tag fields', async () => {
tagsApi.fetchTag.mockResolvedValueOnce (buildTag ({ id: 7, name: 'old' })) const updatedTag = buildTag ({ id: 7, name: 'new', aliases: ['alias'] })
api.apiPut.mockResolvedValueOnce (buildTag ({ id: 7, name: 'new', aliases: ['alias'] })) tagsApi.fetchTag
.mockResolvedValue (updatedTag)
.mockResolvedValueOnce (buildTag ({ id: 7, name: 'old' }))
api.apiPut.mockResolvedValueOnce (updatedTag)
renderPage () renderPage ()