Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

multi-textarea data model keyed on (url, timestamp)

未关闭
#98 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
停滞
领域
frontend

调研方向

首先追踪现有的 Spot datatype,以及 issue 中描述的当前 textarea-enhancement flow。将草稿的识别和恢复方式与提议的 URL/timestamp schema 进行比较;完成的标准是项目已经就用于保留和匹配多个 textarea 草稿的通用模型达成一致。

由索引模型根据 Issue 内容生成。

描述

enhancement

As the code stands, there is a Spot datatype. It represents the abstract concept of where a single textarea is. e.g.

  • appending the 2nd comment on issue 4
  • appending the 3rd comment on issue 4
  • pros: we have enough data to recreate the draft completely in the browser, and also enough data to tell if it was submitted or not
  • cons:
    • a lot of manual work for each place that we handle
    • ambiguity around things like the issues/new url. You might have multiple unsubmitted drafts in progress, they don't have server-side IDs yet, what should their spot be? Inevitably it gets tied to the time that the tab happened to open, in which case why bother with the complexity of defining the "abstract place where a comment is" if you end up just doing timestamp, URL pairs?

This approach really falls down for complex multi-form things, such as this:

Image

It would be really painful to lose the drafts in those textboxes, but it's also impossible to make a spot for each textfield in every issue/PR template that might be out there.

Another approach is this:

  • anytime a textarea gets added or removed, trigger a refractory state that waits until there's been no changes for 500ms
  • when that refactory period times out (the textareas have settled), the Spot is defined as:
    • primary key: (url, timestamp)
    • schema: list of textareas and their labels, as best we can tell in a generic way
    • title and icon: pulled from the tab by default
  • cons: most of the time, this is not enough data to reopen the tab for the user
  • pros:
    • if the user has opened a tab manually, we can find which saved drafts fit that schema
    • textareas can be enhanced by default, versus right now where they are enhanced only iff we have built an enhancer for that specific box
主要语言
HTML
星标
58
派生
0
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

diffplug/gitcasso 的其他 Issue

查看 diffplug/gitcasso 的全部 Issue

相似的 Issue

更多 Web Dev Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。