Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[FEATURE] 3段フリック周りのリファクタリング

Open
#852 1 comment 3 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Quiet
Tech stack
kotlin
Domain
mobile-dev

Research direction

Review KeyboardDefaultLayouts and TfbiFlickNode.StatefulKey, then trace the controller’s angle handling and existing three-stage flick definitions. For the first small PR, define the neutral schema and mapper for existing three-stage flick data; filters, boundary metadata, and UI editing are later follow-ups.

Written by the indexing model from the issue text.

Description

refactoring

この機能リクエストは、何か問題に関連していますか?説明してください。

3段フリック周りを今後拡張しやすくするため、段階的にリファクタしたいです。
現状の KeyboardDefaultLayouts では、3段フリックの候補ツリーが TfbiFlickNode の runtime 構造として直接手書きされています。
そのため、候補の出し分け、角度判定の拡張、将来的なカスタムキーボード対応を入れるたびに、巨大なデフォルト定義へ条件分岐を足す形になるので保守性が下がるのではと懸念しています

望む解決策を説明してください

まずは runtime 用の TfbiFlickNode とは別に、保存・編集・生成に使える中立の flick definition schema を追加したいです。
最初の対象は3段フリックですが、設計としては「キーに対して、方向ごとの候補ツリーを持つ」汎用的な schema に寄せる予定です。
これにより、将来的には通常フリックや二段フリックも同じ定義モデルから runtime map へ変換できたらよいと考えています

schema から TfbiFlickNode.StatefulKey へ変換する mapper によって既存の3段フリックを移行できたら,以下を進めたいです

  • デフォルト3段フリック定義をgenerator経由に
    • きゃ/きゅ/きょ や きゅう/きょう のような候補を各行で重複して手書きする必要をなくします
  • あ行二段目候補を無効化する機能を追加
    • schema の feature filter として実装
    • 「ぁ」や「ゔ」など使用頻度が低い割に誤判定されがちな候補を無効にできるようにしたいです
  • 判定角度調整を一般化
    • #851 にてイ段の濁音/拗音境界向けに入っている角度調整を、方向ペアまたは候補境界単位で扱えるように一般化
    • schema 側に boundary metadata を持たせ、controller 側は metadata に従って判定する形へ寄せる想定です
  • カスタムキーボードで3段フリックを選択可能に
    • schemaをUI上で保存・編集できるようにします

各PRは可能な限り小さくするように努めます
全体の方向性など、ご意見いただけますと幸いです

追加のコンテキスト

Dominant language
Kotlin
Stars
345
Forks
36
Avg merge
10h 10m
Merged PRs (30d)
99

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from KazumaProject/JapaneseKeyboard

All issues in KazumaProject/JapaneseKeyboard

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.