from features.base import FeatureDetails, Line
from features.groups import Group

AMBIGUOUS = "ambiguous"


class RowLinksDetails(FeatureDetails):
    explains = 'The viewer turns item numbers in text into links. You can open the named item directly.'
    name = "row_links"
    group = Group.CHAT
    label = "Turn item numbers into links"
    hint = "“to-do 648” opens to-do 648"
    has_skill = False

    title = "Links for item numbers"

    abstract = "An item named in text, like “to-do 648” or “message 1712”, becomes a link to it."

    help = """
        Wherever the viewer shows text, a type followed by a number is marked on the server as a
        link to that row, and the viewer draws it as a chip that opens it. Text in code is left
        alone, and what is saved is always the plain words.

        A file named in text becomes a chip that opens it: a path, a path in backticks that exists,
        or a bare file name when exactly one project file has it. When you name a file that
        several project files share, you are told once to write its path instead.
    """

    lines = [
        Line(
            name=AMBIGUOUS,
            title="{{name}} names {{count}} files in the project",
            brief="write the path so the chat can link it: {{paths}}",
        ),
    ]
